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