diff --git a/public/script/leaflet-fullscreen.js b/public/script/leaflet-fullscreen.js index 77fb0ee..86e1762 100644 --- a/public/script/leaflet-fullscreen.js +++ b/public/script/leaflet-fullscreen.js @@ -58,6 +58,13 @@ function createFullscreenControl(options = {}, getFullscreen, setFullscreen) { toggleFullscreen(map, mergedOptions, getFullscreen, setFullscreen) }) + function updateTitle() { + Object.assign(link, { title: mergedOptions.title[getFullscreen()] }) + } + + updateTitle() + map.on('fullscreenchange', updateTitle) + return container }