javascript - Why is zIndex in RichMarker library for google maps not working? -
i have follow documentation creating custom markers in google maps (link) , create code (documentation of richmarker (link)):
var locations = [ ['loca', 45.65, 15.2, 4], ['locb', 45.57, 13.87, 2], ['locc', 46.05, 14.68, 1], ['locd', 46.43, 15.75, 5], ['loce', 46.4, 13.85, 3] ]; setmarkers(map, locations); function setmarkers(map, location){ for(var = 0; < location.length; i++){ var loc = location[i]; var coordinate = new google.maps.latlng(loc[1], loc[2]); var marker = new richmarker({ position: coordinate, map: map, zindex: loc[3], content:'<div class="myclass">'...+'</div>' }); } }
as understand in zindex: loc[3] means take forth element in array "locations" number in array (1,2,3,4,5): example first (0 row) loca name, 45.65 latitude, 15.2 longitude, 4 number of zindex.
but zindex in case not working. can see "locc" should in top of markers, should followed "locb", "loce", "loca" , "locd". but instead order created is: on top is: loca, locb, locc, locd, loce, order order array, if put e.g. locc after loca in "locations" array, "locc" on top. why zindex in case not working - positions of markers depending on positions in array?
tnx sugestions.
if @ the code richmarker see there no zindex option (unlike way native google maps markers work). can use method setzindex set zindex markers.
Comments
Post a Comment