Hi, I'm new in coding world. I may be diong a silly mistake. I developed an API which geocodes UK postcode and displays in UK marker with an info window whn the mouse hovers over the marker. It works fine in IE but gives an error 'map is undefined' in firefox for the first time. However when I refresh the firefox page I could see the markers showing. Heres my test link http://doteditor.wateraid.org/temp/temp786.asp?. Below is the code. I'm very close but confused which part is wrong. Can you help looking below code what has gone wrong with firefox being nasty giving errors?
<!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>Google Maps JavaScript API Example</title> <script src="http://maps.google.com/maps? file=api&v=2.x&key=ABQIAAAASkdTx- xrMIvAXHXAtEM9qRSXMGIOLlzvaf_QcvWUg2yOnfxd2xTJk90A_X6gK8M0z0puIJwGyF4uTg" type="text/javascript"></script> <script type="text/javascript"> </script> <script src="http://www.google.com/uds/api? file=uds.js&v=1.0&key=ABQIAAAASkdTx- xrMIvAXHXAtEM9qRSXMGIOLlzvaf_QcvWUg2yOnfxd2xTJk90A_X6gK8M0z0puIJwGyF4uTg" type="text/javascript"></script> <script type="text/javascript"> var geocoder = new GClientGeocoder(); var map; var icon = new GIcon(G_DEFAULT_ICON); icon.image = "http://www.google.com/mapfiles/marker.png"; icon.shadow = "http://www.google.com/mapfiles/shadow50.png"; icon.iconSize = new GSize(20, 34); icon.shadowSize = new GSize(37, 34); icon.iconAnchor = new GPoint(10, 34); function mapLoad() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("map_canvas")); map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); map.setCenter(new GLatLng(54.622978,-2.592773), 5, G_HYBRID_MAP); } } function usePointFromPostcode(postcode,text) { geocoder.getLatLng(postcode, function(point) { if (!point) { //alert('address not found'); } else { var marker = new GMarker(point,{icon: icon}); GEvent.addListener(marker,'mouseover', function() { marker.openInfoWindowHtml(text); }); map.addOverlay(marker); } }); } </script> </head> <% For i = 0 To Ubound(myarray,2) %> <script type="text/javascript"> var postval = "<%=myarray(PostCode,i)%>"; var last_index = postval.indexOf(' '); var splitpost = postval.substring(0,last_index); document.write(splitpost); var amount = "<%=myarray(3,i)%>"; document.write(amount); var html = 'Thank you for donating '+ amount; usePointFromPostcode(splitpost,html); </script> <% Next %> <body onload = "mapLoad();" onunload = "GUnload();" > <div id="map_canvas" style="width: 400px; height: 600px" > </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 -~----------~----~----~----~------~----~------~--~---
