【问题标题】:How to remove default A B markers on ngMap如何删除 ngMap 上的默认 A B 标记
【发布时间】:2016-04-23 06:19:19
【问题描述】:

我在我的 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。 帮助

【问题讨论】:

  • 你需要正确的路径只需要删除 A B 标记?

标签: angularjs google-maps ng-map


【解决方案1】:

添加后标记图标不会显示

suppress-markers="true" 中的&lt;directions&gt; 如下。

<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

【讨论】:

    猜你喜欢
    • 2011-03-16
    • 2021-07-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-27
    • 1970-01-01
    • 2013-06-02
    相关资源
    最近更新 更多