0
正如你可以在我的test.php看到的標記是工作正常。 但是當我縮放地圖以獲得更好的概覽時,標記將向北? 如果我放大了不少,標誌移動到北海:-( 這是一個已知的bug?還是我做錯了什麼?谷歌地圖標記問題
<!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>
很快回答。非常感謝你 我不是真的需要一個自己的形象爲我的標記,但我不知道如何使用谷歌地圖標誌爲我的標記:-( – Hape42 2012-08-15 14:07:58
我以前見過很多次,我不知道如果你不需要自定義圖標,不要使用自定義圖標,那麼默認圖標就可以工作,如果你想使用圖標,你需要確定你想要的圖標旗杆工作人員的底部是正常位置),然後正確定義MarkerImage對象。 – geocodezip 2012-08-15 14:17:02
謝謝,有時很簡單。「如果您不需要自定義圖標,請不要使用其中一個,默認圖標將爲你工作。「現在它工作正常:-) – Hape42 2012-08-15 15:23:41