正如您在我的test.php中看到的,标记工作正常。但是当我缩放地图以获得更好的概览时,标记会向北移动???如果我放大很多,标记移动到北海:-(这是一个已知的错误吗?还是我做错了什么?
<!DOCTYPE html>
<html>
<head>
<title>MyRange Driving Ranges world wide </title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=yes" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 30px; padding: 0px }
#map_canvas { height: 80% }
</style>
<script type="text/javascript"
src="https://maps.google.com/maps/api/js?sensor=true">
</script>
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatLng(51.1601369818597, 6.72036588191986);
var myOptions = {
zoom: 16,
center: latlng,
mapTypeId: google.maps.MapTypeId.HYBRID
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var image = 'images/flag_red_big.png';
var myLatLng = new google.maps.LatLng(51.1601369818597, 6.72036588191986);
var golfMarker = new google.maps.Marker({ position: myLatLng, map: map, icon: image });
}
</script>
</head>
<body onload="initialize()">
<div align="center" id="map_canvas" style="width:100%; height:100%"></div>
</body>
</html>