|
@ -51,16 +51,15 @@ function handleEvent(event) { |
|
|
|
|
|
|
|
|
async function insertMarker(mapRef, ID, cords, icon) { |
|
|
async function insertMarker(mapRef, ID, cords, icon) { |
|
|
var iconSvg = icon; |
|
|
var iconSvg = icon; |
|
|
|
|
|
|
|
|
if (typeof icon !== 'string' && !(icon instanceof String)) { |
|
|
if (typeof icon !== 'string' && !(icon instanceof String)) { |
|
|
iconSvg = await loadLocalAsset(icon); |
|
|
iconSvg = await loadLocalAsset(icon); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
console.log(String(iconSvg)); |
|
|
|
|
|
|
|
|
|
|
|
mapRef.injectJavaScript(`
|
|
|
mapRef.injectJavaScript(`
|
|
|
var customIcon = L.divIcon({ |
|
|
var customIcon = L.divIcon({ |
|
|
className: 'marker-class', |
|
|
className: 'marker-class', |
|
|
html: ${iconSvg} , |
|
|
|
|
|
|
|
|
html: \`${iconSvg}\`,
|
|
|
iconSize: 100 |
|
|
iconSize: 100 |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
@ -71,8 +70,7 @@ async function insertMarker(mapRef, ID, cords, icon) { |
|
|
|
|
|
|
|
|
// Add marker to map and bing callback event to its function
|
|
|
// Add marker to map and bing callback event to its function
|
|
|
markers[${ID}].addTo(map).on('click', onPopupClick); |
|
|
markers[${ID}].addTo(map).on('click', onPopupClick); |
|
|
} |
|
|
|
|
|
`);
|
|
|
|
|
|
|
|
|
}`);
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
export { loadHTMLFile, handleEvent, insertMarker, goToRegion }; |
|
|
export { loadHTMLFile, handleEvent, insertMarker, goToRegion }; |