加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

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

发布时间:2020-12-17 08:33:01 所属栏目:安全 来源:网络整理
导读:我在角度应用程序中使用ng-map.在我的地图我使用方向,但我不需要A和B点.请帮我隐藏这些标记. 我有一个 solution 但它没有帮助ng-map. 那是我怎么说的. ng-map zoom="14" center="1135 Karamea-Kohaihai Rd,Kahurangi National Park,Tasman" style="height:90
我在角度应用程序中使用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中

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读