2016-04-23 16 views
7

我在我的角度應用程序中使用ng-map。在我的地圖中,我正在使用路線,但我不需要A和B點。請幫我隱藏這些標記。 我得到了一個solution 但它沒有幫助ng地圖。 這是我如何平息它。如何刪除ngMap上的默認A B標記

<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。如果您在<directions>添加

suppress-markers="true"如下 幫助

+0

前右只需要刪除A B標記? –

回答

6

標記圖標將不會出現。

<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> 

OR

options.suppressMarkers = true;你需要的路徑只是var renderer = new google.maps.DirectionsRenderer(options);ng-map.js