This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
let map = (this.map = leaflet.map(mapEl, this.options)); | |
// apetov: | |
mapMode.switchMode(lat, lng); | |
tileUrl = mapMode.tileUrl; | |
// | |
leaflet.tileLayer(tileUrl, { attribution }).addTo(map); | |
map.setView([lat, lng], defaultZoomLevel); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
import { MapMode } from './map-mode'; | |
var mapMode = new MapMode(); | |
// Changed tileUrl to dynamic variable | |
let tileUrl = mapMode.tileUrl; | |
const attribution = mapMode.attribution; | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
export class MapMode { | |
constructor() { | |
this.currentMode = 'day'; | |
} | |
switchMode(lat, lng) { | |
const sunCalc = require('suncalc'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
// My tests | |
// DPS909 | |
var x = [1,46,7,9]; | |
var reversed = x.reverse(); | |
var y = [9,7,46,1]; | |