[basemap-openstreetmap] add Humantarian style
This commit is contained in:
@ -24,18 +24,27 @@
|
|||||||
|
|
||||||
|
|
||||||
// use own namespace for plugin
|
// use own namespace for plugin
|
||||||
window.plugin.mapTileOpenStreetMap = function() {};
|
window.plugin.mapTileOpenStreetMap = {
|
||||||
|
addLayer: function() {
|
||||||
window.plugin.mapTileOpenStreetMap.addLayer = function() {
|
// OpenStreetMap tiles - we shouldn't use these by default - https://wiki.openstreetmap.org/wiki/Tile_usage_policy
|
||||||
|
|
||||||
//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"
|
// "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';
|
var osmOpt = {
|
||||||
var osmOpt = {attribution: osmAttribution, maxNativeZoom: 18, maxZoom: 21};
|
attribution: 'Map data © OpenStreetMap contributors',
|
||||||
var osm = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', osmOpt);
|
maxNativeZoom: 18,
|
||||||
|
maxZoom: 21,
|
||||||
|
};
|
||||||
|
|
||||||
layerChooser.addBaseLayer(osm, "OpenStreetMap");
|
var layers = {
|
||||||
|
'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png': 'OpenStreetMap',
|
||||||
|
'http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png': 'Humanitarian',
|
||||||
|
};
|
||||||
|
|
||||||
|
for(var url in layers) {
|
||||||
|
var layer = new L.TileLayer(url, osmOpt);
|
||||||
|
layerChooser.addBaseLayer(layer, layers[url]);
|
||||||
|
}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
var setup = window.plugin.mapTileOpenStreetMap.addLayer;
|
var setup = window.plugin.mapTileOpenStreetMap.addLayer;
|
||||||
|
Reference in New Issue
Block a user