0
我遇到以下代碼的問題。
正如你所看到的,它在水上畫了一個「T」,這很好,正是我在這個例子中想要的。
現在的問題是我想設置錨點。
如果您在標記中的錨線發表評論,您會看到T完全搞砸了。而不是僅僅移動一點點,這樣T的腳就是錨。
這是一個錯誤,那麼我希望它得到修復。
是否有一種解決方法,除了重新計算所有路徑座標之外,如何才能正確工作?在標記中使用SVG錨定圖像
<!DOCTYPE html>
<html>
<head>
<link href="https://google-developers.appspot.com/maps/documentation/javascript/examples/default.css" rel="stylesheet">
<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script>
function initialize() {
var mapOptions = {
zoom: 8,
center: new google.maps.LatLng(40, -150),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);
new google.maps.Marker({
icon: {
//anchor: new google.maps.Point(8.1328125, 17),
path: 'm 7.1855469,17 0,-12.6269531 -4.7167969,0 0,-1.6894531 11.347656,0 0,1.6894531 -4.7363279,0 0,12.6269531 z'
},
position: new google.maps.LatLng(40, -150),
map: map
});
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas"></div>
</body>
</html>