[basemap-openstreetmap] add Humantarian style

This commit is contained in:
fkloft
2015-10-11 23:16:24 +02:00
parent e35d2ac743
commit 95acdd773e

View File

@ -24,18 +24,27 @@
// use own namespace for plugin
window.plugin.mapTileOpenStreetMap = function() {};
window.plugin.mapTileOpenStreetMap = {
addLayer: function() {
// OpenStreetMap tiles - we shouldn't use these by default - https://wiki.openstreetmap.org/wiki/Tile_usage_policy
// "Heavy use (e.g. distributing an app that uses tiles from openstreetmap.org) is forbidden without prior permission from the System Administrators"
window.plugin.mapTileOpenStreetMap.addLayer = function() {
var osmOpt = {
attribution: 'Map data © OpenStreetMap contributors',
maxNativeZoom: 18,
maxZoom: 21,
};
//OpenStreetMap tiles - we shouldn't use these by default - https://wiki.openstreetmap.org/wiki/Tile_usage_policy
// "Heavy use (e.g. distributing an app that uses tiles from openstreetmap.org) is forbidden without prior permission from the System Administrators"
var layers = {
'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png': 'OpenStreetMap',
'http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png': 'Humanitarian',
};
osmAttribution = 'Map data © OpenStreetMap contributors';
var osmOpt = {attribution: osmAttribution, maxNativeZoom: 18, maxZoom: 21};
var osm = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', osmOpt);
layerChooser.addBaseLayer(osm, "OpenStreetMap");
for(var url in layers) {
var layer = new L.TileLayer(url, osmOpt);
layerChooser.addBaseLayer(layer, layers[url]);
}
},
};
var setup = window.plugin.mapTileOpenStreetMap.addLayer;