7

我在我的角度应用程序中使用 ng-map。在我的地图中,我正在使用方向,但我不需要 A 点和 B 点。请帮我隐藏这些标记。我有一个解决方案 ,但它对 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。帮助

4

1 回答 1

6

如果您添加,标记图标将不会显示

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

于 2016-04-23T07:49:02.987 回答