Greetings All, I am trying to create javascript (programatically) to create a google map that has multiple different colored markers where each marker has its own info window.
I think my code sample is V2. I am not sure if I can mix and match V2 and V3. I am a bit confused as to how to achieve this. Thanks in advance for your help. A sample map that does NOT render correctly is below. But hopefully you be able to tell what I am trying to accomplish from the javascript. Currently, the map does not render at all. Thanks!!!! Paul <!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>Map</title> <script src="http://maps.google.com/maps? file=api&v=2&key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1- m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ function load() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map")); map.addControl(new GLargeMapControl()); map.setCenter(new GLatLng(40.68987, -74.17821), 12); function createMarkerWithInfoWindow(point, info) { var greenIcon = new GIcon(G_DEFAULT_ICON); greenIcon.image = "http://map1/GoogleMapsIcons/mm_20_green.png"; markerOptionsGreen = { icon:greenIcon }; var blueIcon = new GIcon(G_DEFAULT_ICON); blueIcon.image = "http://map1/GoogleMapsIcons/mm_20_blue.png"; markerOptionsBlue = { icon:blueIcon }; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(info);}); return marker;} map.addOverlay(createMarkerWithInfoWindow(var point = new GLatLng(40.69476699829102, -74.17864227294922), "PU Date/Time: 02/16/12 14:46 Car: 287 Confo: 641211 Status: ONSCENE PU: EWR DO: 23 MAIN ST, West Milford, NJ")); var marker = new GMarker(point, markerOptionsGreen); map.addOverlay(marker); map.addOverlay(createMarkerWithInfoWindow(var point = new GLatLng(40.69508361816406, -74.17888641357422), "PU Date/Time: 02/16/12 16:45 Car: 297 Confo: 654967 Status: DISPATCHED PU: 20 MAIN ST, MANHATTAN, NY DO: EWR")); var marker = new GMarker(point, markerOptionsBlue); map.addOverlay(marker); }} //]]> </script> </head> <body onload="load()" onunload="GUnload()" style="margin:0; padding:0; border:none;"> <div id="map" style="width: 1386px; height: 901px"></div> </body> </html> -- You received this message because you are subscribed to the Google Groups "Google Maps API V2" 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.
