Hello, Could someone show me why googlemap only works with
<body onload="onLoad();"> and not with <? echo "<script language=javascript>onLoad()</script>"; ?> in the following php snippet: <script src="http://maps.google.com/maps? file=api&v=2&sensor=true_or_false&key=ABQIAAAAWFimhTFgokTV2g6pZ5d_6xQX5lU7ihMN9NePAHowMGN- uoFA7hQEBF7XYCKH8ivFK-unp5sZZyzFEg" type="text/javascript"></script> <script type="text/javascript"> function onLoad() { alert('here'); var map = new GMap(document.getElementById("map")); map.centerAndZoom(new GPoint(-77.2133240, 38.8292580), 2); var icon = new GIcon(); icon.image = "housemark.gif"; icon.shadow = "housemarkshadow.gif"; icon.iconSize = new GSize(20, 20); icon.shadowSize = new GSize(20, 20); var point = new GPoint(-77.2133240, 38.8292580); var marker = new GMarker(point); map.addOverlay(marker); map.addControl(new GSmallMapControl); map.addControl(new GMapTypeControl); } </script> <? echo "<script language=javascript>onLoad()</script>"; ?> <body onload="onLoad();"> <div id="map" style="width: 384px; height: 256px"></div> -- 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.
