From 6426182c1ed46efc54501f77eab8951c41b52cc1 Mon Sep 17 00:00:00 2001 From: Nicolas F Date: Tue, 12 Jul 2016 21:20:46 +0200 Subject: [PATCH] Add retina size icons for spawn and location Unfortunately we need to explicitly tell leaflet not to scale them weirdly but to make them perceptually equivalent to the normal ones, which means we have hardcoded icon sizes for those two right now. --- overviewer_core/assetmanager.py | 4 +++- overviewer_core/data/js_src/util.js | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/overviewer_core/assetmanager.py b/overviewer_core/assetmanager.py index 4490596..f4db789 100644 --- a/overviewer_core/assetmanager.py +++ b/overviewer_core/assetmanager.py @@ -104,7 +104,9 @@ directory. 'signMarker': 'signpost_icon.png', 'bedMarker': 'bed.png', 'spawnMarker': 'icons/marker_home.png', - 'queryMarker': 'icons/marker_location.png' + 'spawnMarker2x': 'icons/marker_home_2x.png', + 'queryMarker': 'icons/marker_location.png', + 'queryMarker2x': 'icons/marker_location_2x.png' } dump['CONST']['mapDivId'] = 'mcmap' dump['CONST']['regionStrokeWeight'] = 2 # Obselete diff --git a/overviewer_core/data/js_src/util.js b/overviewer_core/data/js_src/util.js index 52fbd6f..dc486c6 100644 --- a/overviewer_core/data/js_src/util.js +++ b/overviewer_core/data/js_src/util.js @@ -130,9 +130,10 @@ overviewer.util = { overviewer.collections.spawnMarker.remove(); } if (typeof(ovconf.spawn) == "object") { - /// TODO: Retina Icon var spawnIcon = L.icon({ iconUrl: overviewerConfig.CONST.image.spawnMarker, + iconRetinaUrl: overviewerConfig.CONST.image.spawnMarker2x, + iconSize: [32, 37], }); var latlng = overviewer.util.fromWorldToLatLng(ovconf.spawn[0], ovconf.spawn[1], @@ -684,9 +685,10 @@ overviewer.util = { overviewer.map.setView(latlngcoords, zoom); if (ovconf.showlocationmarker) { - /// TODO: Retina Icon var locationIcon = L.icon({ iconUrl: overviewerConfig.CONST.image.queryMarker, + iconRetinaUrl: overviewerConfig.CONST.image.queryMarker2x, + iconSize: [32, 37], }); var locationm = L.marker(latlngcoords, { icon: locationIcon, title: "Linked location"});