From a93506d04800849a0862d8fd56c57de48c759b20 Mon Sep 17 00:00:00 2001 From: Bernhard Krabina Date: Fri, 31 Mar 2023 09:53:53 +0200 Subject: [PATCH 1/9] Update Basemap.at URLs according to https://cdn.basemap.at/basemap.at_URL_Umstellung_2023.pdf --- .../lib/leaflet-providers/leaflet-providers.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/resources/lib/leaflet-providers/leaflet-providers.js b/resources/lib/leaflet-providers/leaflet-providers.js index f31765ed..a6ef1d7c 100644 --- a/resources/lib/leaflet-providers/leaflet-providers.js +++ b/resources/lib/leaflet-providers/leaflet-providers.js @@ -582,7 +582,7 @@ } }, BasemapAT: { - url: 'https://maps{s}.wien.gv.at/basemap/{variant}/normal/google3857/{z}/{y}/{x}.{format}', + url: 'https://mapsneu.wien.gv.at/basemap/{variant}/normal/google3857/{z}/{y}/{x}.{format}', options: { maxZoom: 19, attribution: 'Datenquelle: basemap.at', @@ -612,7 +612,20 @@ variant: 'bmaporthofoto30cm', format: 'jpeg' } + }, + bmapgelaende: { + options: { + variant: 'bmapgelaende', + format: 'jpeg' + } + }, + bmapoberflaeche: { + options: { + variant: 'bmapoberflaeche', + format: 'jpeg' + } } + } }, nlmaps: { From abb71ff1fc2bde83bc512bd7ef1178caa53506db Mon Sep 17 00:00:00 2001 From: Bernhard Krabina Date: Fri, 31 Mar 2023 10:15:24 +0200 Subject: [PATCH 2/9] Update leaflet-providers.js --- resources/lib/leaflet-providers/leaflet-providers.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/lib/leaflet-providers/leaflet-providers.js b/resources/lib/leaflet-providers/leaflet-providers.js index a6ef1d7c..3a7109a0 100644 --- a/resources/lib/leaflet-providers/leaflet-providers.js +++ b/resources/lib/leaflet-providers/leaflet-providers.js @@ -582,14 +582,14 @@ } }, BasemapAT: { - url: 'https://mapsneu.wien.gv.at/basemap/{variant}/normal/google3857/{z}/{y}/{x}.{format}', + url: 'https://mapsneu.wien.gv.at/basemap/{variant}/{style}/google3857/{z}/{y}/{x}.{format}', options: { maxZoom: 19, attribution: 'Datenquelle: basemap.at', - subdomains: ['', '1', '2', '3', '4'], format: 'png', bounds: [[46.358770, 8.782379], [49.037872, 17.189532]], - variant: 'geolandbasemap' + variant: 'geolandbasemap', + style: 'normal' }, variants: { basemap: { From ae1a37b5f00bea7ecb2c93b5f4706172683e9651 Mon Sep 17 00:00:00 2001 From: Bernhard Krabina Date: Sun, 2 Apr 2023 12:26:59 +0200 Subject: [PATCH 3/9] Update leaflet-providers.js --- .../lib/leaflet-providers/leaflet-providers.js | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/resources/lib/leaflet-providers/leaflet-providers.js b/resources/lib/leaflet-providers/leaflet-providers.js index 3a7109a0..5c1dab9d 100644 --- a/resources/lib/leaflet-providers/leaflet-providers.js +++ b/resources/lib/leaflet-providers/leaflet-providers.js @@ -594,7 +594,6 @@ variants: { basemap: { options: { - maxZoom: 20, // currently only in Vienna variant: 'geolandbasemap' } }, @@ -608,24 +607,10 @@ }, orthofoto: { options: { - maxZoom: 20, // currently only in Vienna variant: 'bmaporthofoto30cm', format: 'jpeg' } - }, - bmapgelaende: { - options: { - variant: 'bmapgelaende', - format: 'jpeg' - } - }, - bmapoberflaeche: { - options: { - variant: 'bmapoberflaeche', - format: 'jpeg' - } } - } }, nlmaps: { From 7531d3404c8378dac87a42ff3c5249039636a897 Mon Sep 17 00:00:00 2001 From: thomas-topway-it Date: Fri, 27 Oct 2023 13:28:56 +0400 Subject: [PATCH 4/9] fix storeGeoJson and parserOutput->setText --- src/GeoJsonPages/GeoJsonContentHandler.php | 28 +++++++++++++++++----- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/src/GeoJsonPages/GeoJsonContentHandler.php b/src/GeoJsonPages/GeoJsonContentHandler.php index 978b18aa..0e31b8e3 100644 --- a/src/GeoJsonPages/GeoJsonContentHandler.php +++ b/src/GeoJsonPages/GeoJsonContentHandler.php @@ -1,5 +1,9 @@ fillParserOutput + if ( $cpoParams->getGenerateHtml() ) { + if ( $content->isValid() ) { + $text = $content->getData()->getValue(); + $parserOutput->setText( $content->rootValueTable( $content->getData()->getValue() ) ); + + } else { + $error = wfMessage( 'invalid-json-data' )->parse(); + $parserOutput->setText( $error ); + } - if ( !$cpoParams->getGenerateHtml() || !$content->isValid() ) { - $parserOutput->setText( '' ); - return; + $parserOutput->addModuleStyles( [ 'mediawiki.content.json' ] ); + } else { + $parserOutput->setText( null ); } - GeoJsonMapPageUi::forExistingPage( $content->beautifyJSON() ) - ->addToOutput( OutputFacade::newFromParserOutput( $parserOutput ) ); + // @FIXME alternatively decode $this->mText in GeoJsonContentHandler + // to avoid decoding it again in SubObjectBuilder -> getSubObjectsFromGeoJson + $text = json_encode( $content->getData()->getValue() ); if ( MapsFactory::globalInstance()->smwIntegrationIsEnabled() && $parserOutput->hasText() ) { MapsFactory::globalInstance() ->newSemanticGeoJsonStore( $parserOutput, $cpoParams->getPage() ) - ->storeGeoJson( $parserOutput->getRawText() ); + ->storeGeoJson( $text ); } } } From 9390f50cec6360231a0c12855b8a03f36939495b Mon Sep 17 00:00:00 2001 From: thomas-topway-it Date: Fri, 27 Oct 2023 13:52:35 +0400 Subject: [PATCH 5/9] fix comment --- src/GeoJsonPages/GeoJsonContentHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GeoJsonPages/GeoJsonContentHandler.php b/src/GeoJsonPages/GeoJsonContentHandler.php index 0e31b8e3..9da7794d 100644 --- a/src/GeoJsonPages/GeoJsonContentHandler.php +++ b/src/GeoJsonPages/GeoJsonContentHandler.php @@ -55,7 +55,7 @@ protected function fillParserOutput( $parserOutput->setText( null ); } - // @FIXME alternatively decode $this->mText in GeoJsonContentHandler + // @FIXME alternatively decode $this->mText in GeoJsonLegacyContent // to avoid decoding it again in SubObjectBuilder -> getSubObjectsFromGeoJson $text = json_encode( $content->getData()->getValue() ); From ecab282f203a1d7be1047e775e0483e62eea207a Mon Sep 17 00:00:00 2001 From: thomas-topway-it Date: Fri, 27 Oct 2023 16:13:59 +0400 Subject: [PATCH 6/9] fix $text correct block --- src/GeoJsonPages/GeoJsonContentHandler.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/GeoJsonPages/GeoJsonContentHandler.php b/src/GeoJsonPages/GeoJsonContentHandler.php index 9da7794d..68506a2b 100644 --- a/src/GeoJsonPages/GeoJsonContentHandler.php +++ b/src/GeoJsonPages/GeoJsonContentHandler.php @@ -55,11 +55,12 @@ protected function fillParserOutput( $parserOutput->setText( null ); } - // @FIXME alternatively decode $this->mText in GeoJsonLegacyContent - // to avoid decoding it again in SubObjectBuilder -> getSubObjectsFromGeoJson - $text = json_encode( $content->getData()->getValue() ); - if ( MapsFactory::globalInstance()->smwIntegrationIsEnabled() && $parserOutput->hasText() ) { + + // @FIXME alternatively decode $this->mText in GeoJsonLegacyContent + // to avoid decoding it again in SubObjectBuilder -> getSubObjectsFromGeoJson + $text = json_encode( $content->getData()->getValue() ); + MapsFactory::globalInstance() ->newSemanticGeoJsonStore( $parserOutput, $cpoParams->getPage() ) ->storeGeoJson( $text ); From 27e264983f65f0f63d500bcc454173cae2de0e94 Mon Sep 17 00:00:00 2001 From: thomas-topway-it Date: Thu, 2 Nov 2023 12:23:07 +0400 Subject: [PATCH 7/9] call parent fillParserOutput --- src/GeoJsonPages/GeoJsonContentHandler.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/GeoJsonPages/GeoJsonContentHandler.php b/src/GeoJsonPages/GeoJsonContentHandler.php index 68506a2b..b02ce601 100644 --- a/src/GeoJsonPages/GeoJsonContentHandler.php +++ b/src/GeoJsonPages/GeoJsonContentHandler.php @@ -38,22 +38,8 @@ protected function fillParserOutput( ParserOutput &$parserOutput ) { '@phan-var GeoJsonContent $content'; - - // @see JsonContentHandler -> fillParserOutput - if ( $cpoParams->getGenerateHtml() ) { - if ( $content->isValid() ) { - $text = $content->getData()->getValue(); - $parserOutput->setText( $content->rootValueTable( $content->getData()->getValue() ) ); - - } else { - $error = wfMessage( 'invalid-json-data' )->parse(); - $parserOutput->setText( $error ); - } - $parserOutput->addModuleStyles( [ 'mediawiki.content.json' ] ); - } else { - $parserOutput->setText( null ); - } + parent::fillParserOutput( $content, $cpoParams, $parserOutput ); if ( MapsFactory::globalInstance()->smwIntegrationIsEnabled() && $parserOutput->hasText() ) { From 834c1e6033aa68699b665b0d87fb3a583d66da7c Mon Sep 17 00:00:00 2001 From: thomas-topway-it Date: Thu, 2 Nov 2023 12:29:23 +0400 Subject: [PATCH 8/9] fix condition --- src/GeoJsonPages/GeoJsonContentHandler.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/GeoJsonPages/GeoJsonContentHandler.php b/src/GeoJsonPages/GeoJsonContentHandler.php index b02ce601..10d40bae 100644 --- a/src/GeoJsonPages/GeoJsonContentHandler.php +++ b/src/GeoJsonPages/GeoJsonContentHandler.php @@ -40,8 +40,11 @@ protected function fillParserOutput( '@phan-var GeoJsonContent $content'; parent::fillParserOutput( $content, $cpoParams, $parserOutput ); - - if ( MapsFactory::globalInstance()->smwIntegrationIsEnabled() && $parserOutput->hasText() ) { + + if ( $cpoParams->getGenerateHtml() + && $content->isValid() + && MapsFactory::globalInstance()->smwIntegrationIsEnabled() + && $parserOutput->hasText() ) { // @FIXME alternatively decode $this->mText in GeoJsonLegacyContent // to avoid decoding it again in SubObjectBuilder -> getSubObjectsFromGeoJson From 14a6de98277126768ca042297bde3d32ebed2686 Mon Sep 17 00:00:00 2001 From: thomas-topway-it Date: Mon, 6 Nov 2023 23:55:28 +0400 Subject: [PATCH 9/9] remove reviewer --- src/GeoJsonPages/GeoJsonContentHandler.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/GeoJsonPages/GeoJsonContentHandler.php b/src/GeoJsonPages/GeoJsonContentHandler.php index 10d40bae..75a23865 100644 --- a/src/GeoJsonPages/GeoJsonContentHandler.php +++ b/src/GeoJsonPages/GeoJsonContentHandler.php @@ -1,9 +1,5 @@