Add bigger zoom-in and zoom-out button, move attribution to button on small screens

This commit is contained in:
Pieter Vander Vennet 2021-02-21 03:38:12 +01:00
parent 2572e99b95
commit 604d7863fe
13 changed files with 142 additions and 66 deletions

View file

@ -36,7 +36,6 @@ export class Basemap {
this.map.attributionControl.setPrefix(
extraAttribution.Render() + " | <a href='https://osm.org'>OpenStreetMap</a>");
this.map.zoomControl.setPosition("bottomright");
const self = this;
let previousLayer = currentLayer.data;
@ -59,6 +58,13 @@ export class Basemap {
location.ping();
});
location.map(loc => loc.zoom)
.addCallback(zoom => {
if (Math.abs(self.map.getZoom() - zoom) > 0.1) {
self.map.setZoom(zoom, {});
}
})
this.map.on("click", function (e) {
// @ts-ignore
lastClickLocation.setData({lat: e.latlng.lat, lon: e.latlng.lng})