Select to view content in your preferred language

How to keep graphics not moving when map zoom or pan

415
1
02-28-2022 10:50 PM
baohuachu2
Emerging Contributor

Want to create the function as Uber, to create the pick up place and drag the map as background. While the location of the graphic keeping not change.

 

 drag the map and location point keep fixed positiondrag the map and location point keep fixed position

0 Kudos
1 Reply
GuntherHeppner
Esri Contributor

Hi, if I understand correctly, you would like to show a static pushpin on top of a MapView and when the user stops panning the MapView, you want to determine the location on the map where the pushpin points to and then do some action based on that map location? If that's correct, I have the following suggestions:

1. The Runtime SDK for Android does not provide support for showing that static pushpin. You will have to implement a UI layout that overlays some pushpin View element on top of the MapView. You will have to make sure that the pushpin View element is not clickable, so that the touch events are still received by the underlying MapView, so that users can still pan the map.

2. Once the user stops panning the map, you would want to use the screen location of your pushpin and convert that to the corresponding map location. You can use the MapView.screenToLocation() call for that.