Commit b0ba438b authored by Niels Holt's avatar Niels Holt

Left menu (leaflet-categorized-layers) and right menu...

Left menu (leaflet-categorized-layers) and right menu (fcoo-leaflet-control-legend): Header removed and hidden when minimized
parent 86ae6f3d
......@@ -208,7 +208,9 @@
/**
* Initialization after DOM is loaded
*/
function createCommonMap(store, basemap, maps, minZoom, maxZoom, maxBounds, zoom, lat, lon, enablePrint, useGeoMetoc, mapStore) {
function createCommonMap(store, basemap, maps, minZoom, maxZoom, maxBounds, zoom, lat, lon, enablePrint, useGeoMetoc, mapStore, mapOptions) {
//HER SKAL UDVIDES MED mapOptions
var urlParams,
mainMap;
......@@ -262,18 +264,24 @@
// Construct map
map = L.map(mapKey, {
center: new L.LatLng(lat, lon),
zoomControl: true,
zoom: zoom,
//fadeAnimation: false, // Disabled (Leaflet issue #3765)
//zoomAnimation: true,
minZoom: minZoom,
maxZoom: maxZoom,
//crs: L.CRS.EPSG4326,
crs: L.CRS.EPSG3857,
layers: [baseMaps[Object.keys(baseMaps)[0]][basemap]]
});
map = L.map(
mapKey,
$.extend(
{
center: new L.LatLng(lat, lon),
zoomControl: true,
zoom: zoom,
//fadeAnimation: false, // Disabled (Leaflet issue #3765)
//zoomAnimation: true,
minZoom: minZoom,
maxZoom: maxZoom,
//crs: L.CRS.EPSG4326,
crs: L.CRS.EPSG3857,
layers: [baseMaps[Object.keys(baseMaps)[0]][basemap]]
},
mapOptions || {}
)
);
// See https://github.com/Leaflet/Leaflet/issues/5179
......@@ -592,7 +600,9 @@
collapseActiveGroups: true,
autoZIndex : false,
position : "topleft",
height : 0.8
height : 0.8,
inclHeader : false,
containerClassName: 'leaflet-control-box-container hide-when-minimized'
};
layers.basemaps = {};
......
......@@ -444,7 +444,10 @@
// Init map
var mapStore = window.initCommonMap(store, maps, enablePrint),
mainMap = window.createCommonMap(store, basemap, maps, minZoom, maxZoom, maxBounds, zoom, lat, lon, enablePrint, useGeoMetoc, mapStore);
mainMap =
window.createCommonMap(store, basemap, maps, minZoom, maxZoom, maxBounds, zoom, lat, lon, enablePrint, useGeoMetoc, mapStore, {
legendControlOptions: {inclHeader: false, containerClassName: 'leaflet-control-box-container hide-when-minimized'} //Legend with no header and hidden when minimized
});
$(document).ready(function () {
var topMenu =
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment