parent
aad968a174
commit
7587c3d3b7
2 changed files with 41 additions and 3 deletions
|
|
@ -153,5 +153,25 @@ function build_map(map_id, coordinates, routes) {
|
|||
}
|
||||
});
|
||||
|
||||
var mapElement = document.getElementById(map_id);
|
||||
|
||||
document.getElementById('toggleMapSize').addEventListener('click', function() {
|
||||
var mapElement = document.getElementById(map_id);
|
||||
var isFullWindow = mapElement.classList.contains('full-window-map');
|
||||
|
||||
if (isFullWindow) {
|
||||
mapElement.classList.remove('full-window-map');
|
||||
mapElement.classList.add('half-map');
|
||||
mapElement.style.position = 'relative';
|
||||
} else {
|
||||
mapElement.classList.add('full-window-map');
|
||||
mapElement.classList.remove('half-map');
|
||||
mapElement.style.position = '';
|
||||
}
|
||||
|
||||
// Ensure the map adjusts to the new container size
|
||||
map.invalidateSize();
|
||||
});
|
||||
|
||||
return map;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue