Add custom marker icon images

This commit is contained in:
Emanuel Mutschlechner
2020-01-06 19:05:16 +01:00
parent 4c9f08f229
commit 0650921c2f
18 changed files with 3676 additions and 2916 deletions

View File

@@ -1,4 +1,5 @@
import {fadeElementIn, isDefined, logError, openUrl} from '../utils/helper';
import {createMarker} from '../utils/leaflet';
// TODO maybe add this https://github.com/elmarquis/Leaflet.GestureHandling/
@@ -34,22 +35,5 @@ export default {
return map;
},
createMarker(map, markerData) {
const {title, lat, lng, url} = markerData;
const marker = window.L.marker([lat, lng], {
title,
keyboard: false,
draggable: false,
});
if (url) {
marker.on('click', event => {
event.originalEvent.preventDefault();
openUrl(url);
});
}
marker.addTo(map);
},
createMarker,
}