Angular 2+中的数字标记

时间:2017-07-02 18:58:53

标签: angularjs google-maps marker

大家好的一天,我尝试计算我生成的标记但没有发生任何事情。

我用这个:

<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+地图怎么做?

提前感谢。

问候。

1 个答案:

答案 0 :(得分:0)

我用这种方式解决了这个问题:

&#13;
&#13;
<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>
&#13;
&#13;
&#13;

我创建了一个带有数字的图钉img。

在ts中,这是变量:

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

此致