2017-07-02 3 views
0

こんにちは、私は生成するマーカーを数値化しようとするが、何も起こらない。角2の数値マーカー+

<sebm-google-map [latitude]="-34.599427" [longitude]="-58.381031" [zoom]="12"> 
 
     <div *ngFor="let location of selectedLocations; let i = index"> 
 
      <sebm-google-map-marker [label]="i" [latitude]="location.map.latitude" [longitude]="location.map.longitude"> 
 
       <sebm-google-map-info-window> 
 
        <strong>{{location.name}}</strong> 
 
        <p>{{location.map.address}}</p> 
 
       </sebm-google-map-info-window> 
 
      </sebm-google-map-marker> 
 
     </div> 
 
    </sebm-google-map>

誰かが角2+地図でそれを行う方法を知っている:

は、私がこれを使用しますか?

ありがとうございます。

よろしくお願いいたします。

答えて

0

まあ、私はこの方法でこれを解決:

<agm-map [latitude]="touristZone.map.latitude" [longitude]="touristZone.map.longitude" [zoom]="12"> 
 
      <div *ngFor="let location of selectedTouristZones; let j = index"> 
 
       <agm-marker [iconUrl]="icono + j + ext" [latitude]="location.map.latitude" [longitude]="location.map.longitude"> 
 
       <agm-info-window> 
 
        <strong>{{location.name}}</strong> 
 
        <p>{{location.map.address}}</p> 
 
       </agm-info-window> 
 
       </agm-marker> 
 
      </div> 
 
      </agm-map>

私はこの中の数字でピンIMGを作成します。 TSに

これは可変である:

icono = 'app/assets/images/map/markers/pin'; 
 
    ext = '.png';

よろしく