Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes issue 756 geoJson namespace error #757

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 );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you add this call?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is to set the correct parserOutput text by calling the same method in the parent class (JsonContentHandler)


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 );
}
}
}
Loading