- use fitBounds(Map_Default_Bounds) if this config value exists
- center and zoom is not always provided from data
- getting a bounding box might be easier in some use cases
Map_Default_Lat: 20.0,
Map_Default_Lon: 0.0,
Map_Default_Zoom: 2,
Map_Default_Lat: 20.0,
Map_Default_Lon: 0.0,
Map_Default_Zoom: 2,
+ Map_Default_Bounds: null,
// For what {x}, {y} etc stand for see
// https://leafletjs.com/reference-1.9.1.html#tilelayer
// For what {x}, {y} etc stand for see
// https://leafletjs.com/reference-1.9.1.html#tilelayer
],
zoom: Nominatim_Config.Map_Default_Zoom
});
],
zoom: Nominatim_Config.Map_Default_Zoom
});
+ if (typeof Nominatim_Config.Map_Default_Bounds !== 'undefined' && Nominatim_Config.Map_Default_Bounds) {
+ map.fitBounds(Nominatim_Config.Map_Default_Bounds);
+ }
if (attribution && attribution.length) {
L.control.attribution({ prefix: '<a href="https://leafletjs.com/">Leaflet</a>' }).addTo(map);
if (attribution && attribution.length) {
L.control.attribution({ prefix: '<a href="https://leafletjs.com/">Leaflet</a>' }).addTo(map);