function setMarkerBack(i) {
var currentZ = markers[i].get('zIndex');
markers[i].set('zIndex', currentZ-100000);
}
var markers = [];
// scoping for jquery
$(document).ready(function () {
"use strict";
// variable to hold a map
var map;
// variable to hold current active InfoWindow
var activeInfoWindow;
// ------------------------------------------------------------------------------- //
// initialize function
// ------------------------------------------------------------------------------- //
function initialize() {
// ------------------------------------------------------------------------------- //
// LISTENER ON CLICK EVENT
// ------------------------------------------------------------------------------- //
$("a").on("click", function () {
alert("got here!");
// do something to change z-index of this marker
//...
// my_index = my_index-1;
//...
return false;
});
// map options - lots of options available here
var mapOptions = {
zoom: 5,
draggable: true,
center: new google.maps.LatLng(44.960, -93.100),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
// create map in div called map-canvas using map options defined above
map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
// define two Google Map LatLng objects representing geographic points
var stPaul = new google.maps.LatLng(44.95283, -93.08925);
var minneapolis = new google.maps.LatLng(44.97984, -93.26620);
// place two markers
fnPlaceMarkers(stPaul, "St Paul");
fnPlaceMarkers(minneapolis, "Minneapolis");
}
// ------------------------------------------------------------------------------- //
// create markers on the map
//...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.