[basemap-opencyclemap] additional layers

This commit is contained in:
fkloft
2015-10-11 00:44:43 +02:00
parent 6ade4563b9
commit b4611b3fe3

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.1.@@DATETIMEVERSION@@ // @version 0.2.0.@@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,21 +24,29 @@
// use own namespace for plugin // use own namespace for plugin
window.plugin.mapTileOpenCycleMap = function() {}; window.plugin.mapTileOpenCycleMap = {
addLayer: function() {
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'; var ocmOpt = {
var ocmOpt = {attribution: 'Tiles © OpenCycleMap, '+osmAttribution, maxNativeZoom: 18, maxZoom: 21}; attribution: 'Tiles © OpenCycleMap, Map data © OpenStreetMap',
var ocmCycle = new L.TileLayer('http://{s}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png', ocmOpt); maxNativeZoom: 18,
var ocmTransport = new L.TileLayer('http://{s}.tile2.opencyclemap.org/transport/{z}/{x}/{y}.png', ocmOpt); maxZoom: 21,
var ocmLandscape = new L.TileLayer('http://{s}.tile3.opencyclemap.org/landscape/{z}/{x}/{y}.png', ocmOpt); };
layerChooser.addBaseLayer(ocmCycle, "Thunderforest OpenCycleMap"); var layers = {
layerChooser.addBaseLayer(ocmTransport, "Thunderforest Transport"); 'cycle': 'OpenCycleMap',
layerChooser.addBaseLayer(ocmLandscape, "Thunderforest Landscape"); 'transport': 'Transport',
'transport-dark': 'Transport Dark',
'outdoors': 'Outdoors',
'landscape': 'Landscape',
};
for(var i in layers) {
var layer = new L.TileLayer('http://{s}.tile.thunderforest.com/' + i + '/{z}/{x}/{y}.png', ocmOpt);
layerChooser.addBaseLayer(layer, 'Thunderforest ' + layers[i]);
}
},
}; };
var setup = window.plugin.mapTileOpenCycleMap.addLayer; var setup = window.plugin.mapTileOpenCycleMap.addLayer;