在以下行出现了错误:
if (GBrowserIsCompatible()) {
这是我的代码,但仍然无法工作。
<script src="http://maps.google.com/maps?file=api&v=2.x&key=<?php echo $google_api['VALUE'];?>" type="text/javascript"></script>
<script type="text/javascript">
var map = null;
var geocoder = null;
function initialize(address) {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
geocoder = new GClientGeocoder();
/* Start */
if (geocoder) {
geocoder.getLatLng(
address,
function (point) {
if (!point) {
alert(address + " not found");
} else {
map.setCenter(point, 13);
var marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindowHtml(address);
}
}
);
}
/* End */
}
}
</script>