From ef5478fcc2b7cf913f93b167293afc1c5d176e9f Mon Sep 17 00:00:00 2001 From: thomas-topway-it Date: Tue, 7 Nov 2023 18:39:53 +0400 Subject: [PATCH] Fixes issue 756 geoJson namespace error (#757) * Update Basemap.at URLs according to https://cdn.basemap.at/basemap.at_URL_Umstellung_2023.pdf * Update leaflet-providers.js * Update leaflet-providers.js * fix storeGeoJson and parserOutput->setText * fix comment * fix $text correct block * call parent fillParserOutput * fix condition * remove reviewer --------- Co-authored-by: Bernhard Krabina --- src/GeoJsonPages/GeoJsonContentHandler.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/GeoJsonPages/GeoJsonContentHandler.php b/src/GeoJsonPages/GeoJsonContentHandler.php index 978b18aa..75a23865 100644 --- a/src/GeoJsonPages/GeoJsonContentHandler.php +++ b/src/GeoJsonPages/GeoJsonContentHandler.php @@ -35,18 +35,20 @@ protected function fillParserOutput( ) { '@phan-var GeoJsonContent $content'; - if ( !$cpoParams->getGenerateHtml() || !$content->isValid() ) { - $parserOutput->setText( '' ); - return; - } + parent::fillParserOutput( $content, $cpoParams, $parserOutput ); + + if ( $cpoParams->getGenerateHtml() + && $content->isValid() + && MapsFactory::globalInstance()->smwIntegrationIsEnabled() + && $parserOutput->hasText() ) { - GeoJsonMapPageUi::forExistingPage( $content->beautifyJSON() ) - ->addToOutput( OutputFacade::newFromParserOutput( $parserOutput ) ); + // @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() ) { MapsFactory::globalInstance() ->newSemanticGeoJsonStore( $parserOutput, $cpoParams->getPage() ) - ->storeGeoJson( $parserOutput->getRawText() ); + ->storeGeoJson( $text ); } } }