我想显示文本标签以在传单地图上显示位置名称(不是工具提示文本或弹出文本)。
.component.ts
map[i] = L.map(v).setView([this.sensors[i].latitude,this.sensors[i].longitude], 11);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: ' <a href="https://www.openstreetmap.org/copyright">'+this.sensors[i].name+' </a>'
}).addTo(map[i]);
var latlng = L.latLng(this.sensors[i].latitude, this.sensors[i].longitude)
marker = L.marker(latlng, { icon: sensoricon }).addTo(map[i]);
不,我想从后端动态添加每个地图的位置名称(即 this.sensors[i].name)