From 7fa03091ceaca767bcdb9281b34225ac8ea75912 Mon Sep 17 00:00:00 2001 From: dave Date: Wed, 3 Aug 2022 22:17:30 -0700 Subject: [PATCH] add more map layers --- templates/map.html | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/templates/map.html b/templates/map.html index 29a7810..378355c 100644 --- a/templates/map.html +++ b/templates/map.html @@ -45,7 +45,27 @@ '' + points[i].date + ''); } - L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {}).addTo(map); + var baseMaps = { + "Google Earth": L.tileLayer('http://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}', { + maxZoom: 20, + subdomains:['mt0','mt1','mt2','mt3'] + }), + "Google Hybrid": L.tileLayer('http://{s}.google.com/vt/lyrs=s,h&x={x}&y={y}&z={z}', { + maxZoom: 20, + subdomains:['mt0','mt1','mt2','mt3'] + }), + "Google Streets": L.tileLayer('http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}', { + maxZoom: 20, + subdomains:['mt0','mt1','mt2','mt3'] + }), + "Google Terrain": L.tileLayer('http://{s}.google.com/vt/lyrs=p&x={x}&y={y}&z={z}', { + maxZoom: 20, + subdomains:['mt0','mt1','mt2','mt3'] + }), + "OSM Streets": L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {}).addTo(map), + }; + + var layerControl = L.control.layers(baseMaps).addTo(map); // when resolving_hash is > 0 we ignore the map's moveend events as to avoid pushing state during a pop var resolving_hash = 0;