(map: mapboxgl.Map)
| 19 | |
| 20 | const MAP_POS_KEY = "map-last-position"; |
| 21 | const DEFAULT_INDIA_VIEW = { lng: 78.9629, lat: 20.5937, zoom: 5, bearing: 0, pitch: 0 }; |
| 22 | |
| 23 | function saveMapPosition(map: mapboxgl.Map) { |
| 24 | const center = map.getCenter(); |
| 25 | localStorage.setItem(MAP_POS_KEY, JSON.stringify({ lng: center.lng, lat: center.lat, zoom: map.getZoom(), bearing: map.getBearing(), pitch: map.getPitch() })); |
| 26 | } |
| 27 |