Skip to content

Instantly share code, notes, and snippets.

View apetov's full-sized avatar

John apetov

  • Toronto, Canada
View GitHub Profile
// ...
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);
// ...
import { MapMode } from './map-mode';
var mapMode = new MapMode();
// Changed tileUrl to dynamic variable
let tileUrl = mapMode.tileUrl;
const attribution = mapMode.attribution;
// ...
'use strict';
export class MapMode {
constructor() {
this.currentMode = 'day';
}
switchMode(lat, lng) {
const sunCalc = require('suncalc');
/*
// My tests
// DPS909
var x = [1,46,7,9];
var reversed = x.reverse();
var y = [9,7,46,1];