first commit

This commit is contained in:
2024-11-04 19:13:57 +01:00
commit 546cc34310
7718 changed files with 982818 additions and 0 deletions

View File

@@ -0,0 +1,75 @@
Leaflet-providers
=================
An extension to [Leaflet](http://leafletjs.com/) that contains configurations for various free tile providers.
# Usage
Leaflet-providers [providers](#providers) are refered to with a `provider[.<variant>]`-string. Let's say you want to add the nice [Watercolor](http://maps.stamen.com/#watercolor/) style from Stamen to your map, you pass `Stamen.Watercolor` to the `L.tileLayer.provider`-constructor, which will return a [L.TileLayer](http://leafletjs.com/reference.html#tilelayer) instance for Stamens Watercolor tile layer.
```Javascript
// add Stamen Watercolor to map.
L.tileLayer.provider('Stamen.Watercolor').addTo(map);
```
# Providers
Leaflet-providers provides tile layers from different providers, including *OpenStreetMap*, *MapQuestOpen*, *Stamen*, *Esri* and *OpenWeatherMap*. The full listing of free to use layers can be [previewed](http://leaflet-extras.github.io/leaflet-providers/preview/index.html). The page will show you the name to use with `leaflet-providers.js` and the code to use it without dependencies.
## Providers requiring registration
In addition to the providers you are free to use, we support some layers which require registration.
### Nokia.
In order to use Nokia basemaps, you must [register](https://developer.here.com/web/guest/myapps). With your `devID` and `appID` specified in the options, the available layers are:
* Nokia.normalDay
* Nokia.normalGreyDay
* Nokia.satelliteNoLabelsDay
* Nokia.satelliteYesLabelsDay
* Nokia.terrainDay
For example:
```Javascript
L.tileLayer.provider('Nokia.terrainDay', {
devID: 'insert ID here',
appId: 'insert ID here'
}).addTo(map);
```
### Mapbox
In order to use Mapbox maps, you must [register](https://tiles.mapbox.com/signup). If your user name is `YourName` and your map is called `MyMap` you can add it with
```JavaScript
L.tileLayer.provider('MapBox.YourName.MyMap');
```
### Esri/ArcGIS
In order to use ArcGIS maps, you must [register](https://developers.arcgis.com/en/sign-up/) and abide by the [terms of service](https://developers.arcgis.com/en/terms/). Available layers are...
* Esri.WorldStreetMap
* Esri.DeLorme
* Esri.WorldTopoMap
* Esri.WorldImagery
* Esri.WorldTerrain
* Esri.WorldShadedRelief
* Esri.WorldPhysical
* Esri.OceanBasemap
* Esri.NatGeoWorldMap
* Esri.WorldGrayCanvas
# Goodies
An other little goodie this library provides is a prefilled layer control, so you can just provide an array of strings:
```JavaScript
var baseLayers = ['Stamen.Watercolor', 'OpenStreetMap.Mapnik'],
overlays = ['OpenWeatherMap.Clouds'];
var layerControl = L.control.layers.provided(baseLayers, overlays).addTo(map);
// you can still add your own afterwards with
layerControl.addBaseLayer(layer, name);
```
This work was inspired from <https://gist.github.com/1804938>, and originally created by [Stefan Seelmann](https://github.com/seelmann).

View File

@@ -0,0 +1,153 @@
<!doctype html>
<html lang="en">
<head>
<title>Leaflet Provider Demo</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- Leaflet style. REQUIRED! -->
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" />
<style>
html { height: 100% }
body { height: 100%; margin: 0; padding: 0;}
.map { height: 100% }
</style>
<!--Fork Me on Github ribbon, we're using the awsome version from simonwhitaker available at https://github.com/simonwhitaker/github-fork-ribbon-css -->
<link rel="stylesheet" href="css/gh-fork-ribbon.css" />
<!--[if IE]>
<link rel="stylesheet" href="css/gh-fork-ribbon.ie.css" />
<![endif]-->
</head>
<body>
<div class="github-fork-ribbon-wrapper left">
<div class="github-fork-ribbon">
<a href="https://github.com/leaflet-extras/leaflet-providers">Fork me on GitHub</a>
</div>
</div>
<div id="map" class="map"></div>
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet-src.js"></script>
<script src="leaflet-providers.js"></script>
<script>
var map = L.map('map', {
center: [48, -3],
zoom: 5,
zoomControl: false
});
var defaultLayer = L.tileLayer.provider('OpenStreetMap.Mapnik').addTo(map);
var baseLayers = {
'OpenStreetMap Default': defaultLayer,
'OpenStreetMap German Style': L.tileLayer.provider('OpenStreetMap.DE'),
'OpenStreetMap Black and White': L.tileLayer.provider('OpenStreetMap.BlackAndWhite'),
'OpenStreetMap H.O.T.': L.tileLayer.provider('OpenStreetMap.HOT'),
'Thunderforest OpenCycleMap': L.tileLayer.provider('Thunderforest.OpenCycleMap'),
'Thunderforest Transport': L.tileLayer.provider('Thunderforest.Transport'),
'Thunderforest Landscape': L.tileLayer.provider('Thunderforest.Landscape'),
'MapQuest OSM': L.tileLayer.provider('MapQuestOpen.OSM'),
'MapQuest Aerial': L.tileLayer.provider('MapQuestOpen.Aerial'),
'MapBox Example': L.tileLayer.provider('MapBox.examples.map-zr0njcqy'),
'Stamen Toner': L.tileLayer.provider('Stamen.Toner'),
'Stamen Terrain': L.tileLayer.provider('Stamen.Terrain'),
'Stamen Watercolor': L.tileLayer.provider('Stamen.Watercolor'),
'Esri WorldStreetMap': L.tileLayer.provider('Esri.WorldStreetMap'),
'Esri DeLorme': L.tileLayer.provider('Esri.DeLorme'),
'Esri WorldTopoMap': L.tileLayer.provider('Esri.WorldTopoMap'),
'Esri WorldImagery': L.tileLayer.provider('Esri.WorldImagery'),
'Esri WorldTerrain': L.tileLayer.provider('Esri.WorldTerrain'),
'Esri WorldShadedRelief': L.tileLayer.provider('Esri.WorldShadedRelief'),
'Esri WorldPhysical': L.tileLayer.provider('Esri.WorldPhysical'),
'Esri OceanBasemap': L.tileLayer.provider('Esri.OceanBasemap'),
'Esri NatGeoWorldMap': L.tileLayer.provider('Esri.NatGeoWorldMap'),
'Esri WorldGrayCanvas': L.tileLayer.provider('Esri.WorldGrayCanvas'),
'Nokia Normal Day': L.tileLayer.provider('Nokia.normalDay'),
'Nokia Normal Day Grey': L.tileLayer.provider('Nokia.normalGreyDay'),
'Nokia Satellite': L.tileLayer.provider('Nokia.satelliteNoLabelsDay'),
'Nokia Satellite (Labeled)': L.tileLayer.provider('Nokia.satelliteYesLabelsDay'),
'Nokia Terrain': L.tileLayer.provider('Nokia.terrainDay'),
'Acetate': L.tileLayer.provider('Acetate')
};
var overlayLayers = {
'OpenSeaMap': L.tileLayer.provider('OpenSeaMap'),
'OpenWeatherMap Clouds': L.tileLayer.provider('OpenWeatherMap.Clouds'),
'OpenWeatherMap CloudsClassic': L.tileLayer.provider('OpenWeatherMap.CloudsClassic'),
'OpenWeatherMap Precipitation': L.tileLayer.provider('OpenWeatherMap.Precipitation'),
'OpenWeatherMap PrecipitationClassic': L.tileLayer.provider('OpenWeatherMap.PrecipitationClassic'),
'OpenWeatherMap Rain': L.tileLayer.provider('OpenWeatherMap.Rain'),
'OpenWeatherMap RainClassic': L.tileLayer.provider('OpenWeatherMap.RainClassic'),
'OpenWeatherMap Pressure': L.tileLayer.provider('OpenWeatherMap.Pressure'),
'OpenWeatherMap PressureContour': L.tileLayer.provider('OpenWeatherMap.PressureContour'),
'OpenWeatherMap Wind': L.tileLayer.provider('OpenWeatherMap.Wind'),
'OpenWeatherMap Temperature': L.tileLayer.provider('OpenWeatherMap.Temperature'),
'OpenWeatherMap Snow': L.tileLayer.provider('OpenWeatherMap.Snow')
};
var layerControl = L.control.layers(baseLayers, overlayLayers, {collapsed: false}).addTo(map);
/* you could also use the following code instead
var map = new L.Map('map').setView([48, -3],5);
var defaultLayer = L.tileLayer.provider('OpenStreetMap.Mapnik').addTo(map);
var baseLayers = [
'OpenStreetMap.Mapnik',
'OpenStreetMap.DE',
'OpenStreetMap.BlackAndWhite',
'Thunderforest.OpenCycleMap',
'Thunderforest.Transport',
'Thunderforest.Landscape',
'MapQuestOpen.OSM',
'MapQuestOpen.Aerial',
'MapBox.examples.map-zr0njcqy',
'Stamen.Toner',
'Stamen.Terrain',
'Stamen.Watercolor',
'Esri.WorldStreetMap',
'Esri.DeLorme',
'Esri.WorldTopoMap',
'Esri.WorldImagery',
'Esri.WorldTerrain',
'Esri.WorldShadedRelief',
'Esri.WorldPhysical',
'Esri.OceanBasemap',
'Esri.NatGeoWorldMap',
'Esri.WorldGrayCanvas',
'Nokia.normalDay',
'Nokia.normalGreyDay',
'Nokia.satelliteNoLabelsDay',
'Nokia.satelliteYesLabelsDay,
'Nokia.terrainDay'
];
var overlayLayers = [
'OpenWeatherMap.Clouds',
'OpenWeatherMap.CloudsClassic',
'OpenWeatherMap.Precipitation',
'OpenWeatherMap.PrecipitationClassic',
'OpenWeatherMap.Rain',
'OpenWeatherMap.RainClassic',
'OpenWeatherMap.Pressure',
'OpenWeatherMap.PressureContour',
'OpenWeatherMap.Wind',
'OpenWeatherMap.Temperature',
'OpenWeatherMap.Snow'
];
L.control.layers.provided(baseLayers, overlayLayers, {collapsed: false}).addTo(map);
*/
// resize layers control to fit into view.
function resizeLayerControl() {
var layerControlHeight = document.body.clientHeight - (10 + 50);
var layerControl = document.getElementsByClassName('leaflet-control-layers-expanded')[0];
layerControl.style.overflowY = 'auto';
layerControl.style.maxHeight = layerControlHeight + 'px';
}
map.on('resize', resizeLayerControl);
resizeLayerControl();
</script>
</body>
</html>

View File

@@ -0,0 +1,20 @@
(function(){L.TileLayer.Provider=L.TileLayer.extend({initialize:function(a,b){var f=L.TileLayer.Provider.providers,e=a.split("."),g=e[0],h=e[1];if(!f[g])throw"No such provider ("+g+")";var d={url:f[g].url,options:f[g].options};if(h&&"variants"in f[g]){if(!(h in f[g].variants))throw"No such name in provider ("+h+")";e=f[g].variants[h];d={url:e.url||d.url,options:L.Util.extend({},d.options,e.options)}}else"function"===typeof d.url&&(d.url=d.url(e.splice(1,e.length-1).join(".")));var c=function(a){return-1===
a.indexOf("{attribution.")?a:a.replace(/\{attribution.(\w*)\}/,function(a,b){return c(f[b].options.attribution)})};d.options.attribution=c(d.options.attribution);e=L.Util.extend({},d.options,b);L.TileLayer.prototype.initialize.call(this,d.url,e)}});L.TileLayer.Provider.providers={OpenStreetMap:{url:"http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",options:{attribution:'\x26copy; \x3ca href\x3d"http://openstreetmap.org"\x3eOpenStreetMap\x3c/a\x3e contributors, \x3ca href\x3d"http://creativecommons.org/licenses/by-sa/2.0/"\x3eCC-BY-SA\x3c/a\x3e'},
variants:{Mapnik:{},BlackAndWhite:{url:"http://{s}.www.toolserver.org/tiles/bw-mapnik/{z}/{x}/{y}.png"},DE:{url:"http://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png"},HOT:{url:"http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png",options:{attribution:'{attribution.OpenStreetMap}, Tiles courtesy of \x3ca href\x3d"http://hot.openstreetmap.org/" target\x3d"_blank"\x3eHumanitarian OpenStreetMap Team\x3c/a\x3e'}}}},OpenCycleMap:{url:"http://{s}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png",options:{attribution:'\x26copy; \x3ca href\x3d"http://www.opencyclemap.org"\x3eOpenCycleMap\x3c/a\x3e, {attribution.OpenStreetMap}'}},
OpenSeaMap:{url:"http://tiles.openseamap.org/seamark/{z}/{x}/{y}.png",options:{attribution:'Map data: \x26copy; \x3ca href\x3d"http://www.openseamap.org"\x3eOpenSeaMap\x3c/a\x3e contributors'}},Thunderforest:{url:"http://{s}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png",options:{attribution:"{attribution.OpenCycleMap}"},variants:{OpenCycleMap:{},Transport:{url:"http://{s}.tile2.opencyclemap.org/transport/{z}/{x}/{y}.png"},Landscape:{url:"http://{s}.tile3.opencyclemap.org/landscape/{z}/{x}/{y}.png"},
Outdoors:{url:"http://{s}.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png"}}},OpenMapSurfer:{url:"http://openmapsurfer.uni-hd.de/tiles/roads/x\x3d{x}\x26y\x3d{y}\x26z\x3d{z}",options:{attribution:'Imagery from \x3ca href\x3d"http://giscience.uni-hd.de/"\x3eGIScience Research Group @ University of Heidelberg\x3c/a\x3e \x26mdash; Map data {attribution.OpenStreetMap}'},variants:{Roads:{},AdminBounds:{url:"http://openmapsurfer.uni-hd.de/tiles/adminb/x\x3d{x}\x26y\x3d{y}\x26z\x3d{z}"},Grayscale:{url:"http://openmapsurfer.uni-hd.de/tiles/roadsg/x\x3d{x}\x26y\x3d{y}\x26z\x3d{z}"}}},
MapQuestOpen:{url:"http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpeg",options:{attribution:'Tiles Courtesy of \x3ca href\x3d"http://www.mapquest.com/"\x3eMapQuest\x3c/a\x3e \x26mdash; Map data {attribution.OpenStreetMap}',subdomains:"1234"},variants:{OSM:{},Aerial:{url:"http://oatile{s}.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg",options:{attribution:'Tiles Courtesy of \x3ca href\x3d"http://www.mapquest.com/"\x3eMapQuest\x3c/a\x3e \x26mdash; Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency'}}}},
MapBox:{url:function(a){return"http://{s}.tiles.mapbox.com/v3/"+a+"/{z}/{x}/{y}.png"},options:{attribution:'Imagery from \x3ca href\x3d"http://mapbox.com/about/maps/"\x3eMapBox\x3c/a\x3e \x26mdash; Map data {attribution.OpenStreetMap}',subdomains:"abcd"}},Stamen:{url:"http://{s}.tile.stamen.com/toner/{z}/{x}/{y}.png",options:{attribution:'Map tiles by \x3ca href\x3d"http://stamen.com"\x3eStamen Design\x3c/a\x3e, \x3ca href\x3d"http://creativecommons.org/licenses/by/3.0"\x3eCC BY 3.0\x3c/a\x3e \x26mdash; Map data {attribution.OpenStreetMap}',
subdomains:"abcd",minZoom:0,maxZoom:20},variants:{Toner:{},TonerBackground:{url:"http://{s}.tile.stamen.com/toner-background/{z}/{x}/{y}.png"},TonerHybrid:{url:"http://{s}.tile.stamen.com/toner-hybrid/{z}/{x}/{y}.png"},TonerLines:{url:"http://{s}.tile.stamen.com/toner-lines/{z}/{x}/{y}.png"},TonerLabels:{url:"http://{s}.tile.stamen.com/toner-labels/{z}/{x}/{y}.png"},TonerLite:{url:"http://{s}.tile.stamen.com/toner-lite/{z}/{x}/{y}.png"},Terrain:{url:"http://{s}.tile.stamen.com/terrain/{z}/{x}/{y}.jpg",
options:{minZoom:4,maxZoom:18}},TerrainBackground:{url:"http://{s}.tile.stamen.com/terrain-background/{z}/{x}/{y}.jpg",options:{minZoom:4,maxZoom:18}},Watercolor:{url:"http://{s}.tile.stamen.com/watercolor/{z}/{x}/{y}.jpg",options:{minZoom:3,maxZoom:16}}}},Esri:{url:"http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}",options:{attribution:"Tiles \x26copy; Esri"},variants:{WorldStreetMap:{options:{attribution:"{attribution.Esri} \x26mdash; Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"}},
DeLorme:{url:"http://server.arcgisonline.com/ArcGIS/rest/services/Specialty/DeLorme_World_Base_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:11,attribution:"{attribution.Esri} \x26mdash; Copyright: \x26copy;2012 DeLorme"}},WorldTopoMap:{url:"http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}",options:{attribution:"{attribution.Esri} \x26mdash; Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community"}},
WorldImagery:{url:"http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",options:{attribution:"{attribution.Esri} \x26mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community"}},WorldTerrain:{url:"http://server.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}",options:{maxZoom:13,attribution:"{attribution.Esri} \x26mdash; Source: USGS, Esri, TANA, DeLorme, and NPS"}},
WorldShadedRelief:{url:"http://server.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}",options:{maxZoom:13,attribution:"{attribution.Esri} \x26mdash; Source: Esri"}},WorldPhysical:{url:"http://server.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer/tile/{z}/{y}/{x}",options:{maxZoom:8,attribution:"{attribution.Esri} \x26mdash; Source: US National Park Service"}},OceanBasemap:{url:"http://services.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer/tile/{z}/{y}/{x}",
options:{maxZoom:13,attribution:"{attribution.Esri} \x26mdash; Sources: GEBCO, NOAA, CHS, OSU, UNH, CSUMB, National Geographic, DeLorme, NAVTEQ, and Esri"}},NatGeoWorldMap:{url:"http://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}",options:{maxZoom:16,attribution:"{attribution.Esri} \x26mdash; National Geographic, Esri, DeLorme, NAVTEQ, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, iPC"}},WorldGrayCanvas:{url:"http://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}",
options:{maxZoom:16,attribution:"{attribution.Esri} \x26mdash; Esri, DeLorme, NAVTEQ"}}}},OpenWeatherMap:{options:{attribution:'Map data \x26copy; \x3ca href\x3d"http://openweathermap.org"\x3eOpenWeatherMap\x3c/a\x3e',opacity:.5},variants:{Clouds:{url:"http://{s}.tile.openweathermap.org/map/clouds/{z}/{x}/{y}.png"},CloudsClassic:{url:"http://{s}.tile.openweathermap.org/map/clouds_cls/{z}/{x}/{y}.png"},Precipitation:{url:"http://{s}.tile.openweathermap.org/map/precipitation/{z}/{x}/{y}.png"},PrecipitationClassic:{url:"http://{s}.tile.openweathermap.org/map/precipitation_cls/{z}/{x}/{y}.png"},
Rain:{url:"http://{s}.tile.openweathermap.org/map/rain/{z}/{x}/{y}.png"},RainClassic:{url:"http://{s}.tile.openweathermap.org/map/rain_cls/{z}/{x}/{y}.png"},Pressure:{url:"http://{s}.tile.openweathermap.org/map/pressure/{z}/{x}/{y}.png"},PressureContour:{url:"http://{s}.tile.openweathermap.org/map/pressure_cntr/{z}/{x}/{y}.png"},Wind:{url:"http://{s}.tile.openweathermap.org/map/wind/{z}/{x}/{y}.png"},Temperature:{url:"http://{s}.tile.openweathermap.org/map/temp/{z}/{x}/{y}.png"},Snow:{url:"http://{s}.tile.openweathermap.org/map/snow/{z}/{x}/{y}.png"}}},
Nokia:{options:{attribution:'Map \x26copy; \x3ca href\x3d"http://developer.here.com"\x3eNokia\x3c/a\x3e, Data \x26copy; NAVTEQ 2012',subdomains:"1234",devID:"xyz",appID:"abc"},variants:{normalDay:{url:"http://{s}.maptile.lbs.ovi.com/maptiler/v2/maptile/newest/normal.day/{z}/{x}/{y}/256/png8?token\x3d{devID}\x26app_id\x3d{appID}"},normalGreyDay:{url:"http://{s}.maptile.lbs.ovi.com/maptiler/v2/maptile/newest/normal.day.grey/{z}/{x}/{y}/256/png8?token\x3d{devID}\x26app_id\x3d{appID}"},satelliteNoLabelsDay:{url:"http://{s}.maptile.lbs.ovi.com/maptiler/v2/maptile/newest/satellite.day/{z}/{x}/{y}/256/png8?token\x3d{devID}\x26app_id\x3d{appID}"},
satelliteYesLabelsDay:{url:"http://{s}.maptile.lbs.ovi.com/maptiler/v2/maptile/newest/hybrid.day/{z}/{x}/{y}/256/png8?token\x3d{devID}\x26app_id\x3d{appID}"},terrainDay:{url:"http://{s}.maptile.lbs.ovi.com/maptiler/v2/maptile/newest/terrain.day/{z}/{x}/{y}/256/png8?token\x3d{devID}\x26app_id\x3d{appID}"}}},Acetate:{url:"http://a{s}.acetate.geoiq.com/tiles/acetate-hillshading/{z}/{x}/{y}.png",options:{attribution:"\x26copy;2012 Esri \x26 Stamen, Data from OSM and Natural Earth",subdomains:"0123",minZoom:2,
maxZoom:18},variants:{all:{},basemap:{url:"http://a{s}.acetate.geoiq.com/tiles/acetate-base/{z}/{x}/{y}.png"},terrain:{url:"http://a{s}.acetate.geoiq.com/tiles/terrain/{z}/{x}/{y}.png"},foreground:{url:"http://a{s}.acetate.geoiq.com/tiles/acetate-fg/{z}/{x}/{y}.png"},roads:{url:"http://a{s}.acetate.geoiq.com/tiles/acetate-roads/{z}/{x}/{y}.png"},labels:{url:"http://a{s}.acetate.geoiq.com/tiles/acetate-labels/{z}/{x}/{y}.png"},hillshading:{url:"http://a{s}.acetate.geoiq.com/tiles/hillshading/{z}/{x}/{y}.png"}}}};
L.tileLayer.provider=function(a,b){return new L.TileLayer.Provider(a,b)};L.Control.Layers.Provided=L.Control.Layers.extend({initialize:function(a,b,f){var e,g=function(a){return a.replace(/\./g,": ").replace(/([a-z])([A-Z])/g,"$1 $2")};a.length&&(function(){for(var b={},d=a.length,c=0;c<d;)"string"===typeof a[c]&&(0===c?(e=L.tileLayer.provider(a[0]),b[g(a[c])]=e):b[g(a[c])]=L.tileLayer.provider(a[c])),c++;a=b}(),this._first=e);b&&b.length&&function(){for(var a={},d=b.length,c=0;c<d;)"string"===typeof b[c]&&
(a[g(b[c])]=L.tileLayer.provider(b[c])),c++;b=a}();L.Control.Layers.prototype.initialize.call(this,a,b,f)},onAdd:function(a){this._first.addTo(a);return L.Control.Layers.prototype.onAdd.call(this,a)}});L.control.layers.provided=function(a,b,f){return new L.Control.Layers.Provided(a,b,f)}})();

View File

@@ -0,0 +1,9 @@
Copyright (c) 2013 Leaflet Providers contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
_THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE._

View File

@@ -0,0 +1,20 @@
{
"name": "leaflet-providers",
"version": "1.0.3",
"description": "An extension to Leaflet that contains configurations for various free tile providers.",
"main": "leaflet-providers.js",
"repository": {
"type": "git",
"url": "git://github.com/leaflet-extras/leaflet-providers.git"
},
"scripts":{
"pretest":"jshint leaflet-providers.js"
},
"license": "BSD-2-Clause",
"bugs": {
"url": "https://github.com/leaflet-extras/leaflet-providers/issues"
},
"devDependencies": {
"jshint": "~2.1.11"
}
}