【发布时间】:2021-04-12 02:38:13
【问题描述】:
我的要求是在页面上显示多个传单地图(基于后端数据)。
map.component.ts
for (var i = 0; i < this.mapleaf.length; i++) {
map[i] = L.map(this.mapleaf[i]).setView([12.9249, 80.1000], 12);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map[i]);
}
map.component.html
<div class="col-xs-12 col-sm-8 col-lg-8" >
<span *ngFor="let leaflet of mapleaf">
<div id ="{{mapleaf}}"></div>
</span>
</div>
我已将地图 ID 设置为 但是在执行时将错误显示为未找到地图容器。
我是这个传单地图的新手,谁能帮我解决这个问题。
【问题讨论】:
标签: javascript leaflet openstreetmap angular-leaflet-directive leaflet.markercluster