有没有办法让 google.maps.SymbolPath.FORWARD_CLOSED_ARROW 将图标的中心放在 LatLng 位置。似乎是把箭头的尖端放在那里。
我尝试过使用锚点进行实验,但没有成功。
这是我的示例代码:
var marker=new google.maps.Marker({
position: new google.maps.LatLng(50.124462, -5.539994),
icon: {
path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW,
scale: 8,
strokeWeight: 2,
fillColor: '#009933',
fillOpacity: 1,
rotation: 210,
anchor: new google.maps.Point(0, 0)
},
});
marker.setMap(map);
Run Code Online (Sandbox Code Playgroud)