]> ToastFreeware Gitweb - philipp/winterrodeln/mediawiki_extensions/wrmap.git/commitdiff
Work on adding South Tyrol/Bozen.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Thu, 23 Nov 2023 22:45:42 +0000 (23:45 +0100)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Fri, 24 Nov 2023 13:01:02 +0000 (14:01 +0100)
src/wrmap.ts

index 81330acbde49aeadda2eb95d53c87d63e6a57831..f80ac19db3de1430cde830012bc0c33b27262895 100644 (file)
@@ -366,6 +366,10 @@ function init_wrmap(_: number, jq_map_element: HTMLElement) {
                '8.941 46.027, 8.970 45.881, 8.867 46.107, 8.515 46.269, 8.440 46.489, 8.045 46.299, 8.062 46.176, 7.818 45.986, ' +
                '7.530 46.023, 7.136 45.928, 6.843 46.173, 6.792 46.454, 6.412 46.474, 6.186 46.362)))';
 
+       const bolzanoWkt = 'POLYGON ((10.452 46.680, 10.501 46.800, 11.012 46.725, 11.202 46.923, 11.743 46.926, ' +
+               '12.047 47.001, 12.072 46.884, 12.335 46.673, 12.058 46.706, 11.973 46.577, 11.654 46.548, 11.534 46.402, ' +
+               '11.232 46.285, 11.242 46.540, 10.650 46.499, 10.452 46.680))'
+
 
        function getCountryGeometry(countryWkt: string) {
                let format = new OlFormatWkt();
@@ -379,6 +383,7 @@ function init_wrmap(_: number, jq_map_element: HTMLElement) {
 
        const austria = getCountryGeometry(austriaWkt);
        const swiss = getCountryGeometry(swissWkt);
+       const bolzano = getCountryGeometry(bolzanoWkt);
 
 
        function insertWmtsLayer(capabilitiesUrl: string, layer: string, attributions: string) {
@@ -420,6 +425,7 @@ function init_wrmap(_: number, jq_map_element: HTMLElement) {
                BasemapAt,
                VaoAusland,
                Sosm,
+               Bolzano,
        }
 
        let backgroundLayer = BackgroundLayer.BasemapAt;
@@ -428,6 +434,8 @@ function init_wrmap(_: number, jq_map_element: HTMLElement) {
                backgroundLayer = BackgroundLayer.BasemapAt;
        } else if (allFeaturesInCountry(features_all, swiss)) {
                backgroundLayer = BackgroundLayer.Sosm;
+       } else if (allFeaturesInCountry(features_all, bolzano)) {
+               backgroundLayer = BackgroundLayer.Bolzano;
        } else if (swiss.intersectsCoordinate(center)) {
                backgroundLayer = BackgroundLayer.Sosm;
        } else {
@@ -444,6 +452,9 @@ function init_wrmap(_: number, jq_map_element: HTMLElement) {
                case BackgroundLayer.Sosm:
                        insertSwissLayer();
                        break;
+               case BackgroundLayer.Bolzano:
+                       insertWmtsLayer('https://geoservices.buergernetz.bz.it/mapproxy/service?REQUEST=GetCapabilities&SERVICE=WMTS', 'oown-OpenStreetMap:Terrain', 'Grundkarte: <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>');
+                       break;
        }