diff --git a/assets/control-geocoder/Control.Geocoder.min.css b/assets/control-geocoder/Control.Geocoder.min.css new file mode 100644 index 0000000..50b0cef --- /dev/null +++ b/assets/control-geocoder/Control.Geocoder.min.css @@ -0,0 +1 @@ +.leaflet-control-geocoder{background:#fff;box-shadow:0 1px 7px rgba(0,0,0,.65);-webkit-border-radius:4px;border-radius:4px;line-height:26px;overflow:hidden}.leaflet-touch .leaflet-control-geocoder{box-shadow:none;border:2px solid rgba(0,0,0,.2);background-clip:padding-box;line-height:30px}.leaflet-control-geocoder-form{display:inline}.leaflet-control-geocoder-error,.leaflet-control-geocoder-form input,.leaflet-control-geocoder-form ul{border:0;color:transparent;background:#fff}.leaflet-control-geocoder-form input{font-size:16px;width:0;transition:width .125s ease-in}.leaflet-touch .leaflet-control-geocoder-form input{font-size:22px}.leaflet-control-geocoder-icon{width:26px;height:26px;background-image:url('images/geocoder.png');background-repeat:no-repeat;background-position:center;float:right;cursor:pointer}.leaflet-touch .leaflet-control-geocoder-icon{margin-top:2px;width:30px}.leaflet-control-geocoder-throbber .leaflet-control-geocoder-icon{background-image:url('images/throbber.gif')}.leaflet-control-geocoder-error,.leaflet-control-geocoder-expanded input{width:226px;margin:0 0 0 4px;padding:0 0 0 4px;vertical-align:middle;color:#000}.leaflet-control-geocoder-form input:focus{outline:0}.leaflet-control-geocoder-form button,.leaflet-control-geocoder-form-no-error{display:none}.leaflet-control-geocoder-error{margin-top:8px;display:block;color:#444}ul.leaflet-control-geocoder-alternatives{width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;list-style:none;padding:0;transition:height .125s ease-in}.leaflet-control-geocoder-alternatives-minimized{width:0!important;height:0;overflow:hidden;margin:0;padding:0}.leaflet-control-geocoder-alternatives li{width:100%;overflow:hidden;text-overflow:ellipsis;border-bottom:1px solid #eee;padding:0}.leaflet-control-geocoder-alternatives li:last-child{border-bottom:none}.leaflet-control-geocoder-alternatives a{display:block;text-decoration:none;color:#000;padding:6px 8px 16px 6px;font-size:14px;line-height:1;font-weight:700}.leaflet-touch .leaflet-control-geocoder-alternatives a{font-size:18px}.leaflet-control-geocoder-alternatives a:hover,.leaflet-control-geocoder-selected{background-color:#ddd}.leaflet-control-geocoder-address-detail{font-size:12px;font-weight:400}.leaflet-control-geocoder-address-context{color:#666;font-size:12px;font-weight:lighter} \ No newline at end of file diff --git a/assets/control-geocoder/Control.Geocoder.min.js b/assets/control-geocoder/Control.Geocoder.min.js new file mode 100644 index 0000000..bc70cfe --- /dev/null +++ b/assets/control-geocoder/Control.Geocoder.min.js @@ -0,0 +1 @@ +!function(e){var t;if("function"==typeof define&&define.amd)define(["leaflet"],e);else if("undefined"!=typeof module)t=require("leaflet"),module.exports=e(t);else{if("undefined"==typeof window.L)throw"Leaflet must be loaded first";e(window.L)}}(function(e){"use strict";return e.Control.Geocoder=e.Control.extend({options:{showResultIcons:!1,collapsed:!0,expand:"click",position:"topright",placeholder:"Search...",errorMessage:"Nothing found."},_callbackId:0,initialize:function(t){e.Util.setOptions(this,t),this.options.geocoder||(this.options.geocoder=new e.Control.Geocoder.Nominatim)},onAdd:function(t){var o,n="leaflet-control-geocoder",r=e.DomUtil.create("div",n),s=e.DomUtil.create("div","leaflet-control-geocoder-icon",r),i=this._form=e.DomUtil.create("form",n+"-form",r);return this._map=t,this._container=r,o=this._input=e.DomUtil.create("input"),o.type="text",o.placeholder=this.options.placeholder,e.DomEvent.addListener(o,"keydown",this._keydown,this),this._errorElement=document.createElement("div"),this._errorElement.className=n+"-form-no-error",this._errorElement.innerHTML=this.options.errorMessage,this._alts=e.DomUtil.create("ul",n+"-alternatives leaflet-control-geocoder-alternatives-minimized"),i.appendChild(o),i.appendChild(this._errorElement),r.appendChild(this._alts),e.DomEvent.addListener(i,"submit",this._geocode,this),this.options.collapsed?"click"===this.options.expand?e.DomEvent.addListener(s,"click",function(e){0===e.button&&2!==e.detail&&this._toggle()},this):(e.DomEvent.addListener(s,"mouseover",this._expand,this),e.DomEvent.addListener(s,"mouseout",this._collapse,this),this._map.on("movestart",this._collapse,this)):this._expand(),e.DomEvent.disableClickPropagation(r),r},_geocodeResult:function(t){if(e.DomUtil.removeClass(this._container,"leaflet-control-geocoder-throbber"),1===t.length)this._geocodeResultSelected(t[0]);else if(t.length>0){this._alts.innerHTML="",this._results=t,e.DomUtil.removeClass(this._alts,"leaflet-control-geocoder-alternatives-minimized");for(var o=0;o=0?this._collapse():this._expand()},_expand:function(){e.DomUtil.addClass(this._container,"leaflet-control-geocoder-expanded"),this._input.select()},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-geocoder-expanded",""),e.DomUtil.addClass(this._alts,"leaflet-control-geocoder-alternatives-minimized"),e.DomUtil.removeClass(this._errorElement,"leaflet-control-geocoder-error")},_clearResults:function(){e.DomUtil.addClass(this._alts,"leaflet-control-geocoder-alternatives-minimized"),this._selection=null,e.DomUtil.removeClass(this._errorElement,"leaflet-control-geocoder-error")},_createAlt:function(t,o){var n=document.createElement("li"),r=e.DomUtil.create("a","",n),s=this.options.showResultIcons&&t.icon?e.DomUtil.create("img","",r):null,i=t.html?void 0:document.createTextNode(t.name);return s&&(s.src=t.icon),r.href="#",r.setAttribute("data-result-index",o),t.html?r.innerHTML=t.html:r.appendChild(i),e.DomEvent.addListener(n,"click",function(o){e.DomEvent.preventDefault(o),this._geocodeResultSelected(t)},this),n},_keydown:function(t){var o=this,n=function(t){o._selection&&(e.DomUtil.removeClass(o._selection.firstChild,"leaflet-control-geocoder-selected"),o._selection=o._selection[t>0?"nextSibling":"previousSibling"]),o._selection||(o._selection=o._alts[t>0?"firstChild":"lastChild"]),o._selection&&e.DomUtil.addClass(o._selection.firstChild,"leaflet-control-geocoder-selected")};switch(t.keyCode){case 27:this.options.collapsed&&this._collapse();break;case 38:n(-1),e.DomEvent.preventDefault(t);break;case 40:n(1),e.DomEvent.preventDefault(t);break;case 13:if(this._selection){var r=parseInt(this._selection.firstChild.getAttribute("data-result-index"),10);this._geocodeResultSelected(this._results[r]),this._clearResults(),e.DomEvent.preventDefault(t)}}return!0}}),e.Control.geocoder=function(t,o){return new e.Control.Geocoder(t,o)},e.Control.Geocoder.callbackId=0,e.Control.Geocoder.jsonp=function(t,o,n,r,s){var i="_l_geocoder_"+e.Control.Geocoder.callbackId++;o[s||"callback"]=i,window[i]=e.Util.bind(n,r);var l=document.createElement("script");l.type="text/javascript",l.src=t+e.Util.getParamString(o),l.id=i,document.getElementsByTagName("head")[0].appendChild(l)},e.Control.Geocoder.getJSON=function(t,o,n){var r=new XMLHttpRequest;r.open("GET",t+e.Util.getParamString(o),!0),r.send(null),r.onreadystatechange=function(){4==r.readyState&&(200==r.status||304==req.status)&&n(JSON.parse(r.response))}},e.Control.Geocoder.template=function(t,o){return t.replace(/\{ *([\w_]+) *\}/g,function(t,n){var r=o[n];return void 0===r?r="":"function"==typeof r&&(r=r(o)),e.Control.Geocoder.htmlEscape(r)})},e.Control.Geocoder.htmlEscape=function(){function e(e){return n[e]}var t=/[&<>"'`]/g,o=/[&<>"'`]/,n={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"};return function(n){return null==n?"":n?(n=""+n,o.test(n)?n.replace(t,e):n):n+""}}(),e.Control.Geocoder.Nominatim=e.Class.extend({options:{serviceUrl:"//nominatim.openstreetmap.org/",geocodingQueryParams:{},reverseQueryParams:{},htmlTemplate:function(t){var o=t.address,n=[];return(o.road||o.building)&&n.push("{building} {road} {house_number}"),(o.city||o.town||o.village)&&n.push('{postcode} {city}{town}{village}'),(o.state||o.country)&&n.push('{state} {country}'),e.Control.Geocoder.template(n.join("
"),o,!0)}},initialize:function(t){e.Util.setOptions(this,t)},geocode:function(t,o,n){e.Control.Geocoder.jsonp(this.options.serviceUrl+"search/",e.extend({q:t,limit:5,format:"json",addressdetails:1},this.options.geocodingQueryParams),function(t){for(var r=[],s=t.length-1;s>=0;s--){for(var i=t[s].boundingbox,l=0;4>l;l++)i[l]=parseFloat(i[l]);r[s]={icon:t[s].icon,name:t[s].display_name,html:this.options.htmlTemplate?this.options.htmlTemplate(t[s]):void 0,bbox:e.latLngBounds([i[0],i[2]],[i[1],i[3]]),center:e.latLng(t[s].lat,t[s].lon),properties:t[s]}}o.call(n,r)},this,"json_callback")},reverse:function(t,o,n,r){e.Control.Geocoder.jsonp(this.options.serviceUrl+"reverse/",e.extend({lat:t.lat,lon:t.lng,zoom:Math.round(Math.log(o/256)/Math.log(2)),addressdetails:1,format:"json"},this.options.reverseQueryParams),function(t){var o,s=[];t&&t.lat&&t.lon&&(o=e.latLng(t.lat,t.lon),s.push({name:t.display_name,html:this.options.htmlTemplate?this.options.htmlTemplate(t):void 0,center:o,bounds:e.latLngBounds(o,o),properties:t})),n.call(r,s)},this,"json_callback")}}),e.Control.Geocoder.nominatim=function(t){return new e.Control.Geocoder.Nominatim(t)},e.Control.Geocoder.Bing=e.Class.extend({initialize:function(e){this.key=e},geocode:function(t,o,n){e.Control.Geocoder.jsonp("//dev.virtualearth.net/REST/v1/Locations",{query:t,key:this.key},function(t){for(var r=[],s=t.resourceSets[0].resources.length-1;s>=0;s--){var i=t.resourceSets[0].resources[s],l=i.bbox;r[s]={name:i.name,bbox:e.latLngBounds([l[0],l[1]],[l[2],l[3]]),center:e.latLng(i.point.coordinates)}}o.call(n,r)},this,"jsonp")},reverse:function(t,o,n,r){e.Control.Geocoder.jsonp("//dev.virtualearth.net/REST/v1/Locations/"+t.lat+","+t.lng,{key:this.key},function(t){for(var o=[],s=t.resourceSets[0].resources.length-1;s>=0;s--){var i=t.resourceSets[0].resources[s],l=i.bbox;o[s]={name:i.name,bbox:e.latLngBounds([l[0],l[1]],[l[2],l[3]]),center:e.latLng(i.point.coordinates)}}n.call(r,o)},this,"jsonp")}}),e.Control.Geocoder.bing=function(t){return new e.Control.Geocoder.Bing(t)},e.Control.Geocoder.RaveGeo=e.Class.extend({options:{querySuffix:"",deepSearch:!0,wordBased:!1},jsonp:function(t,o,n){var r="_l_geocoder_"+e.Control.Geocoder.callbackId++,s=[];t.prepend=r+"(",t.append=")";for(var i in t)s.push(i+"="+escape(t[i]));window[r]=e.Util.bind(o,n);var l=document.createElement("script");l.type="text/javascript",l.src=this._serviceUrl+"?"+s.join("&"),l.id=r,document.getElementsByTagName("head")[0].appendChild(l)},initialize:function(t,o,n){e.Util.setOptions(this,n),this._serviceUrl=t,this._scheme=o},geocode:function(t,o,n){e.Control.Geocoder.jsonp(this._serviceUrl,{address:t+this.options.querySuffix,scheme:this._scheme,outputFormat:"jsonp",deepSearch:this.options.deepSearch,wordBased:this.options.wordBased},function(t){for(var r=[],s=t.length-1;s>=0;s--){var i=t[s],l=e.latLng(i.y,i.x);r[s]={name:i.address,bbox:e.latLngBounds([l]),center:l}}o.call(n,r)},this)}}),e.Control.Geocoder.raveGeo=function(t,o,n){return new e.Control.Geocoder.RaveGeo(t,o,n)},e.Control.Geocoder.MapQuest=e.Class.extend({initialize:function(e){this._key=decodeURIComponent(e)},_formatName:function(){var e,t=[];for(e=0;e=0;l--)r=t.results[0].locations[l],s=e.latLng(r.latLng),i[l]={name:this._formatName(r.street,r.adminArea4,r.adminArea3,r.adminArea1),bbox:e.latLngBounds(s,s),center:s};o.call(n,i)},this)},reverse:function(t,o,n,r){e.Control.Geocoder.jsonp("//www.mapquestapi.com/geocoding/v1/reverse",{key:this._key,location:t.lat+","+t.lng,outputFormat:"json"},function(t){var o,s,i=[];if(t.results&&t.results[0].locations)for(var l=t.results[0].locations.length-1;l>=0;l--)o=t.results[0].locations[l],s=e.latLng(o.latLng),i[l]={name:this._formatName(o.street,o.adminArea4,o.adminArea3,o.adminArea1),bbox:e.latLngBounds(s,s),center:s};n.call(r,i)},this)}}),e.Control.Geocoder.mapQuest=function(t){return new e.Control.Geocoder.MapQuest(t)},e.Control.Geocoder.Mapbox=e.Class.extend({options:{service_url:"https://api.tiles.mapbox.com/v4/geocode/mapbox.places-v1/"},initialize:function(e){this._access_token=e},geocode:function(t,o,n){e.Control.Geocoder.getJSON(this.options.service_url+encodeURIComponent(t)+".json",{access_token:this._access_token},function(t){var r,s,i,l=[];if(t.features&&t.features.length)for(var a=0;a<=t.features.length-1;a++)r=t.features[a],s=e.latLng(r.center.reverse()),i=r.hasOwnProperty("bbox")?e.latLngBounds(e.latLng(r.bbox.slice(0,2).reverse()),e.latLng(r.bbox.slice(2,4).reverse())):e.latLngBounds(s,s),l[a]={name:r.place_name,bbox:i,center:s};o.call(n,l)})},reverse:function(t,o,n,r){e.Control.Geocoder.getJSON(this.options.service_url+encodeURIComponent(t.lng)+","+encodeURIComponent(t.lat)+".json",{access_token:this._access_token},function(t){var o,s,i,l=[];if(t.features&&t.features.length)for(var a=0;a<=t.features.length-1;a++)o=t.features[a],s=e.latLng(o.center.reverse()),i=o.hasOwnProperty("bbox")?e.latLngBounds(e.latLng(o.bbox.slice(0,2).reverse()),e.latLng(o.bbox.slice(2,4).reverse())):e.latLngBounds(s,s),l[a]={name:o.place_name,bbox:i,center:s};n.call(r,l)})}}),e.Control.Geocoder.mapbox=function(t){return new e.Control.Geocoder.Mapbox(t)},e.Control.Geocoder.Google=e.Class.extend({options:{service_url:"https://maps.googleapis.com/maps/api/geocode/json"},initialize:function(e){this._key=e},geocode:function(t,o,n){var r={address:t};this._key&&this._key.length&&(r.key=this._key),e.Control.Geocoder.getJSON(this.options.service_url,r,function(t){var r,s,i,l=[];if(t.results&&t.results.length)for(var a=0;a<=t.results.length-1;a++)r=t.results[a],s=e.latLng(r.geometry.location),i=e.latLngBounds(e.latLng(r.geometry.viewport.northeast),e.latLng(r.geometry.viewport.southwest)),l[a]={name:r.formatted_address,bbox:i,center:s};o.call(n,l)})},reverse:function(t,o,n,r){var s={latlng:encodeURIComponent(t.lat)+","+encodeURIComponent(t.lng)};this._key&&this._key.length&&(s.key=this._key),e.Control.Geocoder.getJSON(this.options.service_url,s,function(t){var o,s,i,l=[];if(t.results&&t.results.length)for(var a=0;a<=t.results.length-1;a++)o=t.results[a],s=e.latLng(o.geometry.location),i=e.latLngBounds(e.latLng(o.geometry.viewport.northeast),e.latLng(o.geometry.viewport.southwest)),l[a]={name:o.formatted_address,bbox:i,center:s};n.call(r,l)})}}),e.Control.Geocoder.google=function(t){return new e.Control.Geocoder.Google(t)},e.Control.Geocoder}); \ No newline at end of file diff --git a/assets/leaflet-loading/Control.Loading.min.css b/assets/leaflet-loading/Control.Loading.min.css new file mode 100644 index 0000000..678a413 --- /dev/null +++ b/assets/leaflet-loading/Control.Loading.min.css @@ -0,0 +1 @@ +.leaflet-control-loading:empty{background-image:url('loading.gif')}.leaflet-control-loading,.leaflet-control-zoom a.leaflet-control-loading,.leaflet-control-zoomslider a.leaflet-control-loading{display:none}.leaflet-control-loading.is-loading,.leaflet-control-zoom a.leaflet-control-loading.is-loading,.leaflet-control-zoomslider a.leaflet-control-loading.is-loading{display:block}.leaflet-bar-part-bottom{border-bottom:medium none;border-bottom-left-radius:4px;border-bottom-right-radius:4px} \ No newline at end of file diff --git a/assets/leaflet-loading/Control.Loading.min.js b/assets/leaflet-loading/Control.Loading.min.js new file mode 100644 index 0000000..be57194 --- /dev/null +++ b/assets/leaflet-loading/Control.Loading.min.js @@ -0,0 +1 @@ +!function(){function o(o){o.Control.Loading=o.Control.extend({options:{position:"topleft",separate:!1,zoomControl:null,spinjs:!1,spin:{lines:7,length:3,width:3,radius:5,rotate:13,top:"83%"}},initialize:function(t){o.setOptions(this,t),this._dataLoaders={},null!==this.options.zoomControl&&(this.zoomControl=this.options.zoomControl)},onAdd:function(t){if(this.options.spinjs&&"function"!=typeof Spinner)return console.error("Leaflet.loading cannot load because you didn't load spin.js (http://fgnass.github.io/spin.js/), even though you set it in options.");this._addLayerListeners(t),this._addMapListeners(t),this.options.separate||this.zoomControl||(t.zoomControl?this.zoomControl=t.zoomControl:t.zoomsliderControl&&(this.zoomControl=t.zoomsliderControl));var n,i="leaflet-control-loading";return this.zoomControl&&!this.options.separate?(n=this.zoomControl._container,i+=" leaflet-bar-part-bottom leaflet-bar-part last"):n=o.DomUtil.create("div","leaflet-control-zoom leaflet-bar"),this._indicator=o.DomUtil.create("a",i,n),this.options.spinjs&&(this._spinner=new Spinner(this.options.spin).spin(),this._indicator.appendChild(this._spinner.el)),n},onRemove:function(o){this._removeLayerListeners(o),this._removeMapListeners(o)},removeFrom:function(t){return this.zoomControl&&!this.options.separate?(this._container.removeChild(this._indicator),this._map=null,this.onRemove(t),this):o.Control.prototype.removeFrom.call(this,t)},addLoader:function(o){this._dataLoaders[o]=!0,this.updateIndicator()},removeLoader:function(o){delete this._dataLoaders[o],this.updateIndicator()},updateIndicator:function(){this.isLoading()?this._showIndicator():this._hideIndicator()},isLoading:function(){return this._countLoaders()>0},_countLoaders:function(){var o,t=0;for(o in this._dataLoaders)this._dataLoaders.hasOwnProperty(o)&&t++;return t},_showIndicator:function(){o.DomUtil.addClass(this._indicator,"is-loading"),this.options.separate||(this.zoomControl instanceof o.Control.Zoom?o.DomUtil.removeClass(this.zoomControl._zoomOutButton,"leaflet-bar-part-bottom"):"function"==typeof o.Control.Zoomslider&&this.zoomControl instanceof o.Control.Zoomslider&&o.DomUtil.removeClass(this.zoomControl._ui.zoomOut,"leaflet-bar-part-bottom"))},_hideIndicator:function(){o.DomUtil.removeClass(this._indicator,"is-loading"),this.options.separate||(this.zoomControl instanceof o.Control.Zoom?o.DomUtil.addClass(this.zoomControl._zoomOutButton,"leaflet-bar-part-bottom"):"function"==typeof o.Control.Zoomslider&&this.zoomControl instanceof o.Control.Zoomslider&&o.DomUtil.addClass(this.zoomControl._ui.zoomOut,"leaflet-bar-part-bottom"))},_handleLoading:function(o){this.addLoader(this.getEventId(o))},_handleLoad:function(o){this.removeLoader(this.getEventId(o))},getEventId:function(o){return o.id?o.id:o.layer?o.layer._leaflet_id:o.target._leaflet_id},_layerAdd:function(o){if(o.layer&&o.layer.on)try{o.layer.on({loading:this._handleLoading,load:this._handleLoad},this)}catch(t){console.warn("L.Control.Loading: Tried and failed to add event handlers to layer",o.layer),console.warn("L.Control.Loading: Full details",t)}},_addLayerListeners:function(o){o.eachLayer(function(o){o.on&&o.on({loading:this._handleLoading,load:this._handleLoad},this)},this),o.on("layeradd",this._layerAdd,this)},_removeLayerListeners:function(o){o.eachLayer(function(o){o.off&&o.off({loading:this._handleLoading,load:this._handleLoad},this)},this),o.off("layeradd",this._layerAdd,this)},_addMapListeners:function(o){o.on({dataloading:this._handleLoading,dataload:this._handleLoad,layerremove:this._handleLoad},this)},_removeMapListeners:function(o){o.off({dataloading:this._handleLoading,dataload:this._handleLoad,layerremove:this._handleLoad},this)}}),o.Map.addInitHook(function(){this.options.loadingControl&&(this.loadingControl=new o.Control.Loading,this.addControl(this.loadingControl))}),o.Control.loading=function(t){return new o.Control.Loading(t)}}"function"==typeof define&&define.amd?define(["leaflet"],function(t){o(t)}):o(L)}(); \ No newline at end of file diff --git a/assets/leaflet-providers/leaflet-providers.min.js b/assets/leaflet-providers/leaflet-providers.min.js new file mode 100644 index 0000000..3e7fa3b --- /dev/null +++ b/assets/leaflet-providers/leaflet-providers.min.js @@ -0,0 +1 @@ +!function(){"use strict";L.TileLayer.Provider=L.TileLayer.extend({initialize:function(a,t){var r=L.TileLayer.Provider.providers,o=a.split("."),e=o[0],i=o[1];if(!r[e])throw"No such provider ("+e+")";var n={url:r[e].url,options:r[e].options};if(i&&"variants"in r[e]){if(!(i in r[e].variants))throw"No such variant of "+e+" ("+i+")";var s,p=r[e].variants[i];s="string"==typeof p?{variant:p}:p.options,n={url:p.url||n.url,options:L.Util.extend({},n.options,s)}}else"function"==typeof n.url&&(n.url=n.url(o.splice(1,o.length-1).join(".")));var l=function(a){return-1===a.indexOf("{attribution.")?a:a.replace(/\{attribution.(\w*)\}/,function(a,t){return l(r[t].options.attribution)})};n.options.attribution=l(n.options.attribution);var m=L.Util.extend({},n.options,t);L.TileLayer.prototype.initialize.call(this,n.url,m)}}),L.TileLayer.Provider.providers={OpenStreetMap:{url:"http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",options:{attribution:'© OpenStreetMap'},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 Humanitarian OpenStreetMap Team'}}}},OpenSeaMap:{url:"http://tiles.openseamap.org/seamark/{z}/{x}/{y}.png",options:{attribution:'Map data: © OpenSeaMap contributors'}},Thunderforest:{url:"http://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png",options:{attribution:'© OpenCycleMap, {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 GIScience Research Group @ University of Heidelberg — 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 OpenStreetMap Sweden — 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 MapQuest — 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 MapQuest — Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency'}}}},MapBox:{url:function(a){return"http://{s}.tiles.mapbox.com/v3/"+a+"/{z}/{x}/{y}.png"},options:{attribution:'Imagery from MapBox — Map data {attribution.OpenStreetMap}',subdomains:"abcd"}},Stamen:{url:"http://{s}.tile.stamen.com/{variant}/{z}/{x}/{y}.png",options:{attribution:'Map tiles by Stamen Design, CC BY 3.0 — 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 © Esri"},variants:{WorldStreetMap:{options:{attribution:"{attribution.Esri} — 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} — Copyright: ©2012 DeLorme"}},WorldTopoMap:{options:{variant:"World_Topo_Map",attribution:"{attribution.Esri} — 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} — 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} — Source: USGS, Esri, TANA, DeLorme, and NPS"}},WorldShadedRelief:{options:{variant:"World_Shaded_Relief",maxZoom:13,attribution:"{attribution.Esri} — Source: Esri"}},WorldPhysical:{options:{variant:"World_Physical_Map",maxZoom:8,attribution:"{attribution.Esri} — Source: US National Park Service"}},OceanBasemap:{options:{variant:"Ocean_Basemap",maxZoom:13,attribution:"{attribution.Esri} — Sources: GEBCO, NOAA, CHS, OSU, UNH, CSUMB, National Geographic, DeLorme, NAVTEQ, and Esri"}},NatGeoWorldMap:{options:{variant:"NatGeo_World_Map",maxZoom:16,attribution:"{attribution.Esri} — 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} — Esri, DeLorme, NAVTEQ"}}}},OpenWeatherMap:{url:"http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png",options:{attribution:'Map data © OpenWeatherMap',opacity:.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:{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 © 1987-2014 HERE',subdomains:"1234",mapID:"newest",app_id:"",app_code:"",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:"©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 Freemap.sk'}},MtbMap:{url:"http://tile.mtbmap.cz/mtbmap_tiles/{z}/{x}/{y}.png",options:{attribution:"{attribution.OpenStreetMap} & USGS"}},CartoDB:{url:"http://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}.png",options:{attribution:'{attribution.OpenStreetMap} © CartoDB',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(a,t){return new L.TileLayer.Provider(a,t)}}(); \ No newline at end of file diff --git a/assets/leaflet/leaflet.min.css b/assets/leaflet/leaflet.min.css new file mode 100644 index 0000000..96ba00c --- /dev/null +++ b/assets/leaflet/leaflet.min.css @@ -0,0 +1 @@ +.leaflet-image-layer,.leaflet-layer,.leaflet-map-pane,.leaflet-marker-icon,.leaflet-marker-pane,.leaflet-marker-shadow,.leaflet-overlay-pane,.leaflet-overlay-pane svg,.leaflet-popup-pane,.leaflet-shadow-pane,.leaflet-tile,.leaflet-tile-container,.leaflet-tile-pane,.leaflet-zoom-box{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden;-ms-touch-action:none}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container img{max-width:none!important}.leaflet-container img.leaflet-image-layer{max-width:15000px!important}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-tile-pane{z-index:2}.leaflet-objects-pane{z-index:3}.leaflet-overlay-pane{z-index:4}.leaflet-shadow-pane{z-index:5}.leaflet-marker-pane{z-index:6}.leaflet-popup-pane{z-index:7}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url('#default#VML');display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:7;pointer-events:auto}.leaflet-bottom,.leaflet-top{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup,.leaflet-fade-anim .leaflet-tile{opacity:0;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;-o-transition:opacity .2s linear;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup,.leaflet-fade-anim .leaflet-tile-loaded{opacity:1}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);-o-transition:-o-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-pan-anim .leaflet-tile,.leaflet-touching .leaflet-zoom-animated,.leaflet-zoom-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-clickable{cursor:pointer}.leaflet-container{cursor:-webkit-grab;cursor:-moz-grab}.leaflet-control,.leaflet-popup-pane{cursor:auto}.leaflet-dragging .leaflet-clickable,.leaflet-dragging .leaflet-container{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing}.leaflet-container{background:#ddd;outline:0}.leaflet-container a{color:#0078A8}.leaflet-container a.leaflet-active{outline:orange solid 2px}.leaflet-zoom-box{border:2px dotted #38f;background:rgba(255,255,255,.5)}.leaflet-container{font:12px/1.5 "Helvetica Neue",Arial,Helvetica,sans-serif}.leaflet-bar{box-shadow:0 1px 5px rgba(0,0,0,.65);border-radius:4px}.leaflet-bar a,.leaflet-bar a:hover{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px 'Lucida Console',Monaco,monospace;text-indent:1px}.leaflet-control-zoom-out{font-size:20px}.leaflet-touch .leaflet-control-zoom-in{font-size:22px}.leaflet-touch .leaflet-control-zoom-out{font-size:24px}.leaflet-control-layers{box-shadow:0 1px 5px rgba(0,0,0,.4);background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url('images/layers.png');width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url('images/layers-2x.png');background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-container .leaflet-control-attribution{background:#fff;background:rgba(255,255,255,.7);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover{text-decoration:underline}.leaflet-container .leaflet-control-attribution,.leaflet-container .leaflet-control-scale{font-size:11px}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;font-size:11px;white-space:nowrap;overflow:hidden;-moz-box-sizing:content-box;box-sizing:content-box;background:#fff;background:rgba(255,255,255,.5)}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers{box-shadow:none}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-layers{border:2px solid rgba(0,0,0,.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 19px;line-height:1.4}.leaflet-popup-content p{margin:18px 0}.leaflet-popup-tip-container{margin:0 auto;width:40px;height:20px;position:relative;overflow:hidden}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;box-shadow:0 3px 14px rgba(0,0,0,.4)}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;padding:4px 4px 0 0;text-align:center;width:18px;height:14px;font:16px/14px Tahoma,Verdana,sans-serif;color:#c3c3c3;text-decoration:none;font-weight:700;background:0 0}.leaflet-container a.leaflet-popup-close-button:hover{color:#999}.leaflet-popup-scrolled{overflow:auto;border-bottom:1px solid #ddd;border-top:1px solid #ddd}.leaflet-oldie .leaflet-popup-content-wrapper{zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=.70710678, M12=.70710678, M21=-.70710678, M22=.70710678)}.leaflet-oldie .leaflet-popup-tip-container{margin-top:-1px}.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666} \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..991e401 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,93 @@ +var gulp = require('gulp'); +var del = require('del'); +var rename = require('gulp-rename'); +var uglify = require('gulp-uglify'); +var merge = require('merge-stream'); +var minifyCss = require('gulp-minify-css'); +var replace = require('gulp-replace'); + +var paths = [ + { + dest: 'assets/control-geocoder', + js: 'Control.Geocoder.js', + css: 'Control.Geocoder.css' + }, + { + dest: 'assets/leaflet-loading', + js: 'Control.Loading.js', + css: 'Control.Loading.css' + }, + { + dest: 'assets/leaflet-providers', + js: 'leaflet-providers.js' + }, + { + dest: 'assets/leaflet', + css: 'leaflet.css' + } +]; + +gulp.task('clear-styles', function(cb) { + var i, clear = []; + + for (i = 0; i < paths.length; i++) { + if (paths[i].css) { + clear.push(paths[i].dest + '/*.min.css'); + } + } + + del(clear, cb); +}); + +gulp.task('clear-scripts', function(cb) { + var i, clear = []; + + for (i = 0; i < paths.length; i++) { + if (paths[i].js) { + clear.push(paths[i].dest + '/*.min.js'); + } + } + + del(clear, cb); +}); + +gulp.task('scripts', ['clear-scripts'], function() { + var i, stream, streams = []; + + for (i = 0; i < paths.length; i++) { + if (paths[i].js) { + stream = gulp.src(paths[i].dest + '/' + paths[i].js) + .pipe(rename(function (path) { + path.basename += '.min'; + })) + .pipe(uglify()) + .pipe(gulp.dest(paths[i].dest)); + + streams.push(stream); + } + } + + return merge.call(null, streams); +}); + +gulp.task('styles', ['clear-styles'], function() { + var i, stream, streams = []; + + for (i = 0; i < paths.length; i++) { + if (paths[i].css) { + stream = gulp.src(paths[i].dest + '/' + paths[i].css) + .pipe(rename(function (path) { + path.basename += '.min'; + })) + .pipe(minifyCss()) + .pipe(replace(/url\(([^"][^\)]+)\)/g, 'url(\'$1\')')) + .pipe(gulp.dest(paths[i].dest)); + + streams.push(stream); + } + } + + return merge.call(null, streams); +}); + +gulp.task('default', ['scripts', 'styles']); diff --git a/module/config/config.php b/module/config/config.php index 1e2eb95..3d28549 100644 --- a/module/config/config.php +++ b/module/config/config.php @@ -20,7 +20,7 @@ $GLOBALS['LEAFLET_LIBRARIES']['leaflet'] = array 'version' => '0.7.3', 'license' => 'BSD-2-Clause', 'homepage' => 'http://leafletjs.com', - 'css' => 'assets/leaflet/libs/leaflet/leaflet.css', + 'css' => 'assets/leaflet/libs/leaflet/leaflet.min.css', 'javascript' => 'assets/leaflet/libs/leaflet/leaflet.js', ); @@ -30,7 +30,7 @@ $GLOBALS['LEAFLET_LIBRARIES']['leaflet-providers'] = array 'version' => '1.0.12', 'license' => 'BSD-2-Clause', 'homepage' => 'http://leaflet-extras.github.io/leaflet-providers', - 'javascript' => 'assets/leaflet/libs/leaflet-providers/leaflet-providers.js' + 'javascript' => 'assets/leaflet/libs/leaflet-providers/leaflet-providers.min.js' ); $GLOBALS['LEAFLET_LIBRARIES']['leaflet-omnivore'] = array @@ -48,8 +48,8 @@ $GLOBALS['LEAFLET_LIBRARIES']['leaflet-loading'] = array 'version' => '0.1.13', 'license' => 'MIT', 'homepage' => 'https://github.com/ebrelsford/Leaflet.loading', - 'css' => 'assets/leaflet/libs/leaflet-loading/Control.Loading.css', - 'javascript' => 'assets/leaflet/libs/leaflet-loading/Control.Loading.js' + 'css' => 'assets/leaflet/libs/leaflet-loading/Control.Loading.min.css', + 'javascript' => 'assets/leaflet/libs/leaflet-loading/Control.Loading.min.js' ); $GLOBALS['LEAFLET_LIBRARIES']['leaflet-control-geocode'] = array @@ -58,8 +58,8 @@ $GLOBALS['LEAFLET_LIBRARIES']['leaflet-control-geocode'] = array 'version' => '1.0.0', 'license' => 'BSD-2-Clause', 'homepage' => 'https://github.com/perliedman/leaflet-control-geocoder', - 'css' => 'assets/leaflet/libs/control-geocoder/Control.Geocoder.css', - 'javascript' => 'assets/leaflet/libs/control-geocoder/Control.Geocoder.js' + 'css' => 'assets/leaflet/libs/control-geocoder/Control.Geocoder.min.css', + 'javascript' => 'assets/leaflet/libs/control-geocoder/Control.Geocoder.min.js' ); $GLOBALS['LEAFLET_LIBRARIES']['spin.js'] = array