My requirement is to show the multiple leaflet maps(based on the backend data) on the page.
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>
I have placed the map id as But while executing showing the error as map container not found.
I am new to this leaflet map Can anyone help me regarding this.