Add dependency of contao-leaflet-libraries

This commit is contained in:
David Molineus
2015-01-10 13:11:09 +01:00
parent a9b6486af2
commit 2a2fa4cf64
14 changed files with 20 additions and 710 deletions

2
.gitignore vendored
View File

@@ -1,7 +1,7 @@
/vendor/
/bin/
/demo/
/assets/js/
/assets/js/*.js
/.tx/
coverage.xml

View File

@@ -1,10 +0,0 @@
So you want to add a layer?
=======
Yay! go add it to the leaflet-providers.js as long as it follows the following
rules:
- Don't violate a providers TOS (if it exists, include a link to it)
- Don't pre-populate api keys with working keys.
- It should be a basic tile source, no exteral libraries etc.
- The owner hasn't asked us to remove it (hasn't happened yet)

View File

@@ -1,63 +0,0 @@
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.
### HERE (formerly Nokia).
In order to use HERE basemaps, you must [register](http://developer.here.com/get-started). With your `app_id` and `app_code` specified in the options. The available layers are:
* HERE.normalDay
* HERE.normalGreyDay
* HERE.satelliteNoLabelsDay
* HERE.satelliteYesLabelsDay
* HERE.terrainDay
For example:
```Javascript
L.tileLayer.provider('HERE.terrainDay', {
app_id: 'insert ID here',
app_code: '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
# Attribution
This work was inspired from <https://gist.github.com/1804938>, and originally created by [Stefan Seelmann](https://github.com/seelmann).

View File

@@ -1,22 +0,0 @@
{
"name": "leaflet-providers",
"version": "1.0.12",
"homepage": "https://github.com/leaflet-extras/leaflet-providers",
"description": "An extension to Leaflet that contains configurations for various free tile providers.",
"main": "leaflet-providers.js",
"keywords": [
"leaflet",
"stamen",
"osm"
],
"license": "BSD-2-Clause",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests",
"preview",
"*.html"
]
}

View File

@@ -1,97 +0,0 @@
<!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'),
'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'),
'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'),
'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);
// 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

@@ -1,460 +0,0 @@
(function () {
'use strict';
L.TileLayer.Provider = L.TileLayer.extend({
initialize: function (arg, options) {
var providers = L.TileLayer.Provider.providers;
var parts = arg.split('.');
var providerName = parts[0];
var variantName = parts[1];
if (!providers[providerName]) {
throw 'No such provider (' + providerName + ')';
}
var provider = {
url: providers[providerName].url,
options: providers[providerName].options
};
// overwrite values in provider from variant.
if (variantName && 'variants' in providers[providerName]) {
if (!(variantName in providers[providerName].variants)) {
throw 'No such variant of ' + providerName + ' (' + variantName + ')';
}
var variant = providers[providerName].variants[variantName];
var variantOptions;
if (typeof variant === 'string') {
variantOptions = {
variant: variant
};
} else {
variantOptions = variant.options;
}
provider = {
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('.'));
}
// replace attribution placeholders with their values from toplevel provider attribution,
// recursively
var attributionReplacer = function (attr) {
if (attr.indexOf('{attribution.') === -1) {
return attr;
}
return attr.replace(/\{attribution.(\w*)\}/,
function (match, attributionName) {
return attributionReplacer(providers[attributionName].options.attribution);
}
);
};
provider.options.attribution = attributionReplacer(provider.options.attribution);
// Compute final options combining provider options with any user overrides
var layerOpts = L.Util.extend({}, provider.options, options);
L.TileLayer.prototype.initialize.call(this, provider.url, layerOpts);
}
});
/**
* Definition of providers.
* see http://leafletjs.com/reference.html#tilelayer for options in the options map.
*/
//jshint maxlen:220
L.TileLayer.Provider.providers = {
OpenStreetMap: {
url: 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
options: {
attribution:
'&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
},
variants: {
Mapnik: {},
BlackAndWhite: {
url: 'http://{s}.tiles.wmflabs.org/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 <a href="http://hot.openstreetmap.org/" target="_blank">Humanitarian OpenStreetMap Team</a>'
}
}
}
},
OpenSeaMap: {
url: 'http://tiles.openseamap.org/seamark/{z}/{x}/{y}.png',
options: {
attribution: 'Map data: &copy; <a href="http://www.openseamap.org">OpenSeaMap</a> contributors'
}
},
Thunderforest: {
url: 'http://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png',
options: {
attribution:
'&copy; <a href="http://www.opencyclemap.org">OpenCycleMap</a>, {attribution.OpenStreetMap}',
variant: 'cycle'
},
variants: {
OpenCycleMap: 'cycle',
Transport: 'transport',
Landscape: 'landscape',
Outdoors: 'outdoors'
}
},
OpenMapSurfer: {
url: 'http://openmapsurfer.uni-hd.de/tiles/{variant}/x={x}&y={y}&z={z}',
options: {
minZoom: 0,
maxZoom: 20,
variant: 'roads',
attribution: 'Imagery from <a href="http://giscience.uni-hd.de/">GIScience Research Group @ University of Heidelberg</a> &mdash; Map data {attribution.OpenStreetMap}'
},
variants: {
Roads: 'roads',
AdminBounds: {
options: {
variant: 'adminb',
maxZoom: 19
}
},
Grayscale: {
options: {
variant: 'roadsg',
maxZoom: 19
}
}
}
},
Hydda: {
url: 'http://{s}.tile.openstreetmap.se/hydda/{variant}/{z}/{x}/{y}.png',
options: {
minZoom: 0,
maxZoom: 18,
variant: 'full',
attribution: 'Tiles courtesy of <a href="http://openstreetmap.se/" target="_blank">OpenStreetMap Sweden</a> &mdash; Map data {attribution.OpenStreetMap}'
},
variants: {
Full: 'full',
Base: 'base',
RoadsAndLabels: 'roads_and_labels',
}
},
MapQuestOpen: {
url: 'http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpeg',
options: {
attribution:
'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> &mdash; ' +
'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 <a href="http://www.mapquest.com/">MapQuest</a> &mdash; ' +
'Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency'
}
}
}
},
MapBox: {
url: function (id) {
return 'http://{s}.tiles.mapbox.com/v3/' + id + '/{z}/{x}/{y}.png';
},
options: {
attribution:
'Imagery from <a href="http://mapbox.com/about/maps/">MapBox</a> &mdash; ' +
'Map data {attribution.OpenStreetMap}',
subdomains: 'abcd'
}
},
Stamen: {
url: 'http://{s}.tile.stamen.com/{variant}/{z}/{x}/{y}.png',
options: {
attribution:
'Map tiles by <a href="http://stamen.com">Stamen Design</a>, ' +
'<a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> &mdash; ' +
'Map data {attribution.OpenStreetMap}',
subdomains: 'abcd',
minZoom: 0,
maxZoom: 20,
variant: 'toner'
},
variants: {
Toner: 'toner',
TonerBackground: 'toner-background',
TonerHybrid: 'toner-hybrid',
TonerLines: 'toner-lines',
TonerLabels: 'toner-labels',
TonerLite: 'toner-lite',
Terrain: {
options: {
variant: 'terrain',
minZoom: 4,
maxZoom: 18
}
},
TerrainBackground: {
options: {
variant: 'terrain-background',
minZoom: 4,
maxZoom: 18
}
},
Watercolor: {
options: {
variant: 'watercolor',
minZoom: 1,
maxZoom: 16
}
}
}
},
Esri: {
url: 'http://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}',
options: {
variant: 'World_Street_Map',
attribution: 'Tiles &copy; Esri'
},
variants: {
WorldStreetMap: {
options: {
attribution:
'{attribution.Esri} &mdash; ' +
'Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012'
}
},
DeLorme: {
options: {
variant: 'Specialty/DeLorme_World_Base_Map',
minZoom: 1,
maxZoom: 11,
attribution: '{attribution.Esri} &mdash; Copyright: &copy;2012 DeLorme'
}
},
WorldTopoMap: {
options: {
variant: 'World_Topo_Map',
attribution:
'{attribution.Esri} &mdash; ' +
'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: {
options: {
variant: 'World_Imagery',
attribution:
'{attribution.Esri} &mdash; ' +
'Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'
}
},
WorldTerrain: {
options: {
variant: 'World_Terrain_Base',
maxZoom: 13,
attribution:
'{attribution.Esri} &mdash; ' +
'Source: USGS, Esri, TANA, DeLorme, and NPS'
}
},
WorldShadedRelief: {
options: {
variant: 'World_Shaded_Relief',
maxZoom: 13,
attribution: '{attribution.Esri} &mdash; Source: Esri'
}
},
WorldPhysical: {
options: {
variant: 'World_Physical_Map',
maxZoom: 8,
attribution: '{attribution.Esri} &mdash; Source: US National Park Service'
}
},
OceanBasemap: {
options: {
variant: 'Ocean_Basemap',
maxZoom: 13,
attribution: '{attribution.Esri} &mdash; Sources: GEBCO, NOAA, CHS, OSU, UNH, CSUMB, National Geographic, DeLorme, NAVTEQ, and Esri'
}
},
NatGeoWorldMap: {
options: {
variant: 'NatGeo_World_Map',
maxZoom: 16,
attribution: '{attribution.Esri} &mdash; National Geographic, Esri, DeLorme, NAVTEQ, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, iPC'
}
},
WorldGrayCanvas: {
options: {
variant: 'Canvas/World_Light_Gray_Base',
maxZoom: 16,
attribution: '{attribution.Esri} &mdash; Esri, DeLorme, NAVTEQ'
}
}
}
},
OpenWeatherMap: {
url: 'http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png',
options: {
attribution: 'Map data &copy; <a href="http://openweathermap.org">OpenWeatherMap</a>',
opacity: 0.5
},
variants: {
Clouds: 'clouds',
CloudsClassic: 'clouds_cls',
Precipitation: 'precipitation',
PrecipitationClassic: 'precipitation_cls',
Rain: 'rain',
RainClassic: 'rain_cls',
Pressure: 'pressure',
PressureContour: 'pressure_cntr',
Wind: 'wind',
Temperature: 'temp',
Snow: 'snow'
}
},
HERE: {
/*
* HERE maps, formerly Nokia maps.
* These basemaps are free, but you need an API key. Please sign up at
* http://developer.here.com/getting-started
*
* Note that the base urls contain '.cit' whichs is HERE's
* 'Customer Integration Testing' environment. Please remove for production
* envirionments.
*/
url:
'http://{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}',
options: {
attribution:
'Map &copy; 1987-2014 <a href="http://developer.here.com">HERE</a>',
subdomains: '1234',
mapID: 'newest',
'app_id': '<insert your app_id here>',
'app_code': '<insert your app_code here>',
base: 'base',
variant: 'normal.day',
minZoom: 0,
maxZoom: 20
},
variants: {
normalDay: 'normal.day',
normalDayCustom: 'normal.day.custom',
normalDayGrey: 'normal.day.grey',
normalDayMobile: 'normal.day.mobile',
normalDayGreyMobile: 'normal.day.grey.mobile',
normalDayTransit: 'normal.day.transit',
normalDayTransitMobile: 'normal.day.transit.mobile',
normalNight: 'normal.night',
normalNightMobile: 'normal.night.mobile',
normalNightGrey: 'normal.night.grey',
normalNightGreyMobile: 'normal.night.grey.mobile',
carnavDayGrey: 'carnav.day.grey',
hybridDay: {
options: {
base: 'aerial',
variant: 'hybrid.day'
}
},
hybridDayMobile: {
options: {
base: 'aerial',
variant: 'hybrid.day.mobile'
}
},
pedestrianDay: 'pedestrian.day',
pedestrianNight: 'pedestrian.night',
satelliteDay: {
options: {
base: 'aerial',
variant: 'satellite.day'
}
},
terrainDay: {
options: {
base: 'aerial',
variant: 'terrain.day'
}
},
terrainDayMobile: {
options: {
base: 'aerial',
variant: 'terrain.day.mobile'
}
}
}
},
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://{s}.freemap.sk/T/{z}/{x}/{y}.jpeg',
options: {
minZoom: 8,
maxZoom: 16,
subdomains: ['t1', 't2', 't3', 't4'],
attribution:
'{attribution.OpenStreetMap}, vizualization CC-By-SA 2.0 <a href="http://freemap.sk">Freemap.sk</a>'
}
},
MtbMap: {
url: 'http://tile.mtbmap.cz/mtbmap_tiles/{z}/{x}/{y}.png',
options: {
attribution:
'{attribution.OpenStreetMap} &amp; USGS'
}
},
CartoDB: {
url: 'http://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}.png',
options: {
attribution: '{attribution.OpenStreetMap} &copy; <a href="http://cartodb.com/attributions">CartoDB</a>',
subdomains: 'abcd',
minZoom: 0,
maxZoom: 18,
variant: 'light_all'
},
variants: {
Positron: 'light_all',
PositronNoLabels: 'light_nolabels',
DarkMatter: 'dark_all',
DarkMatterNoLabels: 'dark_nolabels'
}
}
};
L.tileLayer.provider = function (provider, options) {
return new L.TileLayer.Provider(provider, options);
};
}());

View File

@@ -1,9 +0,0 @@
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

@@ -1,24 +0,0 @@
{
"name": "leaflet-providers",
"version": "1.0.12",
"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": {
"test": "jshint leaflet-providers.js preview/*.js",
"min": "uglifyjs leaflet-providers.js -mc -o leaflet-providers.min.js",
"release": "mversion patch -m"
},
"license": "BSD-2-Clause",
"bugs": {
"url": "https://github.com/leaflet-extras/leaflet-providers/issues"
},
"devDependencies": {
"jshint": "~2.1.11",
"mversion": "^1.3.0",
"uglify-js": "^2.4.15"
}
}

View File

@@ -1,21 +0,0 @@
The MIT License
Copyright (c) 2011-2014 Felix Gnass [fgnass at neteye dot de]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -1,2 +0,0 @@
//fgnass.github.com/spin.js#v2.0.1
!function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Spinner=b()}(this,function(){"use strict";function a(a,b){var c,d=document.createElement(a||"div");for(c in b)d[c]=b[c];return d}function b(a){for(var b=1,c=arguments.length;c>b;b++)a.appendChild(arguments[b]);return a}function c(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-"),f=.01+c/d*100,g=Math.max(1-(1-a)/b*(100-f),a),h=j.substring(0,j.indexOf("Animation")).toLowerCase(),i=h&&"-"+h+"-"||"";return l[e]||(m.insertRule("@"+i+"keyframes "+e+"{0%{opacity:"+g+"}"+f+"%{opacity:"+a+"}"+(f+.01)+"%{opacity:1}"+(f+b)%100+"%{opacity:"+a+"}100%{opacity:"+g+"}}",m.cssRules.length),l[e]=1),e}function d(a,b){var c,d,e=a.style;for(b=b.charAt(0).toUpperCase()+b.slice(1),d=0;d<k.length;d++)if(c=k[d]+b,void 0!==e[c])return c;return void 0!==e[b]?b:void 0}function e(a,b){for(var c in b)a.style[d(a,c)||c]=b[c];return a}function f(a){for(var b=1;b<arguments.length;b++){var c=arguments[b];for(var d in c)void 0===a[d]&&(a[d]=c[d])}return a}function g(a,b){return"string"==typeof a?a:a[b%a.length]}function h(a){this.opts=f(a||{},h.defaults,n)}function i(){function c(b,c){return a("<"+b+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',c)}m.addRule(".spin-vml","behavior:url(#default#VML)"),h.prototype.lines=function(a,d){function f(){return e(c("group",{coordsize:k+" "+k,coordorigin:-j+" "+-j}),{width:k,height:k})}function h(a,h,i){b(m,b(e(f(),{rotation:360/d.lines*a+"deg",left:~~h}),b(e(c("roundrect",{arcsize:d.corners}),{width:j,height:d.width,left:d.radius,top:-d.width>>1,filter:i}),c("fill",{color:g(d.color,a),opacity:d.opacity}),c("stroke",{opacity:0}))))}var i,j=d.length+d.width,k=2*j,l=2*-(d.width+d.length)+"px",m=e(f(),{position:"absolute",top:l,left:l});if(d.shadow)for(i=1;i<=d.lines;i++)h(i,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(i=1;i<=d.lines;i++)h(i);return b(a,m)},h.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d<e.childNodes.length&&(e=e.childNodes[b+d],e=e&&e.firstChild,e=e&&e.firstChild,e&&(e.opacity=c))}}var j,k=["webkit","Moz","ms","O"],l={},m=function(){var c=a("style",{type:"text/css"});return b(document.getElementsByTagName("head")[0],c),c.sheet||c.styleSheet}(),n={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"50%",left:"50%",position:"absolute"};h.defaults={},f(h.prototype,{spin:function(b){this.stop();{var c=this,d=c.opts,f=c.el=e(a(0,{className:d.className}),{position:d.position,width:0,zIndex:d.zIndex});d.radius+d.length+d.width}if(e(f,{left:d.left,top:d.top}),b&&b.insertBefore(f,b.firstChild||null),f.setAttribute("role","progressbar"),c.lines(f,c.opts),!j){var g,h=0,i=(d.lines-1)*(1-d.direction)/2,k=d.fps,l=k/d.speed,m=(1-d.opacity)/(l*d.trail/100),n=l/d.lines;!function o(){h++;for(var a=0;a<d.lines;a++)g=Math.max(1-(h+(d.lines-a)*n)%l*m,d.opacity),c.opacity(f,a*d.direction+i,g,d);c.timeout=c.el&&setTimeout(o,~~(1e3/k))}()}return c},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=void 0),this},lines:function(d,f){function h(b,c){return e(a(),{position:"absolute",width:f.length+f.width+"px",height:f.width+"px",background:b,boxShadow:c,transformOrigin:"left",transform:"rotate("+~~(360/f.lines*k+f.rotate)+"deg) translate("+f.radius+"px,0)",borderRadius:(f.corners*f.width>>1)+"px"})}for(var i,k=0,l=(f.lines-1)*(1-f.direction)/2;k<f.lines;k++)i=e(a(),{position:"absolute",top:1+~(f.width/2)+"px",transform:f.hwaccel?"translate3d(0,0,0)":"",opacity:f.opacity,animation:j&&c(f.opacity,f.trail,l+k*f.direction,f.lines)+" "+1/f.speed+"s linear infinite"}),f.shadow&&b(i,e(h("#000","0 0 4px #000"),{top:"2px"})),b(d,b(i,h(g(f.color,k),"0 0 1px rgba(0,0,0,.1)")));return d},opacity:function(a,b,c){b<a.childNodes.length&&(a.childNodes[b].style.opacity=c)}});var o=e(a("group"),{behavior:"url(#default#VML)"});return!d(o,"transform")&&o.adj?i():j=d(o,"animation"),h});

View File

@@ -23,6 +23,7 @@
"contao-community-alliance/dependency-container":"~1.0",
"contao-community-alliance/event-dispatcher":"~1.0",
"contao-community-alliance/url-builder":"~1.1",
"netzmacht/contao-leaflet-libraries": "~0.7",
"netzmacht/php-javascript-builder": "~1.0",
"netzmacht/php-leaflet": "dev-master",
"netzmacht/contao-dev-tools":"~1.0",
@@ -50,7 +51,8 @@
"contao": {
"sources":{
"module": "system/modules/leaflet",
"assets": "assets/leaflet"
"assets/maps": "assets/leaflet/maps",
"assets/js": "assets/leaflet/js"
},
"transifex": {
"project": "contao-leaflet-maps",

View File

@@ -245,3 +245,19 @@ $GLOBALS['LEAFLET_VECTORS'] = array
* Leaflet tile layer providers.
*/
require_once TL_ROOT . '/system/modules/leaflet/config/leaflet_providers.php';
/*
* Leaflet assets.
*
* The leaflet definition are aware of the required javascript libraries. Register the assets so that they are
* loaded automatically.
*
* Each entry is an array of 2 values. The first is the resource. The second is a type. Supported types are:
* - url: An valid url.
* - file: An file path relative to the Contao Root.
* - source: Inline css/javascript.
*
* You don't have to define it as array if you simply add a file. Do not add |static and or media type flag to it.
* It's getting added by default if not being in debug mode.
*/
$GLOBALS['LEAFLET_LIBRARIES'] = array();