-
Notifications
You must be signed in to change notification settings - Fork 319
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
Question: Updating position of image/icon on map #1521
Comments
Hey @richjhart 👋 - if I'm understanding correctly, I think our new annotations plugin may be helpful here. Documentation is here. You would be able to create a To animate, you can use an I'm going to go ahead and close this as non-actionable on the SDK part. I hope the tips here help out a bit. Thanks! cc @tobrun @LukasPaczos to double check I'm speaking correctly here. |
@danesfeder Thanks for the quick reply. From a quick look at the documentation and links, it appears to be exactly what we're after. |
@danesfeder Unfortunately, I am still having some issues with this. Note that I am unable to use an What I am finding is that even during an animation, the symbol is disappearing for a brief period during the middle of the animation if I move it too far (or if it jumps - i.e. not animating it). As far as I can tell, this is reasonably consistent - and might be deliberate, because it's very smooth if it's moving a short enough distance, so it doesn't seem to be a performance thing. Basically such that if the symbol moves more than a certain distance between calls, it is cleared for a time before appearing in the new position. This doesn't occur with a Is there an option/configuration to allow it to not disappear during the transition? |
The fade in/out you are seeing is most likely the symbol collision algorithm. Would you mind retesting your setup after calling below?
This will disable collision detection but will get rid of the fade as well. You can read more about those properties in the style specification. |
Thanks @LukasPaczos, that seems to have done the trick. I did notice those properties but I didn't think it would be related because it always seemed to be related to the distance of the jump, not whether any other symbols were present nearby. I am still finding that occasionally it will disappear briefly, but only when it's very stressed (low spec device, and animating multiple items and moving the map), which we can live with. But I now have two symbols, animating correctly, in the correct z-order that I need them - so all is good! Thanks @danesfeder @LukasPaczos for the quick replies and the solution! |
Thanks for the help here @LukasPaczos and glad to hear things are working @richjhart 👍 |
@LukasPaczos @danesfeder I'm now getting a native code crash randomly - I think when using the annotation library. It's difficult to trace exactly where it occurs, but it appears to be related to the annotation (due to referring to a Feature id), and during the animation (due to my most recent debug statements). Any idea what might be causing this? 2018-11-14 11:16:29.110 2802-2802/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
At first glance, it looks like we are somehow passing a |
@LukasPaczos I have raised mapbox/mapbox-plugins-android#770 It's quite likely we're doing something wrong - maybe we're passing invalid coordinates or something at some point, which might be setting up an invalid state. But obviously I'd expect an IllegalArgumentException or IllegalStateException if that was the case. |
Thank you for all the info in mapbox/mapbox-plugins-android#770, we'll investigate this one further. |
I need to place several icons on my map, and need to be able to move them around. There seems to be two ways of doing this, but both have a different problem that I can't seem to work around at the moment.
Simply add the points to the map using addMarker(). This has the following problems:
a) Which image ends up on top seems to be random
b) I don't think I can rotate the marker, which I may need to be able to do
Use two
SymbolLayer
s. This has the following problem:When I update the source with a feature at the new position, the icon generally disappears and appears in the new position. This means I can't seem to animate the movement.
The text was updated successfully, but these errors were encountered: