Clean tooltip string + some docs stuff...

This commit is contained in:
Nicolò P. 2024-06-14 08:12:40 +02:00
parent 038dcc0b7a
commit c04a015c4a
4 changed files with 12 additions and 5 deletions

View File

@ -109,7 +109,10 @@ GIS.initMap = async function (mapId, zoomLevel = this.INIT_ZOOM) {
if (!layer.id.includes('area')) {
const marker = L.marker(coords)
.addTo(map)
.bindTooltip(Object.keys(archeo).find(k => archeo[k] === layer))
.bindTooltip(
Object.keys(archeo).find(k => archeo[k] === layer)
.replace(/\s\(.*$/, '')
)
.openTooltip();
if (typeof data === 'object') {
@ -124,7 +127,6 @@ GIS.initMap = async function (mapId, zoomLevel = this.INIT_ZOOM) {
/**
* Adds layers to map and returns an object
* with {baseMap, archeoLayers, sitesLayerGroup}
*
* @param {L.Map} map
* @returns {{baseMap: {"OpenStreetMap": L.TileLayer}, archeo: object, sitesGroup: L.LayerGroup}}
*/

View File

@ -13,7 +13,7 @@
"recurse": true,
"verbose": true,
"theme_opts": {
"theme": "light"
"theme": "dark"
}
}
}

View File

@ -8,5 +8,6 @@
"bulma": "^1.0.1",
"fontawesome-free": "^1.0.4",
"leaflet": "^1.9.4"
}
},
"devDependencies": {}
}

View File

@ -40,6 +40,10 @@ UI.addCenterMapControl = function (map, centerCoords, zoom) {
let centerCtr = new L.Control.CenterControl();
map.addControl(centerCtr);
}
/**
* Toggle burger menu for small screens
* @param {string} burgerClass The CSS class of the burger element
*/
UI.toggleBurger = function(burgerClass) {
const burger = document.querySelector(`.${burgerClass}`);
burger.addEventListener('click', () => {
@ -49,7 +53,7 @@ UI.toggleBurger = function(burgerClass) {
});
}
/**
*
* Toggle side menu and rescale map container
* @param {string} triggerId The ID of the trigger element
*/
UI.toggleMenu = function (triggerId) {