I want each marker on the map (Map View) with different id so that I can remove it or change its icon dynamically at run time.
How do we achieve that ?
Also please I want the best way to add many markers on the map without making it slow when moving it on taping over it.
Thanks in advance
Subclass
OverlayItem
and store whatever you want in it, using that instead of the ordinaryOverlayItem
class for your items. For example, this sample project has aCustomItem
subclass ofOverlayItem
that, among other things, draws different icons at runtime.Don't "add many markers" to an
ItemizedOverlay
, to the point where it is "when moving it on taping over it".ItemizedOverlay
is designed for small numbers of items.If you need lots of items, you will most likely need to create your own
Overlay
, where you can have more smarts about which subset of your items will be relevant at any given time.