How to update zoom-level at runtime?
-
Hi all,
Writing a javascript for MagicMirror, and it is mostly finished.
Though I've struck a problem; how to change Zoom-level at runtime?Any help will be highly appreciated :)
-
W.map.setView( center, zoom?, options? )
W.map.setZoom( zoom, options? )
W.map.zoomIn( delta?, options? )
W.map.zoomOut( delta?, options? )https://leafletjs.com/reference-0.7.7.html#map-set-methods
Windy (W.map) uses Leaflet 0.7.7
-
@siim said in How to update zoom-level at runtime?:
W.map.setView( center, zoom?, options? )
W.map.setZoom( zoom, options? )
W.map.zoomIn( delta?, options? )
W.map.zoomOut( delta?, options? )https://leafletjs.com/reference-0.7.7.html#map-set-methods
Windy (W.map) uses Leaflet 0.7.7
Hi @siim ,
I'm still a bit noob in development and have used the [store] and windyInit:
const options = { key: 'xxx', zoom: 5, lat: xx.xxx, lon: yy.yyy }, windyInit( options, windyAPI => { const { store } = windyAPI store.set('overlay', wind ) }, });
Can I somehow change zoom level using store.set ?
-
@TheStigh said in How to update zoom-level at runtime?:
const { store, map } = windyAPI map.setZoom(10)
-
Thanks, that worked :)
Can I change overlay (like from 'wind' to 'rain') using [map.] method, rather than usingstore.set('overlay', wind )
?