Google maps 如何设置自定义标记颜色?
我正在使用GoogleMapsAPI(v3)构建一条路径,其中包含一个DirectionsRenderer和一组航路点Google maps 如何设置自定义标记颜色?,google-maps,Google Maps,我正在使用GoogleMapsAPI(v3)构建一条路径,其中包含一个DirectionsRenderer和一组航路点 var directionsDisplay = new google.maps.DirectionsRenderer({ markerOptions: { flat: false, clickable: false }, polylineOptions: {
var directionsDisplay = new google.maps.DirectionsRenderer({
markerOptions: {
flat: false,
clickable: false
},
polylineOptions: {
strokeColor: "#1d6db1",
strokeOpacity: 0.8
}
});
我想将标记的默认颜色从绿色更改为#1d6db1,就像我对多段线所做的那样。问题是这个类没有这样的选项。我找到了一个,但同时我想保留标记的A、B、C等标签,这在那里是不可能的。使用生成标记。
不幸的是,无法使用方向渲染器
和自定义字母(或编号)标记。您需要复制directionsrender
的功能