jenkins-bot has submitted this change and it was merged. Change subject: Fix: Map markers are to small ......................................................................
Fix: Map markers are to small -Changes markers size relative to zoom level -Use leaflet 1.0 -Use prefer canvas option Bug:T148496 Change-Id: I6f10afafeb05ef9a320bfabd2cf0de3a29f3eb14 --- M index.html M package.json M wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js 3 files changed, 19 insertions(+), 5 deletions(-) Approvals: Smalyshev: Looks good to me, approved jenkins-bot: Verified diff --git a/index.html b/index.html index 13f7d8b..10a8379 100644 --- a/index.html +++ b/index.html @@ -210,9 +210,6 @@ </div> </div> - <!-- faster rendering of points in leaflet map --> - <script>L_PREFER_CANVAS = true;</script> - <!-- JS files --> <!-- build:js js/vendor.min.js --> <script src="node_modules/jquery/dist/jquery.js"></script> diff --git a/package.json b/package.json index 5378a14..23a623b 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "jquery.i18n": "git+https://github.com/wikimedia/jquery.i18n.git", "jquery.uls": "git+https://github.com/wikimedia/jquery.uls.git", "js-cookie": "^2.1.2", - "leaflet": "^0.7.7", + "leaflet": "~1.0.0", "leaflet-fullscreen": "^1.0.1", "leaflet-zoombox": "^0.2.0", "moment": "^2.13.0", diff --git a/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js b/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js index 529998d..84b2566 100644 --- a/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js +++ b/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js @@ -62,11 +62,13 @@ maxZoom: 18, minZoom: 2, fullscreenControl: true, + preferCanvas: true, layers: _.compact( markerGroups ) // convert object to array } ).fitBounds( markerGroups[ LAYER_DEFAULT_GROUP ].getBounds() ); this._setTileLayer( map ); this._createControls( map, markerGroups ); + this._createMarkerZoomResize( map, markerGroups ); $element.html( container ); }; @@ -104,6 +106,22 @@ control._update(); } ); } + }; + + /** + * @private + */ + SELF.prototype._createMarkerZoomResize = function( map, markerGroups ) { + var resize = function() { + var currentZoom = map.getZoom(); + markerGroups[LAYER_DEFAULT_GROUP].setStyle( { + radius: ( currentZoom * ( 1 / 2 ) ), + weight: ( currentZoom * ( 1 / 5 ) ) + } ); + }; + + map.on( 'zoomend', resize ); + resize(); }; /** @@ -204,7 +222,6 @@ } return { - radius: 3, color: color, opacity: 0.8, fillColor: color, -- To view, visit https://gerrit.wikimedia.org/r/319360 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6f10afafeb05ef9a320bfabd2cf0de3a29f3eb14 Gerrit-PatchSet: 1 Gerrit-Project: wikidata/query/gui Gerrit-Branch: master Gerrit-Owner: Jonas Kress (WMDE) <jonas.kr...@wikimedia.de> Gerrit-Reviewer: Smalyshev <smalys...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits