From 034eaf45bdf0908d66e5208f960816c159975c07 Mon Sep 17 00:00:00 2001 From: fkloft Date: Tue, 23 Aug 2016 11:37:38 +0200 Subject: [PATCH] [minimap] use Google tiles --- plugins/minimap.user.js | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/plugins/minimap.user.js b/plugins/minimap.user.js index 328692a8..c87866b7 100644 --- a/plugins/minimap.user.js +++ b/plugins/minimap.user.js @@ -2,7 +2,7 @@ // @id iitc-plugin-minimap@breunigs // @name IITC plugin: Mini map // @category Controls -// @version 0.1.0.@@DATETIMEVERSION@@ +// @version 0.2.0.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ @@ -33,26 +33,14 @@ window.plugin.miniMap.setup = function() { try { console.log('done loading leaflet.draw JS'); } catch(e) {} // we can't use the same TileLayer as the main map uses - it causes issues. - // stick with the MapQuest tiles for now + // stick with the Google tiles for now - //OpenStreetMap attribution - required by several of the layers - osmAttribution = 'Map data © OpenStreetMap contributors'; - - //MapQuest offer tiles - http://developer.mapquest.com/web/products/open/map - //their usage policy has no limits (except required notification above 4000 tiles/sec - we're perhaps at 50 tiles/sec based on CloudMade stats) - var mqSubdomains = [ 'otile1','otile2', 'otile3', 'otile4' ]; - var mqTileUrlPrefix = window.location.protocol !== 'https:' ? 'http://{s}.mqcdn.com' : 'https://{s}-s.mqcdn.com'; - var mqMapOpt = {attribution: osmAttribution+', Tiles Courtesy of MapQuest', maxZoom: 18, subdomains: mqSubdomains}; - var mqMap = new L.TileLayer(mqTileUrlPrefix+'/tiles/1.0.0/map/{z}/{x}/{y}.jpg',mqMapOpt); + // desktop mode - bottom-left, so it doesn't clash with the sidebar + // mobile mode - bottom-right - so it floats above the map copyright text + var position = isSmartphone() ? 'bottomright' : 'bottomleft'; setTimeout(function() { - if(!isSmartphone()) { - // desktop mode - bottom-left, so it doesn't clash with the sidebar - new L.Control.MiniMap(mqMap, {toggleDisplay: true, position: 'bottomleft'}).addTo(window.map); - } else { - // mobile mode - bottom-right - so it floats above the map copyright text - new L.Control.MiniMap(mqMap, {toggleDisplay: true, position: 'bottomright'}).addTo(window.map); - } + new L.Control.MiniMap(new L.Google('ROADMAP',{maxZoom:21}), {toggleDisplay: true, position: position}).addTo(window.map); }, 0); $('head').append('');