Hi,

I am a newbie to google mashups and looking at a few examples have
written a code to integrate googlemaps with my application, however
the code works only on Chrome and does not work on IE or Firefox.
below is the code, could any one please let me know what could be the
proble,m

-------------------------------------
<html>
<head>
<title>Maps testing</title>
</head>
<body onload="initialize()">
 <h3>My first mashup with Google :)</h3>
   <div id="map" style="width:800px;height:400px;"></div>
</body>
</html>

<script src="http://maps.google.com/maps?
file=api&amp;v=2&amp;sensor=false&amp;key= MY_API_KEY" type="text/
javascript"></script>
<script>

function initialize()
{

// Ajax call here to get the lattitude and longitude  to be displayed

//
 // Display the map, with some controls and set the initial location
     var map = new GMap2(document.getElementById("map"));
     map.addControl(new GLargeMapControl());
     map.addControl(new GMapTypeControl());
     map.setCenter(new GLatLng("40.907787","-90.359741"),4);

for (var i=0; i<lati.length;i++)
{
//    var com = comp[i];
   var point = new GLatLng(lati[i],longi[i]);
   var marker = createMarker(point,'<div style="width:240px">' +
'<div style="font-weight:bold">' + name[i] + '<\/div>' + '<br />' +
street[i] + ',' + city[i] + ',' + county[i] + ',' + zip[i] + ',' +
state[i] + '<\/div>');
//    var marker = createMarker(point,f1());
       map.addOverlay(marker);
}
}
// if (GBrowserIsCompatible()) {
      // A function to create the marker and set up the event window
     // Dont try to unroll this function. It has to be here for the
function closure
     // Each instance of the function preserves the contends of a
different instance
     // of the "marker" and "html" variables which will be needed
later when the event triggers.
     function createMarker(point,html) {
       var marker = new GMarker(point);
       GEvent.addListener(marker, "click", function() {
         marker.openInfoWindowHtml(html);
       });
       return marker;
     }
</script>

--

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.


Reply via email to