[Google Maps API v2] my google map api v2 appear blank
below is my codes.can you tell me what is wrong? im trying to cal out
a langtitud and longitud to add markers on my map.but the map appear
blank. this is urgent.
<?php require_once('Connections/biota.php');?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<title>Maps Example</title>
<script src="http://maps.google.com/maps?
file=api&v=2&key=AIzaSyDhZNelqS_FjEBo2CI6QE5LjyZFlDy9dJ8&sensor=true"
type="text/javascript"></script>
<script type="text/javascript">
function createMarker(point,html) {
var marker = new GMarker(point);
GEvent.addListener(marker,"click",function());
return marker;
}
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"),
{ size: new GSize(580,400) } );
map.removeMapType(G_HYBRID_MAP);
map.setCenter(new GLatLng(-3.703250,40.416741,0), 1);
var mapControl = new GMapTypeControl();
map.addControl(mapControl);
map.addControl(new GLargeMapControl());
<?php
$exe="SELECT lat,lng FROM markers";
$result1=mysql_db_query($database_biota,$exe);
while(list($lat,$lng) = mysql_fetch_row($result1)){
echo "\n var point = new GLatLng(".$lat.",".$lng.");\n";
echo "var marker = createMarker(point,'');\n";
echo "map.addOverlay(marker);\n";
echo "\n";
}
?>
}
}
</script>
</head>
<body onload="initialize()" onunload="GUnload()">
<div id="map_canvas" style="width: 580px; height: 500px;></
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 google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home