mirror of
https://github.com/netzmacht/contao-leaflet-libraries.git
synced 2025-11-28 11:04:07 +01:00
Update leaflet providers to version 1.1.5.
This commit is contained in:
27
assets/leaflet-providers/CHANGELOG.md
Normal file
27
assets/leaflet-providers/CHANGELOG.md
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
# Leaflet-providers changelog
|
||||
|
||||
## master version
|
||||
|
||||
## 1.1.5 (2015-10-01)
|
||||
- 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)
|
||||
|
||||
## 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)
|
||||
|
||||
## 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)
|
||||
|
||||
## 1.1.1 (2015-06-22)
|
||||
- Update Mapbox API to v4 (#167 by [@gutenye](https://github.com/gutenye)).
|
||||
- Started maintaining a changelog in CHANGELOG.md.
|
||||
@@ -15,6 +15,10 @@ L.tileLayer.provider('Stamen.Watercolor').addTo(map);
|
||||
Leaflet-providers tries to use `https://` if the page uses `https://` and the provider supports it.
|
||||
You can force the use of `http://` by passing `force_http: true` in the options argument.
|
||||
|
||||
## Retina tiles
|
||||
|
||||
Some providers have retina tiles for which the URL only needs to be slightly adjusted, e.g. `-----@2x.png`. For this, add the retina option in the URL, e.g. `-----{retina}.png`, and set a retina value in the options, e.g. `retina: '@2x'`. If Leaflet detects a retina screen (`L.Browser.retina`), the retina option passed to the tileLayer is set to the value supplied, otherwise it's replaced by an empty string.
|
||||
|
||||
# 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.
|
||||
@@ -38,9 +42,9 @@ L.tileLayer.provider('HERE.terrainDay', {
|
||||
|
||||
### 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:
|
||||
In order to use Mapbox maps, you must [register](https://tiles.mapbox.com/signup). You can get map ID and ACCESS_TOKEN from [Mapbox projects](https://www.mapbox.com/projects):
|
||||
```JavaScript
|
||||
L.tileLayer.provider('MapBox.YourName.MyMap');
|
||||
L.tileLayer.provider('MapBox', {id: 'ID', accessToken: 'ACCESS_TOKEN'}).addTo(map);
|
||||
```
|
||||
|
||||
### Esri/ArcGIS
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "leaflet-providers",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.5",
|
||||
"homepage": "https://github.com/leaflet-extras/leaflet-providers",
|
||||
"description": "An extension to Leaflet that contains configurations for various free tile providers.",
|
||||
"dependencies": {
|
||||
|
||||
@@ -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="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" />
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/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="http://cdn.leafletjs.com/leaflet-0.7/leaflet-src.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script>
|
||||
<script src="leaflet-providers.js"></script>
|
||||
<script>
|
||||
var map = L.map('map', {
|
||||
@@ -48,7 +48,7 @@
|
||||
'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.examples.map-zr0njcqy'),
|
||||
'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'),
|
||||
'Stamen Watercolor': L.tileLayer.provider('Stamen.Watercolor'),
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['leaflet'], factory);
|
||||
} else {
|
||||
// Assume leaflet is loaded into global object L already
|
||||
factory(L);
|
||||
}
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['leaflet'], factory);
|
||||
} else if (typeof modules === 'object' && module.exports) {
|
||||
// define a Common JS module that relies on 'leaflet'
|
||||
module.exports = factory(require('leaflet'));
|
||||
} else {
|
||||
// Assume Leaflet is loaded into global object L already
|
||||
factory(L);
|
||||
}
|
||||
}(this, function (L) {
|
||||
'use strict';
|
||||
|
||||
@@ -54,6 +57,19 @@
|
||||
provider.url = 'http:' + provider.url;
|
||||
}
|
||||
|
||||
// If retina option is set
|
||||
if (provider.options.retina) {
|
||||
// Check retina screen
|
||||
if (options.detectRetina && L.Browser.retina) {
|
||||
// The retina option will be active now
|
||||
// But we need to prevent Leaflet retina mode
|
||||
options.detectRetina = false;
|
||||
} else {
|
||||
// No retina, remove option
|
||||
provider.options.retina = '';
|
||||
}
|
||||
}
|
||||
|
||||
// replace attribution placeholders with their values from toplevel provider attribution,
|
||||
// recursively
|
||||
var attributionReplacer = function (attr) {
|
||||
@@ -222,9 +238,7 @@
|
||||
}
|
||||
},
|
||||
MapBox: {
|
||||
url: function (id) {
|
||||
return '//{s}.tiles.mapbox.com/v3/' + id + '/{z}/{x}/{y}.png';
|
||||
},
|
||||
url: '//api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}',
|
||||
options: {
|
||||
attribution:
|
||||
'Imagery from <a href="http://mapbox.com/about/maps/">MapBox</a> — ' +
|
||||
@@ -233,7 +247,7 @@
|
||||
}
|
||||
},
|
||||
Stamen: {
|
||||
url: '//stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}.png',
|
||||
url: '//stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}.{ext}',
|
||||
options: {
|
||||
attribution:
|
||||
'Map tiles by <a href="http://stamen.com">Stamen Design</a>, ' +
|
||||
@@ -490,11 +504,12 @@
|
||||
}
|
||||
},
|
||||
FreeMapSK: {
|
||||
url: 'http://{s}.freemap.sk/T/{z}/{x}/{y}.jpeg',
|
||||
url: 'http://t{s}.freemap.sk/T/{z}/{x}/{y}.jpeg',
|
||||
options: {
|
||||
minZoom: 8,
|
||||
maxZoom: 16,
|
||||
subdomains: ['t1', 't2', 't3', 't4'],
|
||||
subdomains: '1234',
|
||||
bounds: [[47.204642, 15.996093], [49.830896, 22.576904]],
|
||||
attribution:
|
||||
'{attribution.OpenStreetMap}, vizualization CC-By-SA 2.0 <a href="http://freemap.sk">Freemap.sk</a>'
|
||||
}
|
||||
@@ -517,8 +532,10 @@
|
||||
variants: {
|
||||
Positron: 'light_all',
|
||||
PositronNoLabels: 'light_nolabels',
|
||||
PositronOnlyLabels: 'light_only_labels',
|
||||
DarkMatter: 'dark_all',
|
||||
DarkMatterNoLabels: 'dark_nolabels'
|
||||
DarkMatterNoLabels: 'dark_nolabels',
|
||||
DarkMatterOnlyLabels: 'dark_only_labels'
|
||||
}
|
||||
},
|
||||
HikeBike: {
|
||||
@@ -621,6 +638,78 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
NLS: {
|
||||
// Maps from http://maps.nls.uk/geo/explore/
|
||||
url: '//nls-{s}.tileserver.com/{variant}/{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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "leaflet-providers",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.5",
|
||||
"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/preview.js preview/shared.js preview/https-support.js tests/test.js",
|
||||
"lint": "eslint --config .eslintrc leaflet-providers.js preview/*.js tests/test.js",
|
||||
"min": "uglifyjs leaflet-providers.js -mc -o leaflet-providers.min.js",
|
||||
"release": "mversion patch -m"
|
||||
},
|
||||
@@ -18,14 +18,20 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/leaflet-extras/leaflet-providers/issues"
|
||||
},
|
||||
"files": [
|
||||
"leaflet-providers.js",
|
||||
"README.md",
|
||||
"CHANGELOG.md",
|
||||
"licence.md"
|
||||
],
|
||||
"devDependencies": {
|
||||
"chai": "^2.3.0",
|
||||
"eslint": "^0.15.0",
|
||||
"eslint": "^1.1.0",
|
||||
"mocha": "^2.2.4",
|
||||
"mocha-phantomjs": "^3.5.3",
|
||||
"mversion": "^1.3.0",
|
||||
"uglify-js": "^2.4.15",
|
||||
"phantomjs": "^1.9.16"
|
||||
"phantomjs": "1.9.7-15",
|
||||
"uglify-js": "^2.4.15"
|
||||
},
|
||||
"autoupdate": {
|
||||
"source": "git",
|
||||
|
||||
Reference in New Issue
Block a user