I am having a Google Map with lots of markers added using websockets. I am using custom marker images based on data availability. I want to make sure the newest marker stays
By default map will make z-index higher for markers lower on the map so they visibly stack top to bottom
You can set zIndex
option for a marker. You would just need to create a increment zIndex counter as you add markers and add that to the marker options object:
marker=new google.maps.Marker({
position:pin,
icon:markerIcon,
zIndex: counterValue
});
I'm not quite sure what the base start value needs to be