我知道如何更改标准谷歌地图 api v3 上的图标。有没有办法改变地图上的图标和方向?
<script type="text/javascript">
var directionDisplay;
var directionsService = new google.maps.DirectionsService();
var map;
function initialize(){
directionsDisplay = new google.maps.DirectionsRenderer();
var mapOptions={
center: new google.maps.LatLng(-34.397, 150.644),
zoom: 11,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"),mapOptions);
directionsDisplay.setMap(map);
directionsDisplay.setPanel(document.getElementById("directionsPanel")
);
var marker = new google.maps.Marker({
position: map.getCenter(),
map: map,
icon: 'marker/image.png',
title: 'Click to zoom'
});
google.maps.event.addListener(marker, 'click', function(){
map.setZoom(15);
map.setCenter(marker.getPosition());
});
google.maps.event.addDomListener(window, 'load', initialize);
}
function calcRoute() {
var start = document.getElementById("start").value;
var end = '-34.397, 150.644';
var request = {
origin:start,
destination:end,
travelMode: google.maps.DirectionsTravelMode.DRIVING
};
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(response);
}
});
}
</script>
上面的代码显示带有我的自定义图标标记的地图,但是当我生成方向而不是在我的自定义标记顶部时,我看到另一个带有字母 B 的标准绿色制造商。
如何覆盖它?