Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google maps 如何设置自定义标记颜色?_Google Maps - Fatal编程技术网

Google maps 如何设置自定义标记颜色?

Google maps 如何设置自定义标记颜色?,google-maps,Google Maps,我正在使用GoogleMapsAPI(v3)构建一条路径,其中包含一个DirectionsRenderer和一组航路点 var directionsDisplay = new google.maps.DirectionsRenderer({ markerOptions: { flat: false, clickable: false }, polylineOptions: {

我正在使用GoogleMapsAPI(v3)构建一条路径,其中包含一个DirectionsRenderer和一组航路点

       var directionsDisplay = new google.maps.DirectionsRenderer({
         markerOptions: {
           flat: false,
           clickable: false
         },
         polylineOptions: {
           strokeColor: "#1d6db1",
           strokeOpacity: 0.8
         }
       });
我想将标记的默认颜色从绿色更改为#1d6db1,就像我对多段线所做的那样。问题是这个类没有这样的选项。我找到了一个,但同时我想保留标记的A、B、C等标签,这在那里是不可能的。

使用生成标记。 不幸的是,无法使用
方向渲染器
和自定义字母(或编号)标记。您需要复制
directionsrender
的功能