Lucas Werkmeister (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/361293 )

Change subject: Accept more datatypes for geo literals
......................................................................

Accept more datatypes for geo literals

This adds a datatype used by LinkedGeoData.org, and makes it easier to
add more such datatypes in the future if needed.

Change-Id: Ic31f74131285c7bcb884c5ef5f5f0edb1de1a590
---
M wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js
1 file changed, 6 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/gui 
refs/changes/93/361293/1

diff --git a/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js 
b/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js
index e753556..1162b18 100644
--- a/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js
+++ b/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js
@@ -6,7 +6,10 @@
 wikibase.queryService.ui.resultBrowser.CoordinateResultBrowser = ( function( 
$, L, d3, _, window ) {
        'use strict';
 
-       var MAP_DATATYPE = 'http://www.opengis.net/ont/geosparql#wktLiteral';
+       var MAP_DATATYPES = [
+               'http://www.opengis.net/ont/geosparql#wktLiteral', // used by 
Wikidata
+               'http://www.openlinksw.com/schemas/virtrdf#Geometry' // used by 
LinkedGeoData.org
+       ];
        var GLOBE_EARTH = 'Q2';
 
        var LAYER_COLUMNS = [ 'layerLabel', 'layer' ];
@@ -212,7 +215,7 @@
                markers[ LAYER_DEFAULT_GROUP ] = [];
 
                this._iterateResult( function( field, key, row ) {
-                       if ( field && field.datatype === MAP_DATATYPE ) {
+                       if ( field && MAP_DATATYPES.indexOf( field.datatype ) 
!== -1 ) {
                                var longLat = self._extractLongLat( field.value 
);
                                if ( longLat === null || !longLat[0] || 
!longLat[1] ) {
                                        return true;
@@ -352,7 +355,7 @@
         * Check if this value contains an coordinate value.
         */
        SELF.prototype._checkCoordinate = function( value ) {
-               if ( value && value.datatype === MAP_DATATYPE ) {
+               if ( value && MAP_DATATYPES.indexOf( value.datatype ) !== -1 ) {
                        var globe = this._extractGlobe( value.value );
                        if ( globe === null || globe === GLOBE_EARTH ) {
                                this._drawable = true;

-- 
To view, visit https://gerrit.wikimedia.org/r/361293
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic31f74131285c7bcb884c5ef5f5f0edb1de1a590
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to