I have requirement to change AGSPictureMarkerSymbol picture when user clicked on marker? is this possible?
We don't have an alternate image property that you can just switch to when you click the marker.
You would have to manually switch the symbol, and how you do that would depend on whether the marker comes from a feature service or is a graphic in a graphics overlay. There are a couple of possible approaches.
There may be other approaches I haven't thought of. I've used the first approach myself and it works well, but only if you understand the original renderer.
I've been working on a similar requirement. My observation is the one problem with reassigning the renderer, even with a uniqueValueRenderer, is that all the markers flash off and on. This isn't the best experience. We are starting with a AGSGraphicOverlay, not a feature layer, but solution should be similar. We also have a requirement to animate the marker. I'll share when I'm done, but here are the general steps:
1) Query the graphic overlay (or feature layer) with identify task.
2) Set the visibility of the selected graphic (or feature) to false.
3) Add a custom UIImageView as a sublayer to the mapView, using the mapView.location(toScreen: AGSPoint) to construct a CGRect for the image view frame
4) Animate the image view, in my case, translating to grow, but maintain tip of marker on location
5) Add marker with same final image, size and yOffset to a second graphic overlay
6) Upon new tap, remove the second graphic overlay, optionally re-add and animate down an image view, remove it, and set all graphics in the first graphic overlay to isVisible = true
Hope this helps.
Cheers,
Jake
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.