首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Angular 2+中的数字标记

Angular 2+中的数字标记
EN

Stack Overflow用户
提问于 2017-07-03 02:58:53
回答 1查看 506关注 0票数 0

嗨,日安,我试着计算我生成的标记,但什么也没有发生。

我使用的是:

代码语言:javascript
复制
<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+地图做到这一点吗?

提前谢谢。

致以问候。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-07-20 10:49:14

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

代码语言:javascript
复制
<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中,这是变量:

代码语言:javascript
复制
  icono = 'app/assets/images/map/markers/pin';
  ext = '.png';

问候

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44874217

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档