diff --git a/README.md b/README.md index 05095bb..ebcdc47 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ This package contains following packages: - [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.16](https://github.com/ebrelsford/Leaflet.loading) - - [Leaflet.Control.FullScreen 1.1.4](https://github.com/brunob/leaflet.fullscreen) + - [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) diff --git a/assets/leaflet-fullscreen/Control.FullScreen.css b/assets/leaflet-fullscreen/Control.FullScreen.css index c93b1bf..9d429b6 100644 --- a/assets/leaflet-fullscreen/Control.FullScreen.css +++ b/assets/leaflet-fullscreen/Control.FullScreen.css @@ -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; } \ No newline at end of file diff --git a/assets/leaflet-fullscreen/Control.FullScreen.js b/assets/leaflet-fullscreen/Control.FullScreen.js index f1cd7cc..561869a 100644 --- a/assets/leaflet-fullscreen/Control.FullScreen.js +++ b/assets/leaflet-fullscreen/Control.FullScreen.js @@ -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) { diff --git a/assets/leaflet-fullscreen/Control.FullScreen.min.css b/assets/leaflet-fullscreen/Control.FullScreen.min.css index 1df1ecf..7981977 100644 --- a/assets/leaflet-fullscreen/Control.FullScreen.min.css +++ b/assets/leaflet-fullscreen/Control.FullScreen.min.css @@ -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} \ No newline at end of file +.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} \ No newline at end of file diff --git a/assets/leaflet-fullscreen/Control.FullScreen.min.js b/assets/leaflet-fullscreen/Control.FullScreen.min.js index a2a74b1..28c840d 100644 --- a/assets/leaflet-fullscreen/Control.FullScreen.min.js +++ b/assets/leaflet-fullscreen/Control.FullScreen.min.js @@ -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}(); \ No newline at end of file +!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}(); \ No newline at end of file diff --git a/assets/leaflet-fullscreen/LICENSE b/assets/leaflet-fullscreen/LICENSE index 07ddddc..72f7e14 100644 --- a/assets/leaflet-fullscreen/LICENSE +++ b/assets/leaflet-fullscreen/LICENSE @@ -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. diff --git a/assets/leaflet-fullscreen/README.md b/assets/leaflet-fullscreen/README.md index a111801..3a04c56 100644 --- a/assets/leaflet-fullscreen/README.md +++ b/assets/leaflet-fullscreen/README.md @@ -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); diff --git a/assets/leaflet-fullscreen/bower.json b/assets/leaflet-fullscreen/bower.json index 6de9eee..1c297ab 100644 --- a/assets/leaflet-fullscreen/bower.json +++ b/assets/leaflet-fullscreen/bower.json @@ -1,6 +1,6 @@ { "name": "leaflet.fullscreen", - "version": "1.1.4", + "version": "1.3.0", "homepage": "https://github.com/brunob/leaflet.fullscreen", "authors": [ "brunob " diff --git a/assets/leaflet-fullscreen/index.html b/assets/leaflet-fullscreen/index.html index 87b345c..6ce37c7 100644 --- a/assets/leaflet-fullscreen/index.html +++ b/assets/leaflet-fullscreen/index.html @@ -3,17 +3,17 @@ Leaflet.Control.FullScreen Demo - + - + @@ -21,9 +21,10 @@