请找到我用于在div内开发谷歌地图的代码片段。谷歌地图在5秒后消失
<?xml version='1.0' encoding='UTF-8'?>
<html>
<body onload="initialize()"><script src="http://www.google.com/jsapi? key=ABCDEFG" type="text/javascript"></script>
<script>
google.load("maps", "2.x");
// Call this function when the page has been loaded
function initialize() {
var map = new google.maps.Map2(document.getElementById("map"));
map.setCenter(new google.maps.LatLng(16.9800, 81.7800), 13);
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
}
google.setOnLoadCallback(initialize);
</script>
<form id="f1">
<div id="map" style="width: 400px; height: 400px"></div>
</form>
</body>
</html>
请检查此问题http://stackoverflow.com/questions/8179788/google-maps-onclick-infowindow-disappear-after-refresh-cycle –