fixed marker icon bug

This commit is contained in:
Zakary Timson 2019-09-08 20:01:44 -04:00
parent 8d2fbedcbe
commit 57ee23da66

View File

@ -128,7 +128,7 @@ export class MapService {
} }
newMarker(m: Marker) { newMarker(m: Marker) {
let icon = m.icon ? m.icon : buildMarker(m.color); let icon = m.icon ? this.getIcon(m.icon) : buildMarker(m.color);
let marker = L.marker(m.latlng, Object.assign({autoPan: false}, m, {icon: icon})).addTo(this.map); let marker = L.marker(m.latlng, Object.assign({autoPan: false}, m, {icon: icon})).addTo(this.map);
if(m.label) marker.bindTooltip(m.label, {permanent: true, direction: 'bottom'}); if(m.label) marker.bindTooltip(m.label, {permanent: true, direction: 'bottom'});
marker.on('click', e => this.click.next({latlng: {lat: e.latlng.lat, lng: e.latlng.lng}, symbol: m, item: marker})); marker.on('click', e => this.click.next({latlng: {lat: e.latlng.lat, lng: e.latlng.lng}, symbol: m, item: marker}));