如何删除 ngMap 上的默认 A B 标记

How to remove default A B markers on ngMap

我在 angular 应用程序中使用 ng-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