diff --git a/main.js b/main.js index 24ffeb8..bd94c74 100644 --- a/main.js +++ b/main.js @@ -179,34 +179,38 @@ function changeBaseMap(newMap){ basemapStyle = "https://tiles.openfreemap.org/styles/liberty" break; case "google_satellite": - basemapStyle = { + basemapStyle = { version: 8, sources: { "raster-tiles": { type: "raster", tiles: [ - "https://mt0.google.com/vt/lyrs=s&x={x}&y={y}&z={z}", - "https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}", - "https://mt2.google.com/vt/lyrs=s&x={x}&y={y}&z={z}", - "https://mt3.google.com/vt/lyrs=s&x={x}&y={y}&z={z}", + "https://api.maptiler.com/tiles/satellite-v2/{z}/{x}/{y}.jpg?key=6mG881AthmTTWyLvFyjH" ], tileSize: 256, - }, + attribution: "© MapTiler", + maxzoom: 20 + } }, - layers: [{ id: "raster-layer", type: "raster", source: "raster-tiles" }], + layers: [ + { + id: "satellite-layer", + type: "raster", + source: "raster-tiles" + } + ] } break; case "terrain": basemapStyle = { version: 8, sources: { - osm: { - type: 'raster', - tiles: ['https://a.tile.openstreetmap.org/{z}/{x}/{y}.png'], - tileSize: 256, - attribution: '© OpenStreetMap Contributors', - maxzoom: 19 - }, + topo: { + type: 'raster', + url: 'https://api.maptiler.com/maps/topo-v4/tiles.json?key=6mG881AthmTTWyLvFyjH', + tileSize: 256, + maxzoom: 20 + }, // Use a different source for terrain and hillshade layers, to improve render quality terrainSource: { type: 'raster-dem', @@ -219,9 +223,9 @@ function changeBaseMap(newMap){ }, layers: [ { - id: 'osm', + id: 'topo', type: 'raster', - source: 'osm' + source: 'topo' }, { id: 'hills', @@ -242,18 +246,15 @@ function changeBaseMap(newMap){ basemapStyle = { version: 8, sources: { - osm: { - type: 'raster', - tiles: [ - "https://mt0.google.com/vt/lyrs=s&x={x}&y={y}&z={z}", - "https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}", - "https://mt2.google.com/vt/lyrs=s&x={x}&y={y}&z={z}", - "https://mt3.google.com/vt/lyrs=s&x={x}&y={y}&z={z}", + "raster-tiles": { + type: "raster", + tiles: [ + "https://api.maptiler.com/tiles/satellite-v2/{z}/{x}/{y}.jpg?key=6mG881AthmTTWyLvFyjH" ], - tileSize: 256, - attribution: '© OpenStreetMap Contributors', - maxzoom: 19 - }, + tileSize: 256, + attribution: "© MapTiler", + maxzoom: 20 + }, // Use a different source for terrain and hillshade layers, to improve render quality terrainSource: { type: 'raster-dem', @@ -266,9 +267,9 @@ function changeBaseMap(newMap){ }, layers: [ { - id: 'osm', + id: 'raster-tiles', type: 'raster', - source: 'osm' + source: 'raster-tiles' }, { id: 'hills',