Skip to content

Commit

Permalink
Fixes issue 756 geoJson namespace error (#757)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
thomas-topway-it and krabina committed Nov 7, 2023
1 parent 80aaf85 commit ef5478f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/GeoJsonPages/GeoJsonContentHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
}
}

0 comments on commit ef5478f

Please sign in to comment.