Switch to basemap.at.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Tue, 5 Jan 2021 20:08:31 +0000 (21:08 +0100)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Tue, 5 Jan 2021 20:08:31 +0000 (21:08 +0100)
wrmap.js

index 456f22963009cc7a7a0f39b44fddd9a345d72058..e457e293ae4cc6ca8eebb8c471e9a78e925f2fac 100644 (file)
--- a/wrmap.js
+++ b/wrmap.js
@@ -261,12 +261,7 @@ function init_wrmap(i, jq_map) {
        // background layer
        // ----------------
 
-       // OSM layer
-       let layer_map = new ol.layer.Tile({
-               source: new ol.source.OSM()
-       });
-
-       // basemap.at layer  // TODO: Currently this is a race condition
+       // basemap.at layer
        let capabilitiesUrl = 'https://www.basemap.at/wmts/1.0.0/WMTSCapabilities.xml';
        fetch(capabilitiesUrl).then(function(response) {
                return response.text();
@@ -277,30 +272,22 @@ function init_wrmap(i, jq_map) {
                        matrixSet: 'google3857',
                        style: 'normal',
                });
-               layer_map = new ol.layer.Tile({
+               let layer_map = new ol.layer.Tile({
                        source: new ol.source.WMTS(options),
                });
+               map.getLayers().insertAt(0, layer_map);
        });
 
-       // Microsoft Bing Maps
-       // let layer_map = new OpenLayers.Layer.Bing({
-       //      type: "Road",
-       //      key: "AgPH3SlIXAwajrJKf0FORQyhTqsP8KIlvtN6RKfvxe6fOB6q6-HFmg8EOFm7LSOA",
-       //      tileOptions: {crossOriginKeyword: null}});
-
-       // // Alternative: Base map
-       // // see: https://www.basemap.at
-
-       // // Alternative: OpenTopoMap
-       // // see: https://opentopomap.org/about
-
-       // // Alternative: Dummy base layer
-       // let layer_map = new OpenLayers.Layer.Vector("Base Layer", {
-       //     isBaseLayer: true});
-
-       map.getLayers().insertAt(0, layer_map);
+       // // Alternatives:
+       // // * OpenTopoMap (see https://opentopomap.org/about)
+       // // * OSM
+       // let layer_map = new ol.layer.Tile({
+       //     source: new ol.source.OSM()
+       // });
+       // map.getLayers().insertAt(0, layer_map);      
 }
 
+
 function init_wrmaps() {
        let jq_maps = $('.wrmap'); // all wrmap <div> elements
        jq_maps.each(init_wrmap);