Compare commits

..

4 Commits
0.7.5 ... 0.7.7

Author SHA1 Message Date
David Molineus
0c35742117 Update to leaflet.fullscreen 1.3.0. 2015-10-30 23:48:21 +01:00
David Molineus
a5cfd435fe Fix version. 2015-10-30 23:44:11 +01:00
David Molineus
461ac3544c Update to leaflet 0.7.7. 2015-10-30 23:43:00 +01:00
David Molineus
b49da13abe Update leaflet providers to version 1.1.5. 2015-10-30 23:40:15 +01:00
22 changed files with 236 additions and 89 deletions

View File

@@ -12,12 +12,12 @@ Contao CMS.
This package contains following packages:
- [leaflet 0.7.5](http://leafletjs.com)
- [Leaflet-providers 1.0.12](http://leaflet-extras.github.io/leaflet-providers)
- [leaflet 0.7.7](http://leafletjs.com)
- [Leaflet-providers 1.1.5](http://leaflet-extras.github.io/leaflet-providers)
- [Leaflet.markercluster 0.4.0](https://github.com/Leaflet/Leaflet.markercluster)
- [Leaflet-omnivore 0.3.2](https://github.com/mapbox/leaflet-omnivore)
- [Leaflet.loading 0.1.15](https://github.com/ebrelsford/Leaflet.loading)
- [Leaflet.Control.FullScreen 1.1.4](https://github.com/brunob/leaflet.fullscreen)
- [Leaflet.loading 0.1.16](https://github.com/ebrelsford/Leaflet.loading)
- [Leaflet.Control.FullScreen 1.3.0](https://github.com/brunob/leaflet.fullscreen)
- [Leaflet Control Geocoder 1.0.0](https://github.com/perliedman/leaflet-control-geocoder)
- [spin.js 2.0.2](http://fgnass.github.io/spin.js)

View File

@@ -1,4 +1,4 @@
.leaflet-control-zoom-fullscreen { background-image: url(icon-fullscreen.png); }
.leaflet-retina .leaflet-control-zoom-fullscreen { background-image: url(icon-fullscreen-2x.png); background-size: 26px 26px; }
.fullscreen-icon { background-image: url(icon-fullscreen.png); }
.leaflet-retina .fullscreen-icon { background-image: url(icon-fullscreen-2x.png); background-size: 26px 26px; }
.leaflet-container:-webkit-full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
.leaflet-pseudo-fullscreen { position: fixed !important; width: 100% !important; height: 100% !important; top: 0px !important; left: 0px !important; z-index: 99999; }

View File

@@ -4,12 +4,13 @@ L.Control.FullScreen = L.Control.extend({
options: {
position: 'topleft',
title: 'Full Screen',
titleCancel: 'Exit Full Screen',
forceSeparateButton: false,
forcePseudoFullscreen: false
},
onAdd: function (map) {
var className = 'leaflet-control-zoom-fullscreen', container;
var className = 'leaflet-control-zoom-fullscreen', container, content = '';
if (map.zoomControl && !this.options.forceSeparateButton) {
container = map.zoomControl._container;
@@ -17,20 +18,29 @@ L.Control.FullScreen = L.Control.extend({
container = L.DomUtil.create('div', 'leaflet-bar');
}
this._createButton(this.options.title, className, container, this.toggleFullScreen, this);
if (this.options.content) {
content = this.options.content;
} else {
className += ' fullscreen-icon';
}
this._createButton(this.options.title, className, content, container, this.toggleFullScreen, this);
this._map.on('enterFullscreen exitFullscreen', this._toggleTitle, this);
return container;
},
_createButton: function (title, className, container, fn, context) {
var link = L.DomUtil.create('a', className, container);
link.href = '#';
link.title = title;
_createButton: function (title, className, content, container, fn, context) {
this.link = L.DomUtil.create('a', className, container);
this.link.href = '#';
this.link.title = title;
this.link.innerHTML = content;
L.DomEvent
.addListener(link, 'click', L.DomEvent.stopPropagation)
.addListener(link, 'click', L.DomEvent.preventDefault)
.addListener(link, 'click', fn, context);
.addListener(this.link, 'click', L.DomEvent.stopPropagation)
.addListener(this.link, 'click', L.DomEvent.preventDefault)
.addListener(this.link, 'click', fn, context);
L.DomEvent
.addListener(container, fullScreenApi.fullScreenEventName, L.DomEvent.stopPropagation)
@@ -42,7 +52,7 @@ L.Control.FullScreen = L.Control.extend({
.addListener(document, fullScreenApi.fullScreenEventName, L.DomEvent.preventDefault)
.addListener(document, fullScreenApi.fullScreenEventName, this._handleEscKey, context);
return link;
return this.link;
},
toggleFullScreen: function () {
@@ -71,6 +81,10 @@ L.Control.FullScreen = L.Control.extend({
}
},
_toggleTitle: function() {
this.link.title = this._map._isFullscreen ? this.options.title : this.options.titleCancel;
},
_handleEscKey: function () {
var map = this._map;
if (!fullScreenApi.isFullScreen(map) && !map._exitFired) {

View File

@@ -1 +1 @@
.leaflet-control-zoom-fullscreen{background-image:url('icon-fullscreen.png')}.leaflet-retina .leaflet-control-zoom-fullscreen{background-image:url('icon-fullscreen-2x.png');background-size:26px 26px}.leaflet-container:-webkit-full-screen{width:100%!important;height:100%!important;z-index:99999}.leaflet-pseudo-fullscreen{position:fixed!important;width:100%!important;height:100%!important;top:0!important;left:0!important;z-index:99999}
.fullscreen-icon{background-image:url('icon-fullscreen.png')}.leaflet-retina .fullscreen-icon{background-image:url('icon-fullscreen-2x.png');background-size:26px 26px}.leaflet-container:-webkit-full-screen{width:100%!important;height:100%!important;z-index:99999}.leaflet-pseudo-fullscreen{position:fixed!important;width:100%!important;height:100%!important;top:0!important;left:0!important;z-index:99999}

View File

@@ -1 +1 @@
!function(){L.Control.FullScreen=L.Control.extend({options:{position:"topleft",title:"Full Screen",forceSeparateButton:!1,forcePseudoFullscreen:!1},onAdd:function(e){var n,t="leaflet-control-zoom-fullscreen";return n=e.zoomControl&&!this.options.forceSeparateButton?e.zoomControl._container:L.DomUtil.create("div","leaflet-bar"),this._createButton(this.options.title,t,n,this.toggleFullScreen,this),n},_createButton:function(n,t,l,r,o){var u=L.DomUtil.create("a",t,l);return u.href="#",u.title=n,L.DomEvent.addListener(u,"click",L.DomEvent.stopPropagation).addListener(u,"click",L.DomEvent.preventDefault).addListener(u,"click",r,o),L.DomEvent.addListener(l,e.fullScreenEventName,L.DomEvent.stopPropagation).addListener(l,e.fullScreenEventName,L.DomEvent.preventDefault).addListener(l,e.fullScreenEventName,this._handleEscKey,o),L.DomEvent.addListener(document,e.fullScreenEventName,L.DomEvent.stopPropagation).addListener(document,e.fullScreenEventName,L.DomEvent.preventDefault).addListener(document,e.fullScreenEventName,this._handleEscKey,o),u},toggleFullScreen:function(){var n=this._map;n._exitFired=!1,n._isFullscreen?(e.supportsFullScreen&&!this.options.forcePseudoFullscreen?e.cancelFullScreen(n._container):L.DomUtil.removeClass(n._container,"leaflet-pseudo-fullscreen"),n.invalidateSize(),n.fire("exitFullscreen"),n._exitFired=!0,n._isFullscreen=!1):(e.supportsFullScreen&&!this.options.forcePseudoFullscreen?e.requestFullScreen(n._container):L.DomUtil.addClass(n._container,"leaflet-pseudo-fullscreen"),n.invalidateSize(),n.fire("enterFullscreen"),n._isFullscreen=!0)},_handleEscKey:function(){var n=this._map;e.isFullScreen(n)||n._exitFired||(n.fire("exitFullscreen"),n._exitFired=!0,n._isFullscreen=!1)}}),L.Map.addInitHook(function(){this.options.fullscreenControl&&(this.fullscreenControl=L.control.fullscreen(this.options.fullscreenControlOptions),this.addControl(this.fullscreenControl))}),L.control.fullscreen=function(e){return new L.Control.FullScreen(e)};var e={supportsFullScreen:!1,isFullScreen:function(){return!1},requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",prefix:""},n="webkit moz o ms khtml".split(" ");if("undefined"!=typeof document.exitFullscreen)e.supportsFullScreen=!0;else for(var t=0,l=n.length;l>t;t++)if(e.prefix=n[t],"undefined"!=typeof document[e.prefix+"CancelFullScreen"]){e.supportsFullScreen=!0;break}e.supportsFullScreen&&(e.fullScreenEventName=e.prefix+"fullscreenchange",e.isFullScreen=function(){switch(this.prefix){case"":return document.fullScreen;case"webkit":return document.webkitIsFullScreen;default:return document[this.prefix+"FullScreen"]}},e.requestFullScreen=function(e){return""===this.prefix?e.requestFullscreen():e[this.prefix+"RequestFullScreen"]()},e.cancelFullScreen=function(){return""===this.prefix?document.exitFullscreen():document[this.prefix+"CancelFullScreen"]()}),"undefined"!=typeof jQuery&&(jQuery.fn.requestFullScreen=function(){return this.each(function(){var n=jQuery(this);e.supportsFullScreen&&e.requestFullScreen(n)})}),window.fullScreenApi=e}();
!function(){L.Control.FullScreen=L.Control.extend({options:{position:"topleft",title:"Full Screen",titleCancel:"Exit Full Screen",forceSeparateButton:!1,forcePseudoFullscreen:!1},onAdd:function(e){var n,t="leaflet-control-zoom-fullscreen",l="";return n=e.zoomControl&&!this.options.forceSeparateButton?e.zoomControl._container:L.DomUtil.create("div","leaflet-bar"),this.options.content?l=this.options.content:t+=" fullscreen-icon",this._createButton(this.options.title,t,l,n,this.toggleFullScreen,this),this._map.on("enterFullscreen exitFullscreen",this._toggleTitle,this),n},_createButton:function(n,t,l,r,i,o){return this.link=L.DomUtil.create("a",t,r),this.link.href="#",this.link.title=n,this.link.innerHTML=l,L.DomEvent.addListener(this.link,"click",L.DomEvent.stopPropagation).addListener(this.link,"click",L.DomEvent.preventDefault).addListener(this.link,"click",i,o),L.DomEvent.addListener(r,e.fullScreenEventName,L.DomEvent.stopPropagation).addListener(r,e.fullScreenEventName,L.DomEvent.preventDefault).addListener(r,e.fullScreenEventName,this._handleEscKey,o),L.DomEvent.addListener(document,e.fullScreenEventName,L.DomEvent.stopPropagation).addListener(document,e.fullScreenEventName,L.DomEvent.preventDefault).addListener(document,e.fullScreenEventName,this._handleEscKey,o),this.link},toggleFullScreen:function(){var n=this._map;n._exitFired=!1,n._isFullscreen?(e.supportsFullScreen&&!this.options.forcePseudoFullscreen?e.cancelFullScreen(n._container):L.DomUtil.removeClass(n._container,"leaflet-pseudo-fullscreen"),n.invalidateSize(),n.fire("exitFullscreen"),n._exitFired=!0,n._isFullscreen=!1):(e.supportsFullScreen&&!this.options.forcePseudoFullscreen?e.requestFullScreen(n._container):L.DomUtil.addClass(n._container,"leaflet-pseudo-fullscreen"),n.invalidateSize(),n.fire("enterFullscreen"),n._isFullscreen=!0)},_toggleTitle:function(){this.link.title=this._map._isFullscreen?this.options.title:this.options.titleCancel},_handleEscKey:function(){var n=this._map;e.isFullScreen(n)||n._exitFired||(n.fire("exitFullscreen"),n._exitFired=!0,n._isFullscreen=!1)}}),L.Map.addInitHook(function(){this.options.fullscreenControl&&(this.fullscreenControl=L.control.fullscreen(this.options.fullscreenControlOptions),this.addControl(this.fullscreenControl))}),L.control.fullscreen=function(e){return new L.Control.FullScreen(e)};var e={supportsFullScreen:!1,isFullScreen:function(){return!1},requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",prefix:""},n="webkit moz o ms khtml".split(" ");if("undefined"!=typeof document.exitFullscreen)e.supportsFullScreen=!0;else for(var t=0,l=n.length;l>t;t++)if(e.prefix=n[t],"undefined"!=typeof document[e.prefix+"CancelFullScreen"]){e.supportsFullScreen=!0;break}e.supportsFullScreen&&(e.fullScreenEventName=e.prefix+"fullscreenchange",e.isFullScreen=function(){switch(this.prefix){case"":return document.fullScreen;case"webkit":return document.webkitIsFullScreen;default:return document[this.prefix+"FullScreen"]}},e.requestFullScreen=function(e){return""===this.prefix?e.requestFullscreen():e[this.prefix+"RequestFullScreen"]()},e.cancelFullScreen=function(){return""===this.prefix?document.exitFullscreen():document[this.prefix+"CancelFullScreen"]()}),"undefined"!=typeof jQuery&&(jQuery.fn.requestFullScreen=function(){return this.each(function(){var n=jQuery(this);e.supportsFullScreen&&e.requestFullScreen(n)})}),window.fullScreenApi=e}();

View File

@@ -1,22 +1,19 @@
Copyright (c) 2013, Bruno Bergot
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:
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:
1. Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
2. 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.
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

@@ -44,6 +44,8 @@ __Events and options__:
L.control.fullscreen({
position: 'topleft', // change the position of the button can be topleft, topright, bottomright or bottomleft, defaut topleft
title: 'Show me the fullscreen !', // change the title of the button, default Full Screen
titleCancel: 'Exit fullscreen mode' // change the title of the button when fullscreen is on, default Exit Full Screen
content: null // change the content of the button, can be HTML, default null
forceSeparateButton: true, // force seperate button to detach from zoom buttons, default false
forcePseudoFullscreen: true // force use of pseudo full screen even if full screen API is available, default false
}).addTo(map);

View File

@@ -1,6 +1,6 @@
{
"name": "leaflet.fullscreen",
"version": "1.1.4",
"version": "1.3.0",
"homepage": "https://github.com/brunob/leaflet.fullscreen",
"authors": [
"brunob <brunobergot@gmail.com>"

View File

@@ -3,17 +3,17 @@
<head>
<meta charset='utf-8'>
<title>Leaflet.Control.FullScreen Demo</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.5/leaflet.css" />
<style type="text/css">
#map { width: 700px; height: 433px; }
.leaflet-control-zoom-fullscreen { background-image: url(icon-fullscreen.png); }
.fullscreen-icon { background-image: url(icon-fullscreen.png); }
/* on selector per rule as explained here : http://www.sitepoint.com/html5-full-screen-api/ */
#map:-webkit-full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
#map:-moz-full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
#map:full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
.leaflet-pseudo-fullscreen { position: fixed !important; width: 100% !important; height: 100% !important; top: 0px !important; left: 0px !important; z-index: 99999; }
</style>
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.7.5/leaflet.js"></script>
<script src="Control.FullScreen.js"></script>
</head>
<body>
@@ -21,9 +21,10 @@
<div id="map"></div>
<script>
var base = new L.TileLayer('http://{s}.www.toolserver.org/tiles/bw-mapnik/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: '&copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'
var base = new L.TileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
maxZoom: 19,
subdomains: 'abcd',
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> &copy; <a href="http://cartodb.com/attributions">CartoDB</a>'
});
var map = new L.Map('map', {
@@ -32,7 +33,8 @@
zoom: 5,
fullscreenControl: true,
fullscreenControlOptions: { // optional
title:"Show me the fullscreen !"
title:"Show me the fullscreen !",
titleCancel:"Exit fullscreen mode"
}
});

View File

@@ -1,6 +1,6 @@
{
"name": "leaflet.fullscreen",
"version": "1.1.4",
"version": "1.3.0",
"description": "Simple plugin for Leaflet that adds fullscreen button to your maps.",
"main": "Control.FullScreen.js",
"scripts": {

View 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.

View File

@@ -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

View File

@@ -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": {

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="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'),

View File

@@ -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> &mdash; ' +
@@ -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

View File

@@ -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",

View File

@@ -7,7 +7,7 @@
var oldL = window.L,
L = {};
L.version = '0.7.5';
L.version = '0.7.7';
// define Leaflet for Node module pattern loaders, including Browserify
if (typeof module === 'object' && typeof module.exports === 'object') {
@@ -520,7 +520,7 @@ L.Mixin.Events.fire = L.Mixin.Events.fireEvent;
mobile = typeof orientation !== undefined + '',
msPointer = !window.PointerEvent && window.MSPointerEvent,
pointer = (window.PointerEvent && window.navigator.pointerEnabled && window.navigator.maxTouchPoints) ||
pointer = (window.PointerEvent && window.navigator.pointerEnabled) ||
msPointer,
retina = ('devicePixelRatio' in window && window.devicePixelRatio > 1) ||
('matchMedia' in window && window.matchMedia('(min-resolution:144dpi)') &&
@@ -4389,7 +4389,9 @@ L.FeatureGroup = L.LayerGroup.extend({
layer = this._layers[layer];
}
layer.off(L.FeatureGroup.EVENTS, this._propagateEvent, this);
if ('off' in layer) {
layer.off(L.FeatureGroup.EVENTS, this._propagateEvent, this);
}
L.LayerGroup.prototype.removeLayer.call(this, layer);
@@ -4709,7 +4711,7 @@ L.Path = L.Path.extend({
},
_fireMouseEvent: function (e) {
if (!this.hasEventListeners(e.type)) { return; }
if (!this._map || !this.hasEventListeners(e.type)) { return; }
var map = this._map,
containerPoint = map.mouseEventToContainerPoint(e),
@@ -7167,8 +7169,9 @@ L.extend(L.DomEvent, {
pointers = this._pointers;
var cb = function (e) {
L.DomEvent.preventDefault(e);
if (e.pointerType !== 'mouse' && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) {
L.DomEvent.preventDefault(e);
}
var alreadyInArray = false;
for (var i = 0; i < pointers.length; i++) {
@@ -8939,11 +8942,13 @@ L.Map.include(!L.DomUtil.TRANSITION ? {} : {
L.DomUtil.removeClass(this._mapPane, 'leaflet-zoom-anim');
this._resetView(this._animateToCenter, this._animateToZoom, true, true);
L.Util.requestAnimFrame(function () {
this._resetView(this._animateToCenter, this._animateToZoom, true, true);
if (L.Draggable) {
L.Draggable._disabled = false;
}
if (L.Draggable) {
L.Draggable._disabled = false;
}
}, this);
}
});

View File

@@ -21,6 +21,7 @@
.leaflet-container {
overflow: hidden;
-ms-touch-action: none;
touch-action: none;
}
.leaflet-tile,
.leaflet-marker-icon,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -17,7 +17,7 @@
$GLOBALS['LEAFLET_LIBRARIES']['leaflet'] = array
(
'name' => 'Leaflet',
'version' => '0.7.5',
'version' => '0.7.7',
'license' => '<a href="https://github.com/Leaflet/Leaflet/blob/master/LICENSE" target="_blank">BSD-2-Clause</a>',
'homepage' => 'http://leafletjs.com',
'css' => 'assets/leaflet/libs/leaflet/leaflet.min.css',
@@ -27,7 +27,7 @@ $GLOBALS['LEAFLET_LIBRARIES']['leaflet'] = array
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-providers'] = array
(
'name' => 'Leaflet-providers',
'version' => '1.1.0',
'version' => '1.1.5',
'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'
@@ -65,7 +65,7 @@ $GLOBALS['LEAFLET_LIBRARIES']['leaflet-loading'] = array
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-fullscreen'] = array
(
'name' => 'Leaflet.Control.FullScreen',
'version' => '1.1.4',
'version' => '1.3.0',
'license' => '<a href="https://github.com/brunob/leaflet.fullscreen/blob/master/LICENSE" target="_blank">MIT</a>',
'homepage' => 'https://github.com/brunob/leaflet.fullscreen',
'css' => 'assets/leaflet/libs/leaflet-fullscreen/Control.FullScreen.min.css',