Ok I tried to include your code but something goes wrong.... In reality I do not need a sidebar and do not need the mouseover yellow color, I only need the "go behing" function. Can you correct my code? thank you.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>example</title> <script src="http://maps.google.com/maps?file=api&v=2 &key=ABQIAAAArSysGIurcK7dOMZla-7TExQSXE4ITa1YzwIbIoQt- CisjCLm8xS2jytkVj9gPuB1NWF-zZMCsCPqMA" type="text/javascript"> </script> <script type="text/javascript"> var markerImage = [ G_DEFAULT_ICON.image, "http://maps.google.com/mapfiles/dd-start.png", "http://maps.google.com/mapfiles/dd-end.png", "http://esa.ilmari.googlepages.com/markeryellow.png",//3 yellow "http://www.google.com/uds/samples/places/temp_marker.png"//4 turquoise ]; function initialize() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map_canvas")); map.setUIToDefault(); map.addControl(new GMapTypeControl()); map.setCenter(new GLatLng(43.6, 10.9), 10); GDownloadUrl("pts.xml", function(data, responseCode) { var xml = GXml.parse(data); var markers = xml.documentElement.getElementsByTagName("marker"); for (var i = 0; i < markers.length; i++) { var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("long"))); var data = markers[i].getAttribute("data"); var indirizzo = markers[i].getAttribute("indirizzo"); var marker = createMarker(point, data, indirizzo); //map.addOverlay(marker); } }); } } // Originally created by Esa 2007 var n=1; function count(){ n++; return n; } function ZMarker(point,label,n,imInd,i,visited) { function sendBack(marker,b) { return GOverlay.getZIndex(marker.getPoint().lat())-n*10000; } marker[i] = new GMarker(point,{title:label, zIndexProcess:sendBack}); map.addOverlay(marker[i]); marker[i].setImage(markerImage[imInd]); marker[i].visited = visited; GEvent.addListener(marker[i], "click", function() { marker[i].openInfoWindowHtml(label); marker[i].visited = true; GEvent.trigger(marker[i],"mouseout"); }); GEvent.addListener(marker[i],'mouseover',function(){ marker[i].setImage(markerImage[3]); document.getElementById("sidebar").getElementsByTagName("span") [i].style.background ="yellow"; }); GEvent.addListener(marker[i],'mouseout',function(){ if(marker[i].visited){ marker[i].setImage(markerImage[4]); document.getElementById("sidebar").getElementsByTagName("span") [i].style.color ="gray"; }else{ marker[i].setImage(markerImage[0]); document.getElementById("sidebar").getElementsByTagName("span") [i].style.color ="black"; } document.getElementById("sidebar").getElementsByTagName("span") [i].style.background ="white"; }); GEvent.addListener(marker[i], "infowindowclose", function() { map.removeOverlay(marker[i]); ZMarker(point,label,count(), 4,i,marker[i].visited); })} </script> </head> <body onload="initialize()" onunload="GUnload()"> <div id="map_canvas" style="width: 800px; height: 600px"></div> </body> </html> On 6 Lug, 20:53, Esa <[email protected]> wrote: > I guess you meanhttp://esa.ilmari.googlepages.com/ZMarker2.htm > > Instead of using your createMarker() function, you should copy the > ZMarker() function of the example. Also you should delete addOverlay() > because ZMarker() is performing that. > > If you want marker color switching, you should have a markerImage > array of marker image sources. > > Try to find out the parameters of ZMarker() function from the example. > If trouble, you can mail me a link to your page. > > Esa --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
