Skip to content

Commit

Permalink
Merge pull request #102 from SemanticMediaWiki/record
Browse files Browse the repository at this point in the history
Fix query with record type coordinates
  • Loading branch information
JeroenDeDauw authored Aug 24, 2016
2 parents d720655 + 1508474 commit 53e42e8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/queryprinters/SM_QueryHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,18 @@ protected function handleResultRow( array $row ) {
$dataItem = $dataValue->getDataItem();
$polyHandler = new PolygonHandler ( $dataItem->getString() );
$this->geoShapes[ $polyHandler->getGeoType() ][] = $polyHandler->shapeFromText();
} else if ( strpos( $dataValue->getTypeID(), '_rec' ) !== false ) {
foreach ( $dataValue->getDataItems() as $dataItem ) {
if ( $dataItem instanceof \SMWDIGeoCoord ) {
$location = Location::newFromLatLon( $dataItem->getLatitude(), $dataItem->getLongitude() );
$locations[] = $location;
}
}
}
else if ( $dataValue->getTypeID() != '_geo' && $i != 0 && !$this->isHeadersHide()) {
$properties[] = $this->handleResultProperty( $dataValue, $printRequest );
}
else if ( $printRequest->getMode() == SMWPrintRequest::PRINT_PROP && $printRequest->getTypeID() == '_geo' ) {
else if ( $printRequest->getMode() == SMWPrintRequest::PRINT_PROP && $printRequest->getTypeID() == '_geo' || $dataValue->getTypeID() == '_geo' ) {
$dataItem = $dataValue->getDataItem();

$location = Location::newFromLatLon( $dataItem->getLatitude(), $dataItem->getLongitude() );
Expand Down

0 comments on commit 53e42e8

Please sign in to comment.