嗨,日安,我试着计算我生成的标记,但什么也没有发生。
我使用的是:
<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>
有人知道如何使用angular 2+地图做到这一点吗?
提前谢谢。
致以问候。
发布于 2017-07-20 10:49:14
我用这样的方式解决了这个问题:
<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';
问候
https://stackoverflow.com/questions/44874217
复制相似问题