如何在Google Map Directions Service上显示结束(B)标记

时间:2013-10-16 02:41:01

标签: google-maps google-maps-api-3 google-maps-markers

我有一张带有硬编码终点(目的地)的地图,如下所示

var end = "Coquitlam";

我也从用户文本输入中获取开始值:

var start = document.getElementById('start').value;

使用Google Map Api文档example我能够正确获取方向,但我需要从叠加层中删除 MARKER B 图标,因为我已经在那里放置了自己的自定义标记! 你能告诉我怎么做吗?

2 个答案:

答案 0 :(得分:0)

your_renderer = new google.maps.DirectionsRenderer({preserveViewport:0,d​​raggable:1,suppressMarkers:1});

行? 但是,你自己把标记-A放了。

答案 1 :(得分:0)

该示例编码为:

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