1. Please read the group's posting guidelines. (Post a link, not code) 2. That's version 1 syntax, which is history.
-- Marcelo - http://maps.forum.nu -- On Mar 12, 6:35 am, sindhu <[email protected]> wrote: > My markers are not displaying any info window. I am using > marker.openInfoWindowXslt() and I am using version1 of google > API.Below is the code.please have a look at it.It is the same code i > got from internet but i don't kno whow to display the info window. > > <!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> > <title>Irving City Parks</title> > <script src="http://maps.google.com/maps? > file=api&v=1&key=ABQIAAAAKgyIxIml6J4bHMQsN3VeYBTc0_2wBu1J- > OhXAOq2xNi8Q3N4gRRwel3MAhStYLJbeETuT3eTN0t7O" type="text/javascript"></ > script> > <script type="text/javascript"> > //<![CDATA[ > function load(){ > var map = new GMap(document.getElementById("map")); > var point = new GPoint(-96.926791,32.863917); > map.addControl(new GLargeMapControl()); > map.addControl(new GMapTypeControl()); > map.centerAndZoom(point, 5); > /*var baseIcon = new GIcon(); > baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png"; > baseIcon.iconSize = new GSize(20, 34); > baseIcon.shadowSize = new GSize(37, 34); > baseIcon.iconAnchor = new GPoint(9, 34); > baseIcon.infoWindowAnchor = new GPoint(9, 2); > baseIcon.infoShadowAnchor = new GPoint(18, 25);*/ > function createMarker(point,info) { > //var icon = new GIcon(baseIcon); > //icon.image = iconname.getAttribute("image"); > var marker = new GMarker(point); > > GEvent.addListener(marker, "click", function() { > marker.openInfoWindowXslt(info, "parks.xsl"); > }); > > return marker; > } > var request = GXmlHttp.create(); > request.open("GET", "parks.xml", true); > request.onreadystatechange = function() { > if (request.readyState == 4) { > var xmlDoc = request.responseXML; > > var points = xmlDoc.documentElement.getElementsByTagName("point"); > //var icons = xmlDoc.documentElement.getElementsByTagName("icon"); > var info = xmlDoc.documentElement.getElementsByTagName("info"); > > for (var i = 0; i < points.length; i++) { > var point = new GPoint(parseFloat(points[i].getAttribute > ("lng")), > parseFloat(points[i].getAttribute > ("lat"))); > > var marker = createMarker(point,info[i]); > map.addOverlay(marker); > } > }} > > request.send(null); > > } > > //]]> > </script> > </head> > <body onload="load()"> > <div id="map" style="width: 800px; height:500px;"></div> > > </body> > > </html> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
