Update leaflet providers.

This commit is contained in:
David Molineus
2016-10-04 13:43:39 +02:00
parent 471e89c789
commit 9c3618a521
8 changed files with 101 additions and 161 deletions

View File

@@ -1,27 +1,46 @@
# Leaflet-providers changelog
## master version
## 1.1.14 (2016-07-15)
- Remove MapQuest, fixes #219
- Accidently skipped v1.1.12 and v1.1.13
## 1.1.11 (2016-06-04)
- Added protocol relativity to OSM FR, OSM HOT and Hydda providers (#214, #215).
## 1.1.9 (2016-03-23)
- Re-added HERE layers #209, discussion in #206.
## 1.1.8 (2016-03-22)
- Removed HERE layers #206
## 1.1.7 (2015-12-16)
- Removed Acetate tile layers #198
## 1.1.6 (2015-11-03)
- Removed most of the NLS layers per NLS request #193, fixes #178
- Added new variants to the HERE provider #183 by [@andreaswc](https://github.com/andreaswc)
- Added some tests to make sure all the placeholders in the url template are replaced #188
## 1.1.5 (2015-10-01)
- Improvements for the NLS layers (#182) by [@tomhughes](https://github.com/tomhughes)
- Improvements for the NLS layers #182 by [@tomhughes](https://github.com/tomhughes)
- Check for valid bounds before fitting the preview map to undefined (fixes #185)
- Add bounds for FreeMapSK (fixes #184)
- Fix Stamen layers with `.jpg` extension (#187, fixes #184)
## 1.1.4 (2015-09-27)
- Only include the interesting files in the npm package (#180)
- Add GSGS_Ireland to NLS provider with `tms:true` to invert y-axis (#181)
- Only include the interesting files in the npm package #180
- Add GSGS_Ireland to NLS provider with `tms:true` to invert y-axis #181
## 1.1.3 (2015-09-26)
- Add various historical layers of the Natioanal library of Scotland (NLS) (#179)
- Add a page to visually check bounds (#179)
- Add various historical layers of the Natioanal library of Scotland (NLS) #179
- Add a page to visually check bounds #179
## 1.1.2 (2015-09-05)
- Add CartoDB labels-only styles (#170 by [@almccon](https://github.com/almccon))
- Implement commonjs module (#172)
- Added retina URL option (#177, [@routexl](https://github.com/routexl)
- Add CartoDB labels-only styles #170 by [@almccon](https://github.com/almccon)
- Implement commonjs module #172
- Added retina URL option #177, [@routexl](https://github.com/routexl)
## 1.1.1 (2015-06-22)
- Update Mapbox API to v4 (#167 by [@gutenye](https://github.com/gutenye)).
- Update Mapbox API to v4 #167 by [@gutenye](https://github.com/gutenye)
- Started maintaining a changelog in CHANGELOG.md.

View File

@@ -1,6 +1,6 @@
Leaflet-providers
=================
An extension to [Leaflet](http://leafletjs.com/) that contains configurations for various free tile providers.
An extension to [Leaflet](http://leafletjs.com/) that contains configurations for various free<sup>[1](#what-is-free)</sup> 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.
@@ -21,11 +21,11 @@ Some providers have retina tiles for which the URL only needs to be slightly adj
# 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.
Leaflet-providers provides tile layers from different providers, including *OpenStreetMap*, *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.
In addition to the providers you are free<b id="what-is-free">1</b> to use, we support some layers which require registration.
### HERE (formerly Nokia).
@@ -56,3 +56,8 @@ In order to use ArcGIS maps, you must [register](https://developers.arcgis.com/e
# Attribution
This work was inspired from <https://gist.github.com/1804938>, and originally created by [Stefan Seelmann](https://github.com/seelmann).
### What do we mean by *free*?
<b id="what-is-free">1</b>
We try to maintain leaflet-providers in such a way that you'll be able to use the layers we include without paying money.
This doesn't mean no limits apply, you should always check before using these layers for anything serious.

View File

@@ -1,6 +1,6 @@
{
"name": "leaflet-providers",
"version": "1.1.5",
"version": "1.1.15",
"homepage": "https://github.com/leaflet-extras/leaflet-providers",
"description": "An extension to Leaflet that contains configurations for various free tile providers.",
"dependencies": {

View File

@@ -6,7 +6,7 @@
<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="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css" />
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0-rc.1/leaflet.css" />
<style>
html { height: 100% }
body { height: 100%; margin: 0; padding: 0;}
@@ -26,7 +26,7 @@
</div>
<div id="map" class="map"></div>
<script src="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0-rc.1/leaflet.js"></script>
<script src="leaflet-providers.js"></script>
<script>
var map = L.map('map', {
@@ -46,8 +46,6 @@
'Thunderforest Transport': L.tileLayer.provider('Thunderforest.Transport'),
'Thunderforest Landscape': L.tileLayer.provider('Thunderforest.Landscape'),
'Hydda Full': L.tileLayer.provider('Hydda.Full'),
'MapQuest OSM': L.tileLayer.provider('MapQuestOpen.OSM'),
'MapQuest Aerial': L.tileLayer.provider('MapQuestOpen.Aerial'),
'MapBox Example': L.tileLayer.provider('MapBox', {id: 'mapbox.streets', accessToken: 'pk.eyJ1IjoiZ3V0ZW55ZSIsImEiOiJmNjJlMDNmYTUyMzNjMzQxZmY4Mzc1ZmFiYmExNjMxOSJ9.xgl1PBwQV9CtwW-usedrcQ'}),
'Stamen Toner': L.tileLayer.provider('Stamen.Toner'),
'Stamen Terrain': L.tileLayer.provider('Stamen.Terrain'),
@@ -61,8 +59,7 @@
'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'),
'Acetate': L.tileLayer.provider('Acetate')
'Esri WorldGrayCanvas': L.tileLayer.provider('Esri.WorldGrayCanvas')
};
var overlayLayers = {
@@ -80,10 +77,10 @@
'OpenWeatherMap Snow': L.tileLayer.provider('OpenWeatherMap.Snow')
};
var layerControl = L.control.layers(baseLayers, overlayLayers, {collapsed: false}).addTo(map);
L.control.layers(baseLayers, overlayLayers, {collapsed: false}).addTo(map);
// resize layers control to fit into view.
function resizeLayerControl() {
function resizeLayerControl () {
var layerControlHeight = document.body.clientHeight - (10 + 50);
var layerControl = document.getElementsByClassName('leaflet-control-layers-expanded')[0];

View File

@@ -48,8 +48,6 @@
url: variant.url || provider.url,
options: L.Util.extend({}, provider.options, variantOptions)
};
} else if (typeof provider.url === 'function') {
provider.url = provider.url(parts.splice(1, parts.length - 1).join('.'));
}
var forceHTTP = window.location.protocol === 'file:' || provider.options.forceHTTP;
@@ -118,13 +116,14 @@
}
},
France: {
url: 'http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png',
url: '//{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png',
options: {
maxZoom: 20,
attribution: '&copy; Openstreetmap France | {attribution.OpenStreetMap}'
}
},
HOT: {
url: 'http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
url: '//{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
options: {
attribution: '{attribution.OpenStreetMap}, Tiles courtesy of <a href="http://hot.openstreetmap.org/" target="_blank">Humanitarian OpenStreetMap Team</a>'
}
@@ -140,7 +139,7 @@
OpenTopoMap: {
url: '//{s}.tile.opentopomap.org/{z}/{x}/{y}.png',
options: {
maxZoom: 16,
maxZoom: 17,
attribution: 'Map data: {attribution.OpenStreetMap}, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: &copy; <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)'
}
},
@@ -148,7 +147,7 @@
url: '//{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png',
options: {
attribution:
'&copy; <a href="http://www.opencyclemap.org">OpenCycleMap</a>, {attribution.OpenStreetMap}',
'&copy; <a href="http://www.thunderforest.com/">Thunderforest</a>, {attribution.OpenStreetMap}',
variant: 'cycle'
},
variants: {
@@ -165,12 +164,19 @@
maxZoom: 19
}
},
SpinalMap: {
options: {
variant: 'spinal-map',
maxZoom: 11
}
},
Landscape: 'landscape',
Outdoors: 'outdoors'
Outdoors: 'outdoors',
Pioneer: 'pioneer'
}
},
OpenMapSurfer: {
url: 'http://openmapsurfer.uni-hd.de/tiles/{variant}/x={x}&y={y}&z={z}',
url: 'http://korona.geog.uni-heidelberg.de/tiles/{variant}/x={x}&y={y}&z={z}',
options: {
maxZoom: 20,
variant: 'roads',
@@ -193,7 +199,7 @@
}
},
Hydda: {
url: 'http://{s}.tile.openstreetmap.se/hydda/{variant}/{z}/{x}/{y}.png',
url: '//{s}.tile.openstreetmap.se/hydda/{variant}/{z}/{x}/{y}.png',
options: {
variant: 'full',
attribution: 'Tiles courtesy of <a href="http://openstreetmap.se/" target="_blank">OpenStreetMap Sweden</a> &mdash; Map data {attribution.OpenStreetMap}'
@@ -204,39 +210,6 @@
RoadsAndLabels: 'roads_and_labels'
}
},
MapQuestOpen: {
/* Mapquest does support https, but with a different subdomain:
* https://otile{s}-s.mqcdn.com/tiles/1.0.0/{type}/{z}/{x}/{y}.{ext}
* which makes implementing protocol relativity impossible.
*/
url: 'http://otile{s}.mqcdn.com/tiles/1.0.0/{type}/{z}/{x}/{y}.{ext}',
options: {
type: 'map',
ext: 'jpg',
attribution:
'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> &mdash; ' +
'Map data {attribution.OpenStreetMap}',
subdomains: '1234'
},
variants: {
OSM: {},
Aerial: {
options: {
type: 'sat',
attribution:
'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> &mdash; ' +
'Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency'
}
},
HybridOverlay: {
options: {
type: 'hyb',
ext: 'png',
opacity: 0.9
}
}
}
},
MapBox: {
url: '//api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}',
options: {
@@ -276,17 +249,15 @@
Terrain: {
options: {
variant: 'terrain',
minZoom: 4,
maxZoom: 18,
bounds: [[22, -132], [70, -56]]
minZoom: 0,
maxZoom: 18
}
},
TerrainBackground: {
options: {
variant: 'terrain-background',
minZoom: 4,
maxZoom: 18,
bounds: [[22, -132], [70, -56]]
minZoom: 0,
maxZoom: 18
}
},
TopOSMRelief: {
@@ -422,8 +393,8 @@
*/
url:
'//{s}.{base}.maps.cit.api.here.com/maptile/2.1/' +
'maptile/{mapID}/{variant}/{z}/{x}/{y}/256/png8?' +
'app_id={app_id}&app_code={app_code}',
'{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?' +
'app_id={app_id}&app_code={app_code}&lg={language}',
options: {
attribution:
'Map &copy; 1987-2014 <a href="http://developer.here.com">HERE</a>',
@@ -433,7 +404,11 @@
'app_code': '<insert your app_code here>',
base: 'base',
variant: 'normal.day',
maxZoom: 20
maxZoom: 20,
type: 'maptile',
language: 'eng',
format: 'png8',
size: '256'
},
variants: {
normalDay: 'normal.day',
@@ -448,6 +423,23 @@
normalNightGrey: 'normal.night.grey',
normalNightGreyMobile: 'normal.night.grey.mobile',
basicMap: {
options: {
type: 'basetile'
}
},
mapLabels: {
options: {
type: 'labeltile',
format: 'png'
}
},
trafficFlow: {
options: {
base: 'traffic',
type: 'flowtile'
}
},
carnavDayGrey: 'carnav.day.grey',
hybridDay: {
options: {
@@ -483,26 +475,6 @@
}
}
},
Acetate: {
url: 'http://a{s}.acetate.geoiq.com/tiles/{variant}/{z}/{x}/{y}.png',
options: {
attribution:
'&copy;2012 Esri & Stamen, Data from OSM and Natural Earth',
subdomains: '0123',
minZoom: 2,
maxZoom: 18,
variant: 'acetate-base'
},
variants: {
basemap: 'acetate-base',
terrain: 'terrain',
all: 'acetate-hillshading',
foreground: 'acetate-fg',
roads: 'acetate-roads',
labels: 'acetate-labels',
hillshading: 'hillshading'
}
},
FreeMapSK: {
url: 'http://t{s}.freemap.sk/T/{z}/{x}/{y}.jpeg',
options: {
@@ -640,75 +612,21 @@
}
},
NLS: {
// Maps from http://maps.nls.uk/geo/explore/
url: '//nls-{s}.tileserver.com/{variant}/{z}/{x}/{y}.jpg',
// NLS maps are copyright National library of Scotland.
// http://maps.nls.uk/projects/api/index.html
// Please contact NLS for anything other than non-commercial low volume usage
//
// Map sources: Ordnance Survey 1:1m to 1:63K, 1920s-1940s
// z0-9 - 1:1m
// z10-11 - quarter inch (1:253440)
// z12-18 - one inch (1:63360)
url: '//nls-{s}.tileserver.com/nls/{z}/{x}/{y}.jpg',
options: {
attribution: '<a href="http://geo.nls.uk/maps/">National Library of Scotland Historic Maps</a>',
bounds: [[49.6, -12], [61.7, 3]],
minZoom: 1,
maxZoom: 18,
subdomains: '0123',
},
variants: {
// OS 1:1m to 1:10K, 1900s
// z0-10 - 1:1m
// z11-12 - ?
// z13-14 - one inch (1:63360)
// z15-18 - six inch (1:10560)
'OS_1900': 'NLS_API',
// OS 1:1m to 1:63K, 1920s-1940s
// z0-9 - 1:1m
// z10-11 - quarter inch (1:253440)
// z12-18 - one inch (1:63360)
'OS_1920': 'nls',
'OS_opendata': {
url: 'http://geo.nls.uk/maps/opendata/{z}/{x}/{y}.png',
options: {
maxZoom: 16
}
},
// OS six inch, 1843 - 1882
'OS_6inch_1st': {
url: 'http://geo.nls.uk/maps/os/six_inch/{z}/{x}/{y}.png',
options: {
tms: true,
minZoom: 6,
maxZoom: 16,
bounds: [[49.86261, -8.66444], [60.89421, 1.7785]]
}
},
// OS six inch, 1888 - 1913
'OS_6inch': 'os_6_inch_gb',
// OS 1:25000, 1937 - 1961
'OS_25k': '25k',
// OS one inch, 1945 - 1947
'OS_npe': {
url: 'http://geo.nls.uk/maps/os/newpopular/{z}/{x}/{y}.png',
options: {
tms: true,
minZoom: 3,
maxZoom: 15
}
},
// OS one inch, 1952 - 1961
'OS_7th': 'os7gb',
// OS 1:1056, 1893 - 1896
'OS_London': {
options: {
variant: 'London_1056',
minZoom: 9,
bounds: [[51.177621, -0.708618], [51.618016, 0.355682]]
}
},
'GSGS_Ireland': {
url: 'http://geo.nls.uk/maps/ireland/gsgs4136/{z}/{x}/{y}.png',
options: {
tms: true,
minZoom: 5,
maxZoom: 15,
bounds: [[51.371780, -10.810546], [55.422779, -5.262451]]
}
}
}
}
};

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{
"name": "leaflet-providers",
"version": "1.1.5",
"version": "1.1.15",
"description": "An extension to Leaflet that contains configurations for various free tile providers.",
"main": "leaflet-providers.js",
"repository": {
@@ -10,7 +10,7 @@
"scripts": {
"test": "npm run lint && npm run testsuite",
"testsuite": "mocha-phantomjs tests/index.html",
"lint": "eslint --config .eslintrc leaflet-providers.js preview/*.js tests/test.js",
"lint": "eslint --config .eslintrc leaflet-providers.js index.html preview/*.js preview/*.html tests/*",
"min": "uglifyjs leaflet-providers.js -mc -o leaflet-providers.min.js",
"release": "mversion patch -m"
},
@@ -26,7 +26,8 @@
],
"devDependencies": {
"chai": "^2.3.0",
"eslint": "^1.1.0",
"eslint": "^2.7.0",
"eslint-plugin-html": "^1.4.0",
"mocha": "^2.2.4",
"mocha-phantomjs": "^3.5.3",
"mversion": "^1.3.0",

View File

@@ -27,7 +27,7 @@ $GLOBALS['LEAFLET_LIBRARIES']['leaflet'] = array
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-providers'] = array
(
'name' => 'Leaflet-providers',
'version' => '1.1.5',
'version' => '1.1.15',
'license' => '<a href="https://github.com/leaflet-extras/leaflet-providers/blob/master/license.md" target="_blank">BSD-2-Clause</a>',
'homepage' => 'http://leaflet-extras.github.io/leaflet-providers',
'javascript' => 'assets/leaflet/libs/leaflet-providers/leaflet-providers.min.js'