jenkins-bot has submitted this change and it was merged.

Change subject: Switch to geojson for geoshapes srv
......................................................................


Switch to geojson for geoshapes srv

For now, use geojson instead of topojson. 4x traffic cost :(

Bug: T144777
Change-Id: I5cf223c3c5292c68139bd67825a7c96b7a76378f
---
M modules/box/Map.js
1 file changed, 11 insertions(+), 5 deletions(-)

Approvals:
  MaxSem: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/box/Map.js b/modules/box/Map.js
index ccb81c5..619020d 100644
--- a/modules/box/Map.js
+++ b/modules/box/Map.js
@@ -242,14 +242,20 @@
                                uri.port = undefined;
                                uri.path = '/geoshape';
                                uri.query.origin = location.protocol + '//' + 
location.host;
+                               // HACK: workaround for T144777
+                               uri.query.getgeojson = 1;
 
                                return $.getJSON( uri.toString() ).then( 
function ( geoshape ) {
                                        delete data.href;
-                                       data.type = 'FeatureCollection';
-                                       data.features = [];
-                                       $.each( geoshape.objects, function ( 
key ) {
-                                               data.features.push( 
topojson.feature( geoshape, geoshape.objects[ key ] ) );
-                                       } );
+
+                                       // HACK: workaround for T144777 - we 
should be using topojson instead
+                                       $.extend( data, geoshape );
+
+                                       // data.type = 'FeatureCollection';
+                                       // data.features = [];
+                                       // $.each( geoshape.objects, function ( 
key ) {
+                                       //      data.features.push( 
topojson.feature( geoshape, geoshape.objects[ key ] ) );
+                                       // } );
                                } );
 
                        default:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5cf223c3c5292c68139bd67825a7c96b7a76378f
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: master
Gerrit-Owner: Yurik <yu...@wikimedia.org>
Gerrit-Reviewer: MaxSem <maxsem.w...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to