-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to update image source of ol.Sprite ? #13
Comments
Awesome! I also have a question about clustering. I have thousands of objects on my map. I use clustering from ol-ext and each feature has different image and style (red object for passive, green for active). Features move on map like transport one coordinate to another. Sprite objects move smoothly. It's more suitable for my project than a normal feature. Is it possible to use ol.Sprite objects for it? Can openlayer handle thousands of sprite objects with clustering? |
ol.Game engine cannot handle multiple objects asynchronously that i see. i've tried it with 1k objects and 10ms interval that set destination to the random objects.Result was that FPS is around 11-12 on my workstation pc. |
Rendering lots of objects has performance issues. Actually, drawing lots of features on canvas with js is not a good idea...
One way is to use different technics depending on the zoom, with 2 layers on a single source
At small zoom the bin layer is drawn and the grid show the activity on territory |
Currently, i use ol-ext cluster. Actually i overwrited cluster source's refresh function. An interval changes refresh state every 5 seconds. Websocket method updates each feature's coords in global dictionary/array. As you can imagine, features suddenly teleport on the map. I was excited to see the walking sprite objects in ol-games lib. Unfortunately, it cannot handle many features movement. But i still use it for special purposes. Thanks again! |
Hello, first of all, thanks for this lib!
I'm trying to change image within time or speed which comes through websocket. I couldn't find an official method to change it.
then i want to change only "src".
after this set, nothing happens unless move/zoom on map.
Also i have an interval to check if device is in passive mode and not sending gps data So i change image to passive one.
Is there any better way to update image for this purpose?
ol: v5.2.0
ol-ext & ol-games: latest
The text was updated successfully, but these errors were encountered: