I've searched the Internet for a solution to this problem. I'm using php to extrapolate co-ordinates and data from a mydqldatabase. These details are then used to populate javascript arrays for plotting on the map. The javascript arrays are populated fine. However, only the first set of data in the array is plotted. I get the above error in IE8 and a slightly different one in FF.
The map is at http://www.turbowebdesign.net/clients/bighouse/previewproperty2.php?propertyid=39 My code: <script type="text/javascript"> //<![CDATA[ // Google Map Maker script v.1.1 var map; var icon0; var icon1; var newpoints = new Array(); function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function'){ window.onload = func } else { window.onload = function() { oldonload(); func(); } } } addLoadEvent(loadMap); addLoadEvent(addPoints); function loadMap() { map = new GMap2(document.getElementById("map"),{ size: new GSize(700,400) } ); map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); map.setCenter(new GLatLng( 53.18895, -2.55132), 15); map.setMapType(G_NORMAL_MAP); map.enableScrollWheelZoom(); icon0 = new GIcon(); icon1 = new GIcon(); icon0.image = "images/home.png"; //icon1.image = "images/school.png"; icon1.image = "http://www.google.com/mapfiles/marker.png"; //icon0.shadow = "http://www.google.com/mapfiles/shadow50.png"; //icon0.iconSize = new GSize(20, 34); icon0.iconSize = new GSize(32, 37); icon0.shadowSize = new GSize(37, 34); icon0.iconAnchor = new GPoint(9, 34); icon0.infoWindowAnchor = new GPoint(9, 2); icon0.infoShadowAnchor = new GPoint(18, 25); } function addPoints() { newpoints[0] = new Array(53.18895, -2.55132, icon0, 'test', '102 Manor Square<br/>Winsford<br/>Cheshire'); newpoints[1] = new Array(53.189529, -2.54941, icon1, 'Property No. ','<p>Sir John Casss Foundation Primary School</p>'); newpoints[2] = new Array(53.187649, -2.5491, icon1, 'Property No. ','<p>Thomas Coram Early Childhood Centre</p>'); for(var i = 0; i < newpoints.length; i++) { var point = new GPoint(newpoints[i][1],newpoints[i][0]); var popuphtml = newpoints[i][4] ; var marker = createMarker(point,newpoints[i][2],popuphtml); map.addOverlay(marker); } } function createMarker(point, icon, popuphtml) { var popuphtml = "<div id=\"popup\">" + popuphtml + "<\/div>"; var marker = new GMarker(point, icon); GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(popuphtml); }); 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.
