Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.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 如何在谷歌地图方向服务上不显示结束(B)标记_Google Maps_Google Maps Api 3_Google Maps Markers - Fatal编程技术网

Google maps 如何在谷歌地图方向服务上不显示结束(B)标记

Google maps 如何在谷歌地图方向服务上不显示结束(B)标记,google-maps,google-maps-api-3,google-maps-markers,Google Maps,Google Maps Api 3,Google Maps Markers,我有一张地图,上面有这样一个硬编码的终点(目的地) var end = "Coquitlam"; 我还从用户文本输入中获取开始值,如下所示: var start = document.getElementById('start').value; 使用Google Map Api文档,我能够正确获得方向,但我需要从覆盖中删除标记B图标,因为我已经在那里放置了我自己的自定义标记! 你能告诉我怎么做吗?你的渲染器=新的google.maps.DirectionsRenderer

我有一张地图,上面有这样一个硬编码的终点(目的地)

var end = "Coquitlam";
我还从用户文本输入中获取开始值,如下所示:

var start = document.getElementById('start').value;
使用Google Map Api文档,我能够正确获得方向,但我需要从覆盖中删除标记B图标,因为我已经在那里放置了我自己的自定义标记!
你能告诉我怎么做吗?

你的渲染器=新的google.maps.DirectionsRenderer({preserveViewport:0,Dragable:1,suppressMarkers:1})

好吗?
但是,您应该自己放置marker-A。

示例编码为:

function initialize() {
directionsDisplay = new google.maps.DirectionsRenderer(); // this is your_renderer
var chicago = new google.maps.LatLng(41.850033, -87.6500523); // this is marker-A point

您好tcltk-d,谢谢您的评论,但老实说,我被您的提示弄糊涂了!你能告诉我你的“新”是什么意思吗?什么是Marker-A?StackOverflow的可能副本不是一个论坛。我认为你应该把两个答案合并成一个,然后删除另一个。