update default and plugin base maps to allow zooming up to level 21, and scale the tiles when they don't support such a resolution

This commit is contained in:
Jon Atkins 2014-05-29 01:23:25 +01:00
parent 6c35c8d238
commit a05ac61cb4
9 changed files with 22 additions and 24 deletions

View File

@ -119,11 +119,8 @@ window.setupMap = function() {
//their usage policy has no limits (except required notification above 4000 tiles/sec - we're perhaps at 50 tiles/sec based on CloudMade stats) //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 mqSubdomains = [ 'otile1','otile2', 'otile3', 'otile4' ];
var mqTileUrlPrefix = window.location.protocol !== 'https:' ? 'http://{s}.mqcdn.com' : 'https://{s}-s.mqcdn.com'; 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 mqMapOpt = {attribution: osmAttribution+', Tiles Courtesy of MapQuest', maxNativeZoom: 18, maxZoom: 21, subdomains: mqSubdomains};
var mqMap = new L.TileLayer(mqTileUrlPrefix+'/tiles/1.0.0/map/{z}/{x}/{y}.jpg',mqMapOpt); var mqMap = new L.TileLayer(mqTileUrlPrefix+'/tiles/1.0.0/map/{z}/{x}/{y}.jpg',mqMapOpt);
//MapQuest satellite coverage outside of the US is rather limited - so not really worth having as we have google as an option
//var mqSatOpt = {attribution: 'Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency', maxZoom: 18, subdomains: mqSubdomains};
//var mqSat = new L.TileLayer('http://{s}.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg',mqSatOpt);
var ingressGMapOptions = { var ingressGMapOptions = {
backgroundColor: '#0e3d4e', //or #dddddd ? - that's the Google tile layer default backgroundColor: '#0e3d4e', //or #dddddd ? - that's the Google tile layer default
@ -140,10 +137,10 @@ window.setupMap = function() {
var views = [ var views = [
/*0*/ mqMap, /*0*/ mqMap,
/*1*/ new L.Google('ROADMAP',{maxZoom:20, mapOptions:ingressGMapOptions}), /*1*/ new L.Google('ROADMAP',{maxZoom:21, mapOptions:ingressGMapOptions}),
/*2*/ new L.Google('ROADMAP',{maxZoom:20}), /*2*/ new L.Google('ROADMAP',{maxZoom:21}),
/*3*/ new L.Google('SATELLITE',{maxZoom:20}), /*3*/ new L.Google('SATELLITE',{maxZoom:21}),
/*4*/ new L.Google('HYBRID',{maxZoom:20}), /*4*/ new L.Google('HYBRID',{maxZoom:21}),
/*5*/ new L.Google('TERRAIN',{maxZoom:15}) /*5*/ new L.Google('TERRAIN',{maxZoom:15})
]; ];

View File

@ -2,7 +2,7 @@
// @id iitc-plugin-bing-maps // @id iitc-plugin-bing-maps
// @name IITC plugin: Bing maps // @name IITC plugin: Bing maps
// @category Map Tiles // @category Map Tiles
// @version 0.1.2.@@DATETIMEVERSION@@ // @version 0.1.3.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@ // @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@ // @downloadURL @@DOWNLOADURL@@
@ -27,7 +27,7 @@ window.plugin.mapBing.setupBingLeaflet = function() {
window.plugin.mapBing.setup = function() { window.plugin.mapBing.setup = function() {
window.plugin.mapBing.setupBingLeaflet(); window.plugin.mapBing.setupBingLeaflet();
//set this to your API key //set this to your API key
var bingApiKey = 'ArR2hTa2C9cRQZT-RmgrDkfvh3PwEVRl0gB34OO4wJI7vQNElg3DDWvbo5lfUs3p'; var bingApiKey = 'ArR2hTa2C9cRQZT-RmgrDkfvh3PwEVRl0gB34OO4wJI7vQNElg3DDWvbo5lfUs3p';
@ -59,7 +59,7 @@ window.plugin.mapBing.setup = function() {
if (bingMapContainers[type].getLayers().length == 0) { if (bingMapContainers[type].getLayers().length == 0) {
// dummy layer group is empty - create the bing layer // dummy layer group is empty - create the bing layer
console.log('basemap-bing: creating '+type+' layer'); console.log('basemap-bing: creating '+type+' layer');
var bingMap = new L.BingLayer (bingApiKey, {type: type, maxZoom:20}); var bingMap = new L.BingLayer (bingApiKey, {type: type, maxNativeZoom: 19, maxZoom: 21});
bingMapContainers[type].addLayer(bingMap); bingMapContainers[type].addLayer(bingMap);
} }
} }

View File

@ -2,7 +2,7 @@
// @id iitc-plugin-basemap-blank@jonatkins // @id iitc-plugin-basemap-blank@jonatkins
// @name IITC plugin: Blank map // @name IITC plugin: Blank map
// @category Map Tiles // @category Map Tiles
// @version 0.1.1.@@DATETIMEVERSION@@ // @version 0.1.2.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@ // @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@ // @downloadURL @@DOWNLOADURL@@
@ -24,7 +24,7 @@ window.plugin.mapTileBlank = function() {};
window.plugin.mapTileBlank.addLayer = function() { window.plugin.mapTileBlank.addLayer = function() {
var blankOpt = {attribution: '', maxZoom: 20}; var blankOpt = {attribution: '', maxNativeZoom: 18, maxZoom: 21};
var blankWhite = new L.TileLayer('@@INCLUDEIMAGE:images/basemap-blank-tile-white.png@@', blankOpt); var blankWhite = new L.TileLayer('@@INCLUDEIMAGE:images/basemap-blank-tile-white.png@@', blankOpt);
var blankBlack = new L.TileLayer('@@INCLUDEIMAGE:images/basemap-blank-tile-black.png@@', blankOpt); var blankBlack = new L.TileLayer('@@INCLUDEIMAGE:images/basemap-blank-tile-black.png@@', blankOpt);

View File

@ -2,7 +2,7 @@
// @id iitc-plugin-basemap-gmaps-gray@jacob1123 // @id iitc-plugin-basemap-gmaps-gray@jacob1123
// @name IITC plugin: Gray Google Roads // @name IITC plugin: Gray Google Roads
// @category Map Tiles // @category Map Tiles
// @version 0.1.1.@@DATETIMEVERSION@@ // @version 0.1.2.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@ // @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@ // @downloadURL @@DOWNLOADURL@@
@ -37,7 +37,7 @@ window.plugin.grayGMaps.addLayer = function() {
] ]
}; };
var grayGMaps = new L.Google('ROA#DMAP',{maxZoom:20, mapOptions: grayGMapsOptions}); var grayGMaps = new L.Google('ROA#DMAP',{maxZoom:21, mapOptions: grayGMapsOptions});
layerChooser.addBaseLayer(grayGMaps, "Google Gray"); layerChooser.addBaseLayer(grayGMaps, "Google Gray");
}; };

View File

@ -2,7 +2,7 @@
// @id iitc-plugin-basemap-mapquest-open-aerial@jonatkins // @id iitc-plugin-basemap-mapquest-open-aerial@jonatkins
// @name IITC plugin: MapQuest Open Satellite view (US Only) // @name IITC plugin: MapQuest Open Satellite view (US Only)
// @category Map Tiles // @category Map Tiles
// @version 0.1.0.@@DATETIMEVERSION@@ // @version 0.1.1.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@ // @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@ // @downloadURL @@DOWNLOADURL@@
@ -27,7 +27,7 @@ window.plugin.mapTileMapQuestSat.addLayer = function() {
var mqSubdomains = [ 'otile1','otile2', 'otile3', 'otile4' ]; var mqSubdomains = [ 'otile1','otile2', 'otile3', 'otile4' ];
var mqTileUrlPrefix = window.location.protocol !== 'https:' ? 'http://{s}.mqcdn.com' : 'https://{s}-s.mqcdn.com'; var mqTileUrlPrefix = window.location.protocol !== 'https:' ? 'http://{s}.mqcdn.com' : 'https://{s}-s.mqcdn.com';
//MapQuest satellite coverage outside of the US is rather limited - so not really worth having as we have google as an op! //MapQuest satellite coverage outside of the US is rather limited - so not really worth having as we have google as an op!
var mqSatOpt = {attribution: 'Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency', maxZoom: 18, subdomains: mqSubdomains}; var mqSatOpt = {attribution: 'Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency', maxNativeZoom: 18, maxZoom: 21, subdomains: mqSubdomains};
var mqSat = new L.TileLayer('http://{s}.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg',mqSatOpt); var mqSat = new L.TileLayer('http://{s}.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg',mqSatOpt);
layerChooser.addBaseLayer(mqSat, "MapQuest Open Satellite"); layerChooser.addBaseLayer(mqSat, "MapQuest Open Satellite");

View File

@ -2,7 +2,7 @@
// @id iitc-plugin-nokia-ovi-maps // @id iitc-plugin-nokia-ovi-maps
// @name IITC plugin: Nokia OVI maps // @name IITC plugin: Nokia OVI maps
// @category Map Tiles // @category Map Tiles
// @version 0.1.1.@@DATETIMEVERSION@@ // @version 0.1.2.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@ // @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@ // @downloadURL @@DOWNLOADURL@@
@ -31,7 +31,7 @@ window.plugin.mapNokiaOvi.setup = function() {
}; };
var oviOpt = {attribution: 'Imagery © Nokia OVI', maxZoom: 20}; var oviOpt = {attribution: 'Imagery © Nokia OVI', maxNativeZoom: 20, maxZoom: 21};
$.each(oviStyles, function(style,data) { $.each(oviStyles, function(style,data) {
oviOpt['style'] = style; oviOpt['style'] = style;

View File

@ -2,7 +2,7 @@
// @id iitc-plugin-basemap-opencyclepam@jonatkins // @id iitc-plugin-basemap-opencyclepam@jonatkins
// @name IITC plugin: OpenCycleMap.org map tiles // @name IITC plugin: OpenCycleMap.org map tiles
// @category Map Tiles // @category Map Tiles
// @version 0.1.0.@@DATETIMEVERSION@@ // @version 0.1.1.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@ // @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@ // @downloadURL @@DOWNLOADURL@@
@ -27,7 +27,7 @@ window.plugin.mapTileOpenCycleMap.addLayer = function() {
//the Thunderforest (OpenCycleMap) tiles are free to use - http://www.thunderforest.com/terms/ //the Thunderforest (OpenCycleMap) tiles are free to use - http://www.thunderforest.com/terms/
osmAttribution = 'Map data © OpenStreetMap'; osmAttribution = 'Map data © OpenStreetMap';
var ocmOpt = {attribution: 'Tiles © OpenCycleMap, '+osmAttribution, maxZoom: 18}; var ocmOpt = {attribution: 'Tiles © OpenCycleMap, '+osmAttribution, maxNativeZoom: 18, maxZoom: 21};
var ocmCycle = new L.TileLayer('http://{s}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png', ocmOpt); var ocmCycle = new L.TileLayer('http://{s}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png', ocmOpt);
var ocmTransport = new L.TileLayer('http://{s}.tile2.opencyclemap.org/transport/{z}/{x}/{y}.png', ocmOpt); var ocmTransport = new L.TileLayer('http://{s}.tile2.opencyclemap.org/transport/{z}/{x}/{y}.png', ocmOpt);
var ocmLandscape = new L.TileLayer('http://{s}.tile3.opencyclemap.org/landscape/{z}/{x}/{y}.png', ocmOpt); var ocmLandscape = new L.TileLayer('http://{s}.tile3.opencyclemap.org/landscape/{z}/{x}/{y}.png', ocmOpt);

View File

@ -2,7 +2,7 @@
// @id iitc-plugin-basemap-openstreetpam@jonatkins // @id iitc-plugin-basemap-openstreetpam@jonatkins
// @name IITC plugin: OpenStreetMap.org map tiles // @name IITC plugin: OpenStreetMap.org map tiles
// @category Map Tiles // @category Map Tiles
// @version 0.1.0.@@DATETIMEVERSION@@ // @version 0.1.1.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@ // @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@ // @downloadURL @@DOWNLOADURL@@
@ -28,7 +28,7 @@ window.plugin.mapTileOpenStreetMap.addLayer = function() {
// "Heavy use (e.g. distributing an app that uses tiles from openstreetmap.org) is forbidden without prior permission from the System Administrators" // "Heavy use (e.g. distributing an app that uses tiles from openstreetmap.org) is forbidden without prior permission from the System Administrators"
osmAttribution = 'Map data © OpenStreetMap contributors'; osmAttribution = 'Map data © OpenStreetMap contributors';
var osmOpt = {attribution: osmAttribution, maxZoom: 18}; var osmOpt = {attribution: osmAttribution, maxNativeZoom: 18, maxZoom: 21};
var osm = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', osmOpt); var osm = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', osmOpt);
layerChooser.addBaseLayer(osm, "OpenStreetMap"); layerChooser.addBaseLayer(osm, "OpenStreetMap");

View File

@ -52,7 +52,8 @@ window.plugin.mapTileStamen.addLayer = function() {
layer: layer, layer: layer,
type: type, type: type,
minZoom: minZoom, minZoom: minZoom,
maxZoom: maxZoom maxNativeZoom: maxZoom,
maxZoom: 21
}); });
layerChooser.addBaseLayer(mapLayer,'Stamen '+name); layerChooser.addBaseLayer(mapLayer,'Stamen '+name);