微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

我在角度应用程序中使用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,Tasman"
      destination="Pier St,Jackson Bay,West Coast,New Zeland" suppressMarkers='true'>
    </directions>
    <custom-marker id="start"
      position="1135 Karamea-Kohaihai Rd,Tasman">
      <div> Start point </div>
    </custom-marker>
    <custom-marker id="end"
      position="Pier St,New Zeland">
      <div> Ends point </div>
    </custom-marker>
  </ng-map>

或者我可能没有正确使用它.
检查这个plunker.
救命

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

< direction>中的suppress-markers =“true”如下.

<ng-map zoom="14"
        center="1135 Karamea-Kohaihai Rd,Tasman"
        style="height:90%" >
        <directions
          draggable="true"
          suppress-markers="true"
          panel="p2"
          travel-mode="DRIVING"
          origin="1135 Karamea-Kohaihai Rd,Tasman"
          destination="Pier St,New Zeland" suppressMarkers='true'>
        </directions>
        <custom-marker id="start"
          position="1135 Karamea-Kohaihai Rd,Tasman">
          <div> Start point </div>
        </custom-marker>
        <custom-marker id="end"
          position="Pier St,New Zeland">
          <div> Ends point </div>
        </custom-marker>
      </ng-map>

要么

options.suppressMarkers = true;就在var renderer = new google.maps.DirectionsRenderer(options)之前;在ng-map.js中

原文地址:https://www.jb51.cc/angularjs/141330.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐