Open phlegx opened 7 years ago
I'm not sure what you mean by the order of the markers. Can you clarify? What problem is being caused? Screenshots or code samples might help.
Hi @jawj! Example: All markers are in an ordered Array and all markers overlap's. I have two types of markers: red and green. The red markers are always at the beginning of the array. If I loop trough the array to add the marker to the map (normal Google Maps add marker function), the most upper marker is still green, because it is the last marker in the array. Until here all works fine but if I loop the same way over the array to add the marker to the OverlappingMarkerSpiderfier
layer, the maps shows me some time a green marker and some times a red marker on top of overlapped markers. Why?
In general, the markers shown on top should be the ones lower down the screen (i.e. at lower latitude), and only in the case of a tie (i.e. identical latitudes) would I expect indeterminate results.
Your problem sounds like a Z index issue, but OMS only touches the Z indices when spiderfying, and restores them straight after.
I would need to see working examples both ways (with and without OMS in use) to investigate further. A service like JSFiddle might be useful to you here.
Hi!
If I use the map and load my markers without
OverlappingMarkerSpiderfier
the order of inserted markers is preserved. WithOverlappingMarkerSpiderfier
theaddMarker
seams to shuffle the order.Why? How can I solve this problem?