我在我的 Angular 应用程序中使用了 ng-map。在我的 map 中,我使用了方向,但我不需要 A 和 B 点。请帮我隐藏这些标记。
我有一个 solution
但这对 ng-map 没有帮助。
这就是我如何应用它。
<ng-map zoom="14"
center="1135 Karamea-Kohaihai Rd, Kahurangi National Park, Tasman"
style="height:90%" >
<directions
draggable="true"
panel="p2"
travel-mode="DRIVING"
origin="1135 Karamea-Kohaihai Rd, Kahurangi National Park, Tasman"
destination="Pier St, Jackson Bay, West Coast, New Zeland" suppressMarkers='true'>
</directions>
<custom-marker id="start"
position="1135 Karamea-Kohaihai Rd, Kahurangi National Park, Tasman">
<div> Start point </div>
</custom-marker>
<custom-marker id="end"
position="Pier St, Jackson Bay, West Coast, New Zeland">
<div> Ends point </div>
</custom-marker>
</ng-map>
或者我没有正确使用它。
检查这个 plunker .
帮助
最佳答案
如果您添加,则不会显示标记图标suppress-markers="true"
在 <directions>
如下。
<ng-map zoom="14"
center="1135 Karamea-Kohaihai Rd, Kahurangi National Park, Tasman"
style="height:90%" >
<directions
draggable="true"
suppress-markers="true"
panel="p2"
travel-mode="DRIVING"
origin="1135 Karamea-Kohaihai Rd, Kahurangi National Park, Tasman"
destination="Pier St, Jackson Bay, West Coast, New Zeland" suppressMarkers='true'>
</directions>
<custom-marker id="start"
position="1135 Karamea-Kohaihai Rd, Kahurangi National Park, Tasman">
<div> Start point </div>
</custom-marker>
<custom-marker id="end"
position="Pier St, Jackson Bay, West Coast, New Zeland">
<div> Ends point </div>
</custom-marker>
</ng-map>
或
options.suppressMarkers = true;
就在之前 var renderer = new google.maps.DirectionsRenderer(options);
在 ng-map.js
关于angularjs - 如何删除 ngMap 上的默认 A B 标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36807409/