Specify the z-index of Google Map Markers

eageseDrubsew

New Member
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 on top of all other elements in the map.How do I do this?Code:\[code\]circleIcon = { path: google.maps.SymbolPath.CIRCLE, fillColor: "blue", fillOpacity: 1, scale: 2, strokeColor: "red", strokeWeight: 10};coordinates = image[2].split(',');pin=new google.maps.LatLng(coordinates[0], coordinates[1]);if(marker) { marker.setMap(null);}if(image[0] != "NOP") { var markerIcon = circleIcon;} else { var markerIcon = image_car_icon;}marker=new google.maps.Marker({ position:pin, icon:markerIcon});marker.setMap(map);map.setCenter(marker.getPosition());\[/code\]
 
Back
Top