diff -r 000000000000 -r c73bb834ccbe src/pyams_gis/resources/js/leaflet-gp-3.0.2.min.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_gis/resources/js/leaflet-gp-3.0.2.min.js Thu May 18 17:23:48 2017 +0200 @@ -0,0 +1,157 @@ +/*! + * @brief Geoportal Extension for Leaflet + * + * This software is released under the licence CeCILL-B (Free BSD compatible) + * @see http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt + * @see http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt + * @see http://www.cecill.info/ + * + * copyright CeCILL-B + * copyright IGN + * @author IGN + * @version 0.9.0 + * @date 2016-12-04 + * + */ +/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and cont ributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/jakearchibald/es6-promise/ master/LICENSE + * @version 3.0.2 + */ +/*! + * Sortable -- minimalist JavaScript library for reorderable drag-and-drop lists + * + * Released under MIT LICENSE + * + * Copyright 2013-2016 Lebedev Konstantin + * http://rubaxa.github.io/Sortable/ + * + * 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. + */ +/*! + * Proj4js - Javascript reprojection library. + * + * Authors: + * + * - Mike Adair madairATdmsolutions.ca + * - Richard Greenwood richATgreenwoodmap.com + * - Didier Richard didier.richardATign.fr + * - Stephen Irons stephen.ironsATclear.net.nz + * - Olivier Terral oterralATgmail.com + * - Calvin Metcalf cmetcalfATappgeo.com + * + * Copyright (c) 2014, Mike Adair, Richard Greenwood, Didier Richard, Stephen Irons, Olivier Terral and Calvin Metcalf + * + * 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._ + * + */ +/*! + * Copyright 2012-2016 Jacob Toye and Leaflet + * + * 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. + */ +/*! + * Proj4Leaflet -- Smooth Proj4js integration with Leaflet + * + * Copyright (c) 2012, Kartena AB + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 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 OWNER 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. + */ +;(function(root, factory) { + if (typeof define === 'function' && define.amd) { + define(['leaflet'], factory); + } else if (typeof exports === 'object') { + module.exports = factory(require('leaflet')); + } else { + root.Gp = factory(root.L); + } +}(this, function(leaflet) { +var gp,CommonUtilsAutoLoadConfig,leafletDraw,sortable,CommonControlsLayerSwitcherDOM,LeafletControlsLayerSwitcher,CommonUtilsConfig,CommonUtilsCheckRightManagement,CommonUtilsSelectorID,CommonControlsLocationSelectorDOM,LeafletControlsUtilsPositionFormater,LeafletControlsUtilsIconDefault,LeafletControlsLocationSelector,CommonControlsIsoDOM,LeafletControlsIsocurve,CommonControlsMousePositionDOM,proj4,proj4leaflet07x,proj4leaflet10x,LeafletCRSProj4Leaflet,CommonUtilsRegister,LeafletCRSEPSG2154,LeafletCRSEPSG27572,LeafletCRSEPSG4326,LeafletCRSCRS,LeafletControlsMousePosition,CommonControlsReverseGeocodingDOM,LeafletControlsReverseGeocoding,CommonControlsRouteDOM,LeafletControlsRoute,CommonControlsSearchEngineDOM,CommonControlsSearchEngineUtils,LeafletControlsSearchEngine,CommonControlsElevationPathDOM,LeafletControlsElevationPath,LeafletControlsLogo,LeafletControlsControls,CommonUtilsLayerUtils,LeafletLayersLayerConfig,LeafletLayersLayerEvent,LeafletLayersWMS,LeafletLayersWMTS,LeafletLayersLayers,LeafletGpPluginLeaflet;!function(t,e){gp=function(){return"function"==typeof e?e():e}()}(this,function(){var t,e,i,n,o,s,r,a,l,c,h,u,d,p,m,f,_,g,v,y,E,P,C,S,M,w,L,R,b,x,G,I,A,T,k,O,D,N,U,j,F,z,B,q,W,H,V,Y,K,X,Z,Q,J,$,tt,et,it,nt,ot,st,rt,at,lt,ct,ht,ut,dt,pt,mt,ft,_t,gt,vt,yt,Et,Pt,Ct,St,Mt,wt,Lt,Rt,bt,xt,Gt,It,At,Tt,kt,Ot,Dt,Nt,Ut,jt,Ft,zt,Bt;return t=void 0,e={loggers:[{root:!0,level:"all",appenders:[{type:"Console",layout:{type:"PatternLayout",pattern:"%d{yyyy-MM-dd HH:mm:ss} [%p] %c - %m%n"}}]}]},i=function(t,e){var i={getLogger:function(i){t.load(e,function(t){if(t)throw t});var n=i||"default";return t.getLogger(n)}};return i}(t,e),n=function(){var t={normalyzeParameters:function(t){var e=null;if(t){var i=[];for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];o||(o=""),i.push(n+"="+o)}e=i.join("&")}return e},normalyzeUrl:function(t,e,i){var n=t;if(t){var o=t.indexOf("?");o===-1&&(n+="?"),o!==-1&&o!==t.length-1&&(n+="&")}return e&&(n+="string"==typeof e?e:this.normalyzeParameters(e)),i&&(n=encodeURIComponent(n)),n},indent:function(t,e){var i=t||0;return new Array(i+1).join("\t")+e}};return t}(),function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function e(t){return"function"==typeof t}function i(t){return"object"==typeof t&&null!==t}function n(t){B=t}function s(t){V=t}function r(){return function(){process.nextTick(u)}}function a(){return function(){z(u)}}function l(){var t=0,e=new X(u),i=document.createTextNode("");return e.observe(i,{characterData:!0}),function(){i.data=t=++t%2}}function c(){var t=new MessageChannel;return t.port1.onmessage=u,function(){t.port2.postMessage(0)}}function h(){return function(){setTimeout(u,1)}}function u(){for(var t=0;t0&&(r=window.setTimeout(function(){var t="TimeOut Occured on Http Request with XMLHttpRequest !";n({message:t,status:-1})},t.timeOut)),o&&s.setRequestHeader("Content-type",t.content),s.onerror=function(t){console.log(t),n(new Error("Errors Occured on Http Request with XMLHttpRequest !"))},s.ontimeout=function(){n(new Error("TimeOut Occured on Http Request with XMLHttpRequest !"))},s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status)window.clearTimeout(r),i(s.response);else{var t="Errors Occured on Http Request (status : '"+s.status+"' | response : '"+s.response+"')",e=s.status;n({message:t,status:e})}};var a=t.data&&o?t.data:null;s.send(a)}else{if(!window.XDomainRequest)throw new Error("CORS not supported");s=new XDomainRequest,s.open(t.method,t.url),s.overrideMimeType=t.content,t.timeOut>0&&(s.timeout=t.timeout),o&&s.setRequestHeader("Content-type",t.content),s.onerror=function(){n(new Error("Errors Occured on Http Request with XMLHttpRequest !"))},s.ontimeout=function(){n(new Error("TimeOut Occured on Http Request with XMLHttpRequest !"))},s.onload=function(){if(200==s.status)i(s.responseText);else{var t="Errors Occured on Http Request (status : '"+s.status+"' | response : '"+s.responseText+"')",e=s.status;n({message:t,status:e})}};var l=t.data&&o?t.data:null;s.send(l)}});return i},__callJSON:function(t){return this.__call(t).then(JSON.parse).catch(function(e){throw console.log("_callJSON failed on : ",t.url,e),e})},__callXML:function(t){return this.__call(t).then(function(t){var e;if(window.DOMParser){var i=new DOMParser;e=i.parseFromString(t,"text/xml")}else e=new window.ActiveXObject("Microsoft.XMLDOM"),e.async=!1,e.loadXML(t);return e}).catch(function(e){throw console.log("__callXML failed on : ",t.url,e),e})}};return n}(i,n,o),r=function(){var t={PARAM_MISSING:"Parameter(s) '%var%' missing",PARAM_EMPTY:"Parameter(s) '%var%' empty",PARAM_TYPE:"Wrong type(s) for parameter(s) '%var%'",PARAM_FORMAT:"Parameter(s) '%var%' not correctly formatted",PARAM_NOT_SUPPORT:"Value(s) for parameter(s) '%var%' not supported",PARAM_UNKNOWN:"Value(s) for parameter(s) '%var%' unknown",SERVICE_REQUEST_BUILD:"An error occurred during the request building of the service",SERVICE_REQUEST_EMPTY:"The request sent to the service is empty",SERVICE_RESPONSE_EXCEPTION:"The service returned an exception : '%var%'",SERVICE_RESPONSE_EXCEPTION_2:"The service returned an exception",SERVICE_RESPONSE_ANALYSE:"An error occurred while parsing the response '%var%' of the service",SERVICE_RESPONSE_ANALYSE_2:"An unknown error occurred while parsing the response",SERVICE_RESPONSE_EMPTY:"The response of the service is empty",SERVICE_RESPONSE_EMPTY_2:"The response from the service could not be analyzed or is empty",SERVICE_RESPONSE_FORMAT:"The format of the service response is not supported (handled format(s) : '%var%')",SERVICE_RESPONSE_FORMAT_2:"The format of the service response is not supported",SERVICE_RESPONSE_FORMAT_3:"No suggestion matching the search",CLASS_CONSTRUCTOR:"'%var%' constructor cannot be called as a function.",getMessage:function(t,e){if(!arguments)return"Message indefined !";var i=Array.prototype.slice.call(arguments),n=i.shift(),o=i,s=this[n];try{s=Array.isArray(o)&&o.length>0?s.replace("%var%",o.join(" - ")):s.replace("%var%","%var% (not specified)")}catch(t){}return s}};return t}(),a=function(){function t(e){if(!(this instanceof t))throw new TypeError("ErrorService constructor cannot be called as a function.");var i=e;"string"==typeof e||e instanceof String?(this.message=e,this.status=-1,this.type=t.TYPE_UNKERR):(this.message=i.message||"undefined!?",this.type=i.type,this.status=i.status||-1),this.name="ErrorService",this.stack=(new Error).stack}return t.TYPE_SRVERR="SERVICE_ERROR",t.TYPE_USEERR="USAGE_ERROR",t.TYPE_UNKERR="UNKNOWN_ERROR",t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),t}(),l=function(t){var e={uuid:function(){var t=Math.floor(Date.now());return function(){return t++}}(),call:function(t){if(!t)throw new Error("missing parameter : options !");if(!t.url)throw new Error("missing parameter : options.url !");if(t.timeOut||(t.timeOut=0),!t.onResponse)throw new Error("missing parameter : options.onResponse !");var e="string"==typeof t.callbackSuffix?t.callbackSuffix:this.uuid(),i=!1,n=!1,o=t.url.indexOf("callback=");if(o!=-1){i=!0;var s=t.url.indexOf("&",o);s===-1&&(s=t.url.length);var r=t.url.substring(o+9,s);r&&(n=!0,t.callbackName=r)}if(!i){var a=t.url.indexOf("?");a===-1?t.url=t.url+"?callback=":a===t.url.length?t.url=t.url+"callback=":t.url=t.url+"&callback="}var l=!!t.callbackName||n;if(n||(t.callbackName||(t.callbackName="callback",(e||""===e)&&(t.callbackName+=e)),t.url=t.url.replace("callback=","callback="+t.callbackName)),t.onTimeOut||(t.onTimeOut=function(){console.log("TimeOut while invoking url : "+t.url)}),!l){var c=this,h=null;t.timeOut>0&&(h=window.setTimeout(function(){window[t.callbackName]=function(){},t.onTimeOut(),c._deleteScript(e)},t.timeOut)),window[t.callbackName]=function(i){window.clearTimeout(h),t.onResponse(i),c._deleteScript(e)}}this._createScript(e,t.url)},_createScript:function(t,e){var i,n=document.getElementById("results"+t);i=document.createElement("script"),i.setAttribute("type","text/javascript"),i.setAttribute("src",e),i.setAttribute("charset","UTF-8"),i.setAttribute("id","results"+t),i.setAttribute("async","true");var o=document.documentElement||document.getElementsByTagName("head")[0];null===n?o.appendChild(i):o.replaceChild(i,n)},_deleteScript:function(t){var e=document.getElementById("results"+t);if(e){var i=e.parentNode||document.documentElement;if(!i)return;i.removeChild(e)}}};return e}(i),c=function(t,e,i){var n={send:function(n){var o=n||{method:"GET",protocol:"JSONP",timeOut:0,format:null,wrap:!0,nocache:!0,output:"json",callback:null,callbackSuffix:null};if("XHR"===n.protocol||"json"===n.format?o.wrap=!1:"JSONP"===n.protocol&&"xml"===n.format&&(o.wrap=!0),o.callback=("JSONP"==n.protocol,null),o.output=o.wrap?"json":null,o.wrap){var s={};s.output=o.output,s.callback=o.callback,delete s.callback,o.url=t.normalyzeUrl(n.url,s)}switch(o.protocol){case"XHR":"GET"===n.method&&n.nocache&&(o.url=t.normalyzeUrl(o.url,{t:(new Date).getTime()})),e.call(o);break;case"JSONP":o.data&&(o.url=t.normalyzeUrl(o.url,o.data)),i.call(o);break;default:throw new Error("protocol not supported (XHR|JSONP) !")}}};return n}(n,s,l),h=function(){var t=location&&location.protocol&&0===location.protocol.indexOf("https:")?"https://":"http://",e="wxs.ign.fr",i="%KEY%",n=t+e.concat("/",i),o=function(t){return this._key.replace(t?i:null,t)},s={Alti:{_key:{"elevation-json":n+"/alti/rest/elevation.json","elevation-xml":n+"/alti/rest/elevation.xml","profil-json":n+"/alti/rest/elevationLine.json","profil-xml":n+"/alti/rest/elevationLine.xml",wps:n+"/alti/wps"},url:function(t){return{"elevation-json":this._key["elevation-json"].replace(t?i:null,t),"elevation-xml":this._key["elevation-xml"].replace(t?i:null,t),"profil-json":this._key["profil-json"].replace(t?i:null,t),"profil-xml":this._key["profil-xml"].replace(t?i:null,t),wps:this._key.wps.replace(t?i:null,t)}}},ProcessIsoCurve:{_key:{"iso-json":n+"/isochrone/isochrone.json","iso-xml":n+"/isochrone/isochrone.xml"},url:function(t){return{"iso-json":this._key["iso-json"].replace(t?i:null,t),"iso-xml":this._key["iso-xml"].replace(t?i:null,t)}}},AutoComplete:{_key:n+"/ols/apis/completion",url:o},ReverseGeocode:{_key:n+"/geoportail/ols",url:o},AutoConf:{_key:{apiKey:n+"/autoconf",apiKeys:n+"/autoconf?keys=%KEYS%"},url:function(n){var o="";if(Array.isArray(n)&&n.length>0){o=n[0];for(var s=1;se||t",input:"__KEY__=__DATA__"},post:{value:'__IDENTIFIER____RAWDATAOUTPUT__',input:"__KEY____DATA__"}},namespaceByDefault:function(){var t=['xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"','xmlns="http://www.opengis.net/wps/1.0.0"','xmlns:wfs="http://www.opengis.net/wfs"','xmlns:wps="http://www.opengis.net/wps/1.0.0"','xmlns:ows="http://www.opengis.net/ows/1.1"','xmlns:gml="http://www.opengis.net/gml"','xmlns:ogc="http://www.opengis.net/ogc"','xmlns:wcs="http://www.opengis.net/wcs/1.1.1"','xmlns:xlink="http://www.w3.org/1999/xlink"'];return t.join(" ")},schemaLocationByDefault:function(){return'xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd"'},processRequestString:function(){var t="";if("POST"==this.method)t=this.template.post.value;else{if("GET"!=this.method)return!1;t=this.template.get.value}return t=t.replace(/__SERVICE__/g,this.paramservice),t=t.replace(/__VERSION__/g,this.paramversion),t=t.replace(/__RAWDATAOUTPUT__/g,this.paramrawdataoutput),t=t.replace(/__IDENTIFIER__/g,this.paramidentifier),t=t.replace(/__REQUEST__/g,this.paramrequest),"POST"==this.method&&(t=t.replace(/__NAMESPACE__/g,this.namespaceByDefault),t=t.replace(/__SCHEMALOCATION__/g,this.schemaLocationByDefault)),!!(t=t.replace(//g,this.__addDataInputs()))&&(this.requestString=t,!0)},__addDataInputs:function(){for(var t="GET"==this.method?this.template.get.input:this.template.post.input,e="GET"==this.method?";":"",i="",n=this,o=this.DataObject.getData(),s=0;s0)for(var r=n.getElementsByTagName("parsererror"),a=0;a0){ +var i=s(t);e.attributes=i}if(t.hasChildNodes())for(var n,r={},a=t.childNodes,l=0;l0){for(var e={},i=t.attributes,n=0;n0){for(var e={},i=t.attributes,n=0;n0){var e=f(t);for(var i in e)if(e.hasOwnProperty(i)){if("version"===i&&e.version!==y.VERSION)return void console.log("[AutoConfResponseReader] autoconf version is not the expected one : there may be errors in parsing");if("xmlns"===i){if(e[i]!==y.NAMESPACES.xmlns)return void console.log("[AutoConfResponseReader] autoconf response default namespace is not the expected one");continue}var n=i.split(":")[0],o=i.split(":")[1];if("xmlns"===n&&o&&y.NAMESPACES[o]&&y.NAMESPACES[o]!==e[i])return void console.log("[AutoConfResponseReader] autoconf response "+i+" namespace is not the expected one");if("schemaLocation"===o&&e[i]!==y.SCHEMALOCATION[0]&&e[i]!==y.SCHEMALOCATION[1])return void console.log("[AutoConfResponseReader] autoconf response schema location is not the expected one")}}}var y={};return y.VERSION="1.1.0",y.NAMESPACES={xmlns:"http://www.opengis.net/context",gpp:"http://api.ign.fr/geoportail",ows:"http://www.opengis.net/ows/1.1",sld:"http://www.opengis.net/sld",wmts:"http://www.opengis.net/wmts/1.0",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},y.SCHEMALOCATION=["http://www.opengis.net/context http://gpp3-wxs.ign.fr/schemas/extContext.xsd http://api.ign.fr/geoportail http://wxs.ign.fr/schemas/autoconf/autoconf.xsd","http://www.opengis.net/context http://gpp3-wxs.ign.fr/schemas/extContext.xsd http://api.ign.fr/geoportail http://gpp3-wxs.ign.fr/schemas/autoconf.xsd"],y.DEFAULTPREFIX="context",y.READERS={context:{ViewContext:function(t){v(t);var i=new e;return _(t,i),i},Title:function(t,e){e&&e.generalOptions?e.generalOptions.title=g(t):e&&e.lyr&&(e.lyr.title=g(t))},Abstract:function(t,e){e&&e.lyr&&(e.lyr.description=g(t))},Server:function(t,e){var i=t.getAttribute("service"),n=t.getAttribute("title"),o=t.getAttribute("version");if(i)if(e&&e.services&&"object"==typeof e.services&&!e.services[i]){var s=new l;s.title=n,s.version=o,_(t,s),e.services[i]=s}else e&&e.lyr&&(e.lyr.serviceParams||(e.lyr.serviceParams={}),e.lyr.serviceParams.id=i,e.lyr.serviceParams.version=o)},OnlineResource:function(t,e){e&&e.hasOwnProperty("serverUrl")&&(e.serverUrl=t.getAttribute("xlink:href"))},LayerList:function(t,e){if(_(t,e),e&&e.layers&&e.generalOptions&&e.services)for(var i in e.layers)if(e.layers.hasOwnProperty(i)){var n=e.layers[i],o=n.apiKeys;if(o&&Array.isArray(o))for(var s=0;s0?this.options.serverUrl=i.apiKeys:this.options.serverUrl=i.apiKey}"XHR"===this.options.protocol&&"POST"===this.options.httpMethod&&(this.options.httpMethod="GET"),this.options.outputFormat="xml"}return a.prototype=Object.create(s.prototype,{}),a.prototype.constructor=a,a.prototype.buildRequest=function(t,e){var i="undefined"!=typeof window?window:{};if(i.Gp&&i.Gp.Config&&i.Gp.Config.generalOptions&&i.Gp.Config.layers&&i.Gp.Config.generalOptions.apiKeys[this.options.apiKey]){if(!this.options.layerId)return void this.options.onSuccess.call(this,i.Gp.Config);if(i.Gp.Config.layers[this.options.layerId]&&i.Gp.Config.layers[this.options.layerId].aggregatedLayers)return void this.options.onSuccess.call(this,i.Gp.Config)}this.request="";var o;o=this.options.serverUrl.indexOf("http://")===-1,!o&&this.layerId&&(this.request=n.normalyzeParameters({layerId:this.layerId})),e.call(this,this.request)},a.prototype.analyzeResponse=function(t,n){if(this.response){var o={layerId:this.options.layerId,response:this.response,rawResponse:this.options.rawResponse,onSuccess:n,onError:t,scope:this};r.build(o)}else t.call(this,new i(e.getMessage("SERVICE_RESPONSE_EMPTY")))},a}(i,r,a,n,h,u,F),B=function(t){function e(t){if(!(this instanceof e))throw new TypeError("RequestHeader constructor cannot be called as a function.");this.options=t||{srsName:"EPSG:4326"};for(var i in t)t.hasOwnProperty(i)&&(this.options[i]=t[i])}return e.prototype={requestString:null,template:'',constructor:e,toString:function(){var t=null;return t=this.template,t=t.replace(/__SRSNAME__/g,this.options.srsName),this.requestString=t,this.requestString}},e}(i),q=function(t){function e(t){if(!(this instanceof e))throw new TypeError("Request constructor cannot be called as a function.");this.options=t||{maximumResponses:25,methodName:null,version:"1.2"};for(var i in t)t.hasOwnProperty(i)&&(this.options[i]=t[i])}return e.prototype={requestString:null,template:'',constructor:e,guid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0,i="x"===t?e:3&e|8;return i.toString(16)})},toString:function(){var t=null;return t=this.template,t=t.replace(/__MAXRESPONSES__/g,this.options.maximumResponses), +t=t.replace(/__METHODNAME__/g,this.options.methodName),t=t.replace(/__UUID__/g,this.guid()),t=t.replace(/__VERSION__/g,this.options.version),this.requestString=t,this.requestString}},e}(i),W=function(t){function e(t){if(!(this instanceof e))throw new TypeError("AbstractService constructor cannot be called as a function.");this.options=t||{};for(var i in t)t.hasOwnProperty(i)&&(this.options[i]=t[i])}return e.prototype={strRequest:null,oRequest:null,oFilter:null,constructor:e,addRequest:function(t){},addFilter:function(t){},toString:function(){}},e}(i),H=function(t,e,i,n){function o(t){if(!(this instanceof o))throw new TypeError("XLS constructor cannot be called as a function.");this.options={srsName:"EPSG:4326",maximumResponses:25};for(var e in t)t.hasOwnProperty(e)&&t[e]&&(this.options[e]=t[e])}return o.VERSION="1.2",o.prototype={requestString:null,namespace:!1,oService:null,constructor:o,template:'\n\n__REQUESTHEADER__\n__REQUEST__\n\n',namespaceByDefault:function(){var t=['xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"','xmlns:xls="http://www.opengis.net/xls"','xmlns:gml="http://www.opengis.net/gml"'];return t.join(" ")},schemaLocationByDefault:function(){return'xsi:schemaLocation="http://www.opengis.net/xls http://schemas.opengis.net/ols/1.2/olsAll.xsd"'},setService:function(t){t&&t instanceof n&&(this.oService=t)},getService:function(){return this.oService}},o.prototype.addNamespace=function(t,e){for(var i=t.key,n=!1,o=this.namespaceByDefault().split(" "),s=0;s])/g,h="<"+i+":$1",e=e.replace(c,h),c=/<\/(\w+[\s>])/g,h="/g,this.getService().toString())),n)return this.namespace&&(n=this.addNamespace({key:"xls",url:"http://www.opengis.net/xls"},n)),this.requestString=n,this.requestString},o}(i,B,q,W),V=function(t,e){function i(t){if(!(this instanceof i))throw new TypeError("Address constructor cannot be called as a function.");if(this.options=t||{location:{},type:["StreetAddress"],filter:{}},!t.location)throw new Error("l'option 'location' n'est pas renseignée !");for(var e in t)t.hasOwnProperty(e)&&(this.options[e]=t[e])}return i.prototype={constructor:i,requestString:null,template:{address:'
__LOCATION____PLACE____POSTALCODE____ENVELOPE__
',location:{freeFormAddress:"__FREEFORMADDRESSVALUE__",streetAddress:{container:"__STREET____BUILDING__",building:'',street:"__STREETVALUE__"}},place:'__PLACEVALUE__',postalCode:"__POSTALCODEVALUE__",envelope:"__LEFT__ __BOTTOM____RIGHT__ __TOP__"}},i.prototype.toString=function(){var t=null;if(t=this.template.address,t=t.replace(/__COUNTRYCODE__/g,this.options.type),"string"==typeof this.options.location){var e=this.template.location.freeFormAddress;e=e.replace(/__FREEFORMADDRESSVALUE__/g,this.options.location),t=t.replace(/__LOCATION__/g,e)}else{var i="",n="";this.options.location.number&&(i=this.template.location.streetAddress.building,i=i.replace(/__BUILDINGVALUE__/g,this.options.location.number)),this.options.location.street&&(n=this.template.location.streetAddress.street,n=n.replace(/__STREETVALUE__/g,this.options.location.street));var o=this.template.location.streetAddress.container;o=o.replace(/__STREET__/g,n),o=o.replace(/__BUILDING__/g,i),t=t.replace(/__LOCATION__/g,o)}var s="";this.options.location.postalCode&&(s=this.template.postalCode,s=s.replace(/__POSTALCODEVALUE__/g,this.options.location.postalCode));var r="";if(this.options.filter){var a=this.options.filter.bbox;a&&(r=this.template.envelope,r=r.replace(/__LEFT__/g,a.left),r=r.replace(/__BOTTOM__/g,a.bottom),r=r.replace(/__RIGHT__/g,a.right),r=r.replace(/__TOP__/g,a.top))}var l=[],c="";if(this.options.filter){var h=this.options.filter;for(var u in h)"bbox"!==u&&(c=this.template.place,c=c.replace(/__PLACETYPE__/g,u),c=c.replace(/__PLACEVALUE__/g,h[u]),l.push(c))}var d="";return this.options.location.city&&(d=this.template.place,d=d.replace(/__PLACETYPE__/g,"Municipality"),d=d.replace(/__PLACEVALUE__/g,this.options.location.city),l.push(d)),t=t.replace(/__POSTALCODE__/g,s),t=t.replace(/__PLACE__/g,l.join("\n")),t=t.replace(/__ENVELOPE__/g,r),this.requestString=t,this.requestString},i}(Bt,i),Y=function(t){function e(){if(!(this instanceof e))throw new TypeError("GeocodeFilterExtension constructor cannot be called as a function.");this.filters=[]}return e.prototype={constructor:e,addFilterExtensions:function(t){t&&this.filters.push(t)},getNames:function(){var t=[];for(var e in this.filters)t.push(this.filters[e].CLASSNAME);return t},getFilter:function(t){var e=null;for(var i in this.filters)this.filters[i].CLASSNAME==t&&(e=this.filters[i]);return e},getFilters:function(){return this.filters},getAttributs:function(t){var e=[];for(var i in this.filters)this.filters[i].CLASSNAME==t&&(e=this.filters[i].attributesList);return e},setPlaceAttributs:function(t,e){var i=this.getFilter(t),n=this.getAttributs(t);for(var o in n){var s=n[o];e[s]&&(i.placeAttributes[s]=e[s])}},getPlaceAttributs:function(t){var e={};for(var i in this.filters)this.filters[i].CLASSNAME==t&&(e=this.filters[i].placeAttributes);return e}},e}(i),K=function(t,e,i){function n(t){if(!(this instanceof n))throw new TypeError("GeocodeRequest constructor cannot be called as a function.");this.options=t||{};for(var e in t)t.hasOwnProperty(e)&&(this.options[e]=t[e]);this.CLASSNAME="GeocodeRequest"}return n.prototype={strRequest:null,oAddress:null,oFilter:null,template:'__ADDRESS__',addAddress:function(t){t instanceof e&&(this.oAddress=t)},addFilter:function(t){t instanceof i&&(this.oFilter=t)},constructor:n,toString:function(){var t="";if(t=this.template,!this.oAddress){var i={};if(i.location=this.options.location,i.type=this.options.filterOptions.type||["StreetAddress"],i.filter=this.options.filterOptions,delete i.filter.type,this.oFilter){i.filter={};for(var n in i.type){var o=i.type[n],s=this.oFilter.getFilter(o);if(s){for(var r=this.options.filterOptions,a=s.attributesList,l=0;l__GMLPOINT____GMLFILTER__",gml:{point:'__X__ __Y__',pos:null,filter:{bbox:'__LEFT__ __BOTTOM____RIGHT__ __TOP__',circle:'__X__ __Y____RADIUS__',polygon:'__XY__',multipolygon:null}}}},e.prototype.toString=function(){var t=this.template.position,e=this.template.gml.point;e=e.replace(/__X__/g,this.options.position.x),e=e.replace(/__Y__/g,this.options.position.y);var i="";if(this.options.filter){var n=this.options.filter;for(var o in n)switch(o){case"circle":i=this.template.gml.filter[o],i=i.replace(/__X__/g,n[o].x),i=i.replace(/__Y__/g,n[o].y),i=i.replace(/__RADIUS__/g,n[o].radius);break;case"bbox":i=this.template.gml.filter[o],i=i.replace(/__LEFT__/g,n[o].left),i=i.replace(/__BOTTOM__/g,n[o].bottom),i=i.replace(/__RIGHT__/g,n[o].right),i=i.replace(/__TOP__/g,n[o].top);break;case"polygon":i=this.template.gml.filter[o];for(var s="",r=n[o],a=0;a__TYPE__"},e.prototype.toString=function(){for(var t=[],e="",i=0;i__POSITION____PREFERENCE__',addPosition:function(t){t instanceof e&&(this.oPosition=t)},addPreferences:function(t){t instanceof i&&(this.oPreference=t)},toString:function(){var t="";if(t=this.template,!this.oPreference&&(this.oPreference=new i(this.options.filterOptions.type||["StreetAddress"]),!this.oPreference))throw new Error("Les preferences ne sont pas definies !?");if(t=t.replace(/__PREFERENCE__/g,this.oPreference.toString()),!this.oPosition){var n={position:this.options.position,filter:{}};if(this.options.filterOptions&&(n.filter=this.options.filterOptions,delete n.filter.type),this.oPosition=new e(n),!this.oPosition)throw new Error("La position et ses filtres ne sont pas definis !?")}return t=t.replace(/__POSITION__/g,this.oPosition.toString()),t=t.replace(/__RETURNFREEFORM__/g,this.options.returnFreeForm?"true":"false"),this.strRequest=t,this.strRequest}},n}(i,X,Z),J=function(t,e,i,n,o){function s(t){if(!(this instanceof s))throw new TypeError("LocationUtilityService constructor cannot be called as a function.");this.CLASSNAME="LocationUtilityService",this.CLASSTYPE=null,e.apply(this,arguments),this.options&&(this.CLASSTYPE=this.options.location?"GeocodeRequest":this.options.position?"ReverseGeocodeRequest":null)}return s.prototype=Object.create(e.prototype,{}),s.prototype.constructor=s,s.prototype.addRequest=function(t){switch(this.CLASSTYPE=t.CLASSNAME,this.CLASSTYPE){case"GeocodeRequest":case"ReverseGeocodeRequest":this.oRequest=t;break;default:throw new Error("Ce n'est pas un objet de type 'LUS Request' !?")}},s.prototype.addFilter=function(t){t instanceof o&&(this.oFilter=t)},s.prototype.toString=function(){if(!this.oRequest){if(!this.options)throw new Error("Les options ne sont pas renseignées, impossible de construire la requête !");if("GeocodeRequest"===this.CLASSTYPE){var t={location:this.options.location,returnFreeForm:this.options.returnFreeForm,filterOptions:this.options.filterOptions||{}};this.oRequest=new i(t),this.oFilter&&this.oRequest.addFilter(this.oFilter)}else if("ReverseGeocodeRequest"===this.CLASSTYPE){var e={position:this.options.position,returnFreeForm:this.options.returnFreeForm,filterOptions:this.options.filterOptions||{}};this.oRequest=new n(e)}}if(!this.oRequest)throw new Error("Type de Geocodage indefini !");return this.strRequest=this.oRequest.toString(),this.strRequest},s}(i,W,K,Q,Y),$=function(){function t(){if(!(this instanceof t))throw new TypeError("GeocodeLocation constructor cannot be called as a function.");this.placeAttributes={},this.attributesList=[],this.serviceAttributes=[]}return t.prototype={constructor:t},t}(),tt=function(t){function e(){if(!(this instanceof e))throw new TypeError("StreetAddress constructor cannot be called as a function.");t.apply(this,arguments),this.CLASSNAME="StreetAddress",this.attributesList=["bbox","ID","IDTR","quality","territory","commune","department","insee","municipality"],this.serviceAttributes=["bbox","ID","IDTR","Qualite","Territoire","Commune","Departement","INSEE","Municipality"]}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}($),et=function(t){function e(){if(!(this instanceof e))throw new TypeError("PositionOfInterest constructor cannot be called as a function.");t.apply(this,arguments),this.CLASSNAME="PositionOfInterest",this.attributesList=["bbox","importance","nature","territory","commune","department","insee","municipality"],this.serviceAttributes=["bbox","Importance","Nature","Territoire","Commune","Departement","INSEE","Municipality"]}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}($),it=function(t){function e(){if(!(this instanceof e))throw new TypeError("CadastralParcel constructor cannot be called as a function.");t.apply(this,arguments),this.CLASSNAME="CadastralParcel",this.attributesList=["absorbedCity","sheet","number","section","commune","department","insee","municipality","origin"],this.serviceAttributes=["CommuneAbsorbee","Feuille","Numero","Section","Commune","Departement","INSEE","Municipality","Type"]}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}($),nt=function(t){function e(){if(!(this instanceof e))throw new TypeError("Administratif constructor cannot be called as a function.");t.apply(this,arguments),this.CLASSNAME="Administratif",this.attributesList=["bbox","prefecture","inseeRegion","inseeDepartment","municipality"],this.serviceAttributes=["bbox","Prefecture","InseeRegion","InseeDepartement","Municipality"]}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}($),ot=function(t,e,i,n,o,s,r,a){var l={build:function(t){var l=null,c=new n;c.addFilterExtensions(new a),c.addFilterExtensions(new o),c.addFilterExtensions(new s),c.addFilterExtensions(new r);var h=new i({location:t.location,returnFreeForm:t.returnFreeForm,filterOptions:t.filterOptions});h.addFilter(c);var u=new e({srsName:t.srs,maximumResponses:t.maximumResponses});if(u.namespace=!0,u.setService(h),l=u.build(),"GET"==t.httpMethod){var d="qxml="+encodeURIComponent(l).replace(/\-/g,"%2D").replace(/\_/g,"%5F").replace(/\./g,"%2E").replace(/\!/g,"%21").replace(/\~/g,"%7E").replace(/\*/g,"%2A").replace(/\'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29");l=d}return l}};return l}(i,H,J,Y,tt,et,it,nt),st=function(){function t(){if(!(this instanceof t))throw new TypeError("GeocodeResponse constructor cannot be called as a function.");this.locations=[]}return t.prototype={constructor:t},t}(),rt=function(){function t(){if(!(this instanceof t))throw new TypeError("GeocodedLocation constructor cannot be called as a function.");this.position={x:null,y:null},this.matchType=null,this.placeAttributes={},this.type=null}return t.prototype={constructor:t},t}(),at=function(t){function e(){if(!(this instanceof e))throw new TypeError("DirectGeocodedLocation constructor cannot be called as a function.");t.apply(this,arguments),this.CLASSNAME="DirectGeocodedLocation",this.accuracy=null}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}(rt),lt=function(t,e,i,n,o){function s(t){if(t.attributes.length>0){for(var e={},i=t.attributes,n=0;n0){var e=s(t);for(var i in e)if(e.hasOwnProperty(i)){if("version"===i&&e.version!==c.VERSION)return void console.log("[DirectGeocodeResponseReader] geocode version is not the expected one : there may be errors in parsing");if("xmlns"===i){if(e[i]!==c.NAMESPACES[c.DEFAULTPREFIX])return void console.log("[DirectGeocodeResponseReader] geocode response default namespace is not the expected one");continue}var n=i.split(":")[0],o=i.split(":")[1];if("xmlns"===n&&o&&c.NAMESPACES[o]&&c.NAMESPACES[o]!==e[i])return void console.log("[DirectGeocodeResponseReader] geocode response "+i+" namespace is not the expected one");if("schemaLocation"===o&&c.SCHEMALOCATION!==e[i])return void console.log("[DirectGeocodeResponseReader] geocode response schema location is not the expected one")}}}var c={};return c.VERSION="1.2",c.NAMESPACES={xmlns:"http://www.opengis.net/xls",gml:"http://www.opengis.net/gml",xls:"http://www.opengis.net/xls",xlsext:"http://www.opengis.net/xlsext",xsi:"http://www.w3.org/2001/XMLSchema-instance"},c.SCHEMALOCATION="http://wxs.ign.fr/schemas/olsAll.xsd",c.DEFAULTPREFIX="xls",c.READERS={xls:{XLS:function(t){var e=new n;return l(t),r(t,e),e},GeocodedAddress:function(t,e){var i=new o;r(t,i),e&&Array.isArray(e.locations)&&e.locations.push(i)},GeocodeMatchCode:function(t,e){var i=t.getAttribute("accuracy");i&&e&&(e.accuracy=parseFloat(i));var n=t.getAttribute("matchType");n&&e&&(e.matchType=n)},Address:function(t,e){var i=t.getAttribute("countryCode");e&&i&&(e.type=i),r(t,e)},freeFormAddress:function(t,e){e&&e.hasOwnProperty("placeAttributes")&&(e.placeAttributes.freeform=a(t))},Building:function(t,e){var i=t.getAttribute("number");e&&e.hasOwnProperty("placeAttributes")&&(i?e.placeAttributes.number=i:t.getAttribute("buildingName")?e.placeAttributes.number=t.getAttribute("buildingName"):t.getAttribute("subdivision")&&(e.placeAttributes.number=t.getAttribute("subdivision")))},Street:function(t,e){e&&e.hasOwnProperty("placeAttributes")&&("StreetAddress"===e.type?e.placeAttributes.street=a(t):"CadastralParcel"===e.type&&(e.placeAttributes.cadastralParcel=a(t)))},Place:function(t,e){var i=t.getAttribute("type"),n=a(t);if(e&&e.hasOwnProperty("placeAttributes"))if("Municipality"===i)e.placeAttributes.municipality=n;else if("Bbox"===i){var o=n.split(";");4===o.length&&(e.placeAttributes.bbox={left:parseFloat(o[0]),right:parseFloat(o[2]),top:parseFloat(o[1]),bottom:parseFloat(o[3])})}else"Commune"===i?e.placeAttributes.commune=n:"Departement"===i?e.placeAttributes.department=n:"INSEE"===i?e.placeAttributes.insee=n:"Qualite"===i?e.placeAttributes.quality=n:"Territoire"===i?e.placeAttributes.territory=n:"ID"===i?e.placeAttributes.ID=n:"ID_TR"===i?e.placeAttributes.IDTR=n:"Importance"===i?e.placeAttributes.importance=parseInt(n,10):"Nature"===i?e.placeAttributes.nature=n:"Numero"===i?e.placeAttributes.number=n:"Feuille"===i?e.placeAttributes.sheet=n:"Section"===i?e.placeAttributes.section=n:"CommuneAbsorbee"===i?e.placeAttributes.absorbedCity=n:"Arrondissement"===i?n&&(e.placeAttributes.arrondissement=n):"Type"===i?e.placeAttributes.origin=n:"Prefecture"===i?e.placeAttributes.prefecture=n:"InseeRegion"===i?e.placeAttributes.inseeRegion=n:"InseeDepartment"===i&&(e.placeAttributes.inseeDepartment=n)},PostalCode:function(t,e){e&&e.hasOwnProperty("placeAttributes")&&(e.placeAttributes.postalCode=a(t))},Error:function(t){var n=t.getAttribute("message"),o=t.getAttribute("errorCode"),s=e.getMessage("SERVICE_RESPONSE_EXCEPTION","("+o+") : "+n);throw new i({message:s,type:i.TYPE_SRVERR})}},gml:{pos:function(t,e){var i=a(t);e&&i&&(e.position={x:parseFloat(i.split(" ")[0]),y:parseFloat(i.split(" ")[1])})}},ExceptionReport:function(t){var e={};if(t.hasChildNodes())for(var i,n=t.childNodes,o=0;o0){for(var e={},i=t.attributes,n=0;n0){var e=s(t);for(var i in e)if(e.hasOwnProperty(i)){if("version"===i&&e.version!==c.VERSION)return void console.log("[ReverseGeocodeResponseReader] geocode version is not the expected one : there may be errors in parsing");if("xmlns"===i){if(e[i]!==c.NAMESPACES[c.DEFAULTPREFIX])return void console.log("[ReverseGeocodeResponseReader] geocode response default namespace is not the expected one");continue}var n=i.split(":")[0],o=i.split(":")[1];if("xmlns"===n&&o&&c.NAMESPACES[o]&&c.NAMESPACES[o]!==e[i])return void console.log("[ReverseGeocodeResponseReader] geocode response "+i+" namespace is not the expected one");if("schemaLocation"===o&&c.SCHEMALOCATION!==e[i])return void console.log("[ReverseGeocodeResponseReader] geocode response schema location is not the expected one")}}}var c={};return c.VERSION="1.2",c.NAMESPACES={xmlns:"http://www.opengis.net/xls",gml:"http://www.opengis.net/gml",xls:"http://www.opengis.net/xls",xlsext:"http://www.opengis.net/xlsext",xsi:"http://www.w3.org/2001/XMLSchema-instance"},c.SCHEMALOCATION="http://wxs.ign.fr/schemas/olsAll.xsd",c.DEFAULTPREFIX="xls",c.READERS={xls:{XLS:function(t){var e=new n;return l(t),r(t,e),e},ReverseGeocodedLocation:function(t,e){var i=new o;r(t,i),e&&Array.isArray(e.locations)&&e.locations.push(i)},Address:function(t,e){var i=t.getAttribute("countryCode");e&&i&&(e.type=i),r(t,e)},Building:function(t,e){var i=t.getAttribute("number");e&&e.hasOwnProperty("placeAttributes")&&(i?e.placeAttributes.number=i:t.getAttribute("buildingName")?e.placeAttributes.number=t.getAttribute("buildingName"):t.getAttribute("subdivision")&&(e.placeAttributes.number=t.getAttribute("subdivision")))},Street:function(t,e){"StreetAddress"===e.type?e.placeAttributes.street=a(t):"CadastralParcel"===e.type&&(e.placeAttributes.cadastralParcel=a(t))},Place:function(t,e){var i=t.getAttribute("type"),n=a(t);if(e&&e.hasOwnProperty("placeAttributes"))if("Municipality"===i)e.placeAttributes.municipality=n;else if("Bbox"===i){var o=n.split(";");4===o.length&&(e.placeAttributes.bbox={left:parseFloat(o[0]),right:parseFloat(o[2]),top:parseFloat(o[1]),bottom:parseFloat(o[3])})}else"Commune"===i?e.placeAttributes.commune=n:"Departement"===i?e.placeAttributes.department=n:"INSEE"===i?e.placeAttributes.insee=n:"Qualite"===i?e.placeAttributes.quality=n:"Territoire"===i?e.placeAttributes.territory=n:"ID"===i?e.placeAttributes.ID=n:"ID_TR"===i?e.placeAttributes.IDTR=n:"Importance"===i?e.placeAttributes.importance=parseInt(n,10):"Nature"===i?e.placeAttributes.nature=n:"Numero"===i?e.placeAttributes.number=n:"Feuille"===i?e.placeAttributes.sheet=n:"Section"===i?e.placeAttributes.section=n:"CommuneAbsorbee"===i?e.placeAttributes.absorbedCity=n:"Arrondissement"===i?n&&(e.placeAttributes.arrondissement=n):"Type"===i?e.placeAttributes.origin=n:"Prefecture"===i?e.placeAttributes.prefecture=n:"InseeRegion"===i?e.placeAttributes.inseeRegion=n:"InseeDepartment"===i&&(e.placeAttributes.inseeDepartment=n)},PostalCode:function(t,e){e&&e.hasOwnProperty("placeAttributes")&&(e.placeAttributes.postalCode=a(t))},SearchCentreDistance:function(t,e){e&&(e.searchCenterDistance=parseFloat(t.getAttribute("value")))},Error:function(t){var n=t.getAttribute("message"),o=t.getAttribute("errorCode"),s=e.getMessage("SERVICE_RESPONSE_EXCEPTION","("+o+") : "+n);throw new i({message:s,type:i.TYPE_SRVERR})}},gml:{pos:function(t,e){var i=a(t);e&&i&&(e.position={x:parseFloat(i.split(" ")[0]),y:parseFloat(i.split(" ")[1])})}},xlsext:{ExtendedGeocodeMatchCode:function(t,e){e&&(e.matchType=a(t))}},ExceptionReport:function(t){var e={};if(t.hasChildNodes())for(var i,n=t.childNodes,o=0;o__ROUTEPREFERENCE____GRAPH____WAYPOINTLIST____AVOIDLIST__",routePreference:"__VALUEROUTEPREFERENCE__",graph:'',wayPointList:{container:"__STARTPOINT____VIAPOINT____ENDPOINT__",point:'__X__ __Y__',startPoint:"__POINT__",endPoint:"__POINT__",viaPoint:"__POINT__"},avoidList:{container:"__AVOIDFEATURE__",avoidFeature:"__VALUEAVOIDFEATURE__"}},toString:function(){var t="";if(t=this.template.routePlan,this.options.routePreference){var e=this.template.routePreference;e=e.replace(/__VALUEROUTEPREFERENCE__/,this.options.routePreference),t=t.replace(/__ROUTEPREFERENCE__/g,e)}if(t=t.replace(/__ROUTEPREFERENCE__/g,""),this.options.avoidFeature){for(var i=this.template.avoidList.container,n=[],o=0;o__ROUTEPLAN____ROUTEINSTRUCTIONREQUEST____ROUTEGEOMETRYREQUEST____ROUTEMAPREQUEST__',routeInstructionRequest:'',routeGeometryRequest:"",routeMapRequest:""},addRoute:function(t){t instanceof e&&(this.oRoutePlan=t)},constructor:i,toString:function(){var t="";if(t=this.template.determineRouteRequest,t=t.replace(/__DISTANCEUNIT__/g,this.options.distanceUnit||"KM"),!this.oRoutePlan){var i=this.options.route;if(this.oRoutePlan=new e(i),!this.oRoutePlan)throw new Error("La construction du calcul d'initineraire n'est pas correctement definie !?")}t=t.replace(/__ROUTEPLAN__/g,this.oRoutePlan.toString());var n=this.template.routeInstructionRequest;n=n.replace(/__PROVIDEGEOMETRY__/g,this.options.provideGeometry||!1),n=n.replace(/__PROVIDEBBOX__/g,this.options.provideBoundingBox||!1),t=t.replace(/__ROUTEINSTRUCTIONREQUEST__/g,n);var o=this.template.routeGeometryRequest;t=t.replace(/__ROUTEGEOMETRYREQUEST__/g,o);var s=this.template.routeMapRequest;return t=t.replace(/__ROUTEMAPREQUEST__/g,s),this.strRequest=t,this.strRequest}},i}(i,Et),Ct=void 0,St=function(t,e,i,n){function o(t){if(!(this instanceof o))throw new TypeError("RouteService constructor cannot be called as a function.");this.CLASSNAME="RouteService",this.CLASSTYPE="RouteRequest",e.apply(this,arguments)}return o.prototype=Object.create(e.prototype,{}),o.prototype.constructor=o,o.prototype.addRequest=function(t){if("DetermineRouteRequest"!==t.CLASSNAME)throw new Error("Ce n'est pas un objet de type 'Route Request' !?");this.oRequest=t},o.prototype.addFilter=function(t){t instanceof n&&(this.oFilter=t)},o.prototype.toString=function(){if(!this.oRequest){if(!this.options)throw new Error("Les options ne sont pas renseignées, impossible de construire la requête !");if("RouteRequest"===this.CLASSTYPE){var t={distanceUnit:this.options.distanceUnit||null,provideGeometry:this.options.provideGeometry||null,provideBoundingBox:this.options.provideBoundingBox||null,route:{routePreference:this.options.routePreference||null,startPoint:this.options.startPoint,viaPoint:this.options.viaPoint||null,endPoint:this.options.endPoint,avoidFeature:this.options.avoidFeature||null,graph:this.options.graph||null,expectedStartTime:this.options.expectedStartTime||null}};this.oRequest=new i(t),this.oFilter&&this.oRequest.addFilter(this.oFilter)}}if(!this.oRequest)throw new Error("Type de requête indefini !");return this.strRequest=this.oRequest.toString(),this.strRequest},o}(i,W,Pt,Ct),Mt=function(t,e,i){var n={build:function(t){var n=null,o={startPoint:t.startPoint,endPoint:t.endPoint,viaPoint:t.viaPoints,provideBoundingBox:t.provideBbox,avoidFeature:t.exclusions,expectedStartTime:t.expectedStartTime,distanceUnit:t.distanceUnit,graph:t.graph,provideGeometry:t.geometryInInstructions,routePreference:t.routePreference},s=new i(o),r=new e({srsName:t.srs,maximumResponses:t.maximumResponses});if(r.namespace=!0,r.setService(s),n=r.build(),"GET"==t.httpMethod){var a="qxml="+encodeURIComponent(n).replace(/\-/g,"%2D").replace(/\_/g,"%5F").replace(/\./g,"%2E").replace(/\!/g,"%21").replace(/\~/g,"%7E").replace(/\*/g,"%2A").replace(/\'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29");n=a}return n}};return n}(i,H,St),wt=function(t){function e(t){if(!(this instanceof e))throw new TypeError("RouteParamREST constructor cannot be called as a function.");if(this.options=t||{},this.origin=this.options.startPoint.x+","+this.options.startPoint.y,this.destination=this.options.endPoint.x+","+this.options.endPoint.y,this.waypoints=this.options.viaPoints||null,this.startDateTime=this.options.expectedStartTime||null,this.graphName=this.options.graph,this.srs=this.options.srs,this.exclusions=this.options.exclusions,this.method="TIME",this.options.routePreference){var i=this.options.routePreference;switch(i){case"fastest":this.method="TIME";break;case"shortest":this.method="DISTANCE";break;default:this.method="TIME"}}this.format=this.options.geometryInInstructions?"STANDARDEXT":"STANDARD",this.tolerance=10,this.profileId=null,this.profileName=null}return e.CLASSNAME="RouteParamREST",e.prototype={constructor:e,getWaypoints:function(){if(this.waypoints){for(var t=[],e=0;e\n\n__ID__\t\n\t\t__X__\n\t\t__Y__\n\t\n\t__SRS__\n\t__GRAPHNAME__\n__PROFIL____EXCLUSIONS__\t__METHOD__\n__TIME____DISTANCE__\t__REVERSE__\n\t__SMOOTHING__\n\t__HOLES__\n',id:"\t__IDVALUE__\n",profil:"\t__PROFILID__\n\t__PROFILNAME__\n",exclusions:{container:"\t\n__EXCLUSIONFEATURE__\n\t\n",feature:"\t\t__EXCLUSIONVALUE__"},time:"\t\n",distance:"\t__DISTANCEVALUE__\n"},processRequestString:function(){var t="",e=0;switch(this.mode){case"GET":var n=new i(this.settings),o=n.getParams();for(e=0;e1){for(var o=[],s=0;sError: shape edges cannot cross!",tooltip:{start:"Click to start drawing line.",cont:"Click to continue drawing line.",end:"Click last point to finish line."}},rectangle:{tooltip:{start:"Click and drag to draw rectangle."}},simpleshape:{tooltip:{end:"Release mouse to finish drawing."}}}},edit:{toolbar:{actions:{save:{title:"Save changes.",text:"Save"},cancel:{title:"Cancel editing, discards all changes.",text:"Cancel"}},buttons:{edit:"Edit layers.",editDisabled:"No layers to edit.",remove:"Delete layers.",removeDisabled:"No layers to delete."}},handlers:{edit:{tooltip:{text:"Drag handles, or marker to edit feature.",subtext:"Click cancel to undo changes."}},remove:{tooltip:{text:"Click on a feature to remove"}}}}},L.Draw={},L.Draw.Feature=L.Handler.extend({includes:L.Mixin.Events,initialize:function(t,e){this._map=t,this._container=t._container,this._overlayPane=t._panes.overlayPane,this._popupPane=t._panes.popupPane,e&&e.shapeOptions&&(e.shapeOptions=L.Util.extend({},this.options.shapeOptions,e.shapeOptions)),L.setOptions(this,e)},enable:function(){this._enabled||(L.Handler.prototype.enable.call(this),this.fire("enabled",{handler:this.type}),this._map.fire("draw:drawstart",{layerType:this.type}))},disable:function(){this._enabled&&(L.Handler.prototype.disable.call(this),this._map.fire("draw:drawstop",{layerType:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(L.DomUtil.disableTextSelection(),t.getContainer().focus(),this._tooltip=new L.Tooltip(this._map),L.DomEvent.on(this._container,"keyup",this._cancelDrawing,this))},removeHooks:function(){this._map&&(L.DomUtil.enableTextSelection(),this._tooltip.dispose(),this._tooltip=null,L.DomEvent.off(this._container,"keyup",this._cancelDrawing,this))},setOptions:function(t){L.setOptions(this,t)},_fireCreatedEvent:function(t){this._map.fire("draw:created",{layer:t,layerType:this.type})},_cancelDrawing:function(t){27===t.keyCode&&this.disable()}}),L.Draw.Polyline=L.Draw.Feature.extend({statics:{TYPE:"polyline"},Poly:L.Polyline,options:{allowIntersection:!0,repeatMode:!1,drawError:{color:"#b00b00",timeout:2500},icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon"}),guidelineDistance:20,maxGuideLineLength:4e3,shapeOptions:{stroke:!0,color:"#f06eaa",weight:4,opacity:.5,fill:!1,clickable:!0},metric:!0,feet:!0,showLength:!0,zIndexOffset:2e3},initialize:function(t,e){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this.options.drawError.message=L.drawLocal.draw.handlers.polyline.error,e&&e.drawError&&(e.drawError=L.Util.extend({},this.options.drawError,e.drawError)),this.type=L.Draw.Polyline.TYPE,L.Draw.Feature.prototype.initialize.call(this,t,e)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._markers=[],this._markerGroup=new L.LayerGroup,this._map.addLayer(this._markerGroup),this._poly=new L.Polyline([],this.options.shapeOptions),this._tooltip.updateContent(this._getTooltipText()),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("mousedown",this._onMouseDown,this).on("mouseout",this._onMouseOut,this).on("mouseup",this._onMouseUp,this).on("mousemove",this._onMouseMove,this).addTo(this._map),this._map.on("mouseup",this._onMouseUp,this).on("mousemove",this._onMouseMove,this).on("zoomlevelschange",this._onZoomEnd,this).on("click",this._onTouch,this).on("zoomend",this._onZoomEnd,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._clearHideErrorTimeout(),this._cleanUpShape(),this._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers,this._map.removeLayer(this._poly),delete this._poly,this._mouseMarker.off("mousedown",this._onMouseDown,this).off("mouseout",this._onMouseOut,this).off("mouseup",this._onMouseUp,this).off("mousemove",this._onMouseMove,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._clearGuides(),this._map.off("mouseup",this._onMouseUp,this).off("mousemove",this._onMouseMove,this).off("mouseup",this._onMouseUp,this).off("zoomend",this._onZoomEnd,this).off("click",this._onTouch,this)},deleteLastVertex:function(){if(!(this._markers.length<=1)){var t=this._markers.pop(),e=this._poly,i=this._poly.spliceLatLngs(e.getLatLngs().length-1,1)[0];this._markerGroup.removeLayer(t),e.getLatLngs().length<2&&this._map.removeLayer(e),this._vertexChanged(i,!1)}},addVertex:function(t){var e=this._markers.length;return e>0&&!this.options.allowIntersection&&this._poly.newLatLngIntersects(t)?void this._showErrorTooltip():(this._errorShown&&this._hideErrorTooltip(),this._markers.push(this._createMarker(t)),this._poly.addLatLng(t),2===this._poly.getLatLngs().length&&this._map.addLayer(this._poly),void this._vertexChanged(t,!0))},completeShape:function(){this._markers.length<=1||(this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable())},_finishShape:function(){var t=this._poly.newLatLngIntersects(this._poly.getLatLngs()[0],!0);return!this.options.allowIntersection&&t||!this._shapeIsValid()?void this._showErrorTooltip():(this._fireCreatedEvent(),this.disable(),void(this.options.repeatMode&&this.enable()))},_shapeIsValid:function(){return!0},_onZoomEnd:function(){this._updateGuide()},_onMouseMove:function(t){var e=this._map.mouseEventToLayerPoint(t.originalEvent),i=this._map.layerPointToLatLng(e);this._currentLatLng=i,this._updateTooltip(i),this._updateGuide(e),this._mouseMarker.setLatLng(i),L.DomEvent.preventDefault(t.originalEvent)},_vertexChanged:function(t,e){this._map.fire("draw:drawvertex",{layers:this._markerGroup}),this._updateFinishHandler(),this._updateRunningMeasure(t,e),this._clearGuides(),this._updateTooltip()},_onMouseDown:function(t){var e=t.originalEvent;this._mouseDownOrigin=L.point(e.clientX,e.clientY)},_onMouseUp:function(e){if(this._mouseDownOrigin){var i=L.point(e.originalEvent.clientX,e.originalEvent.clientY).distanceTo(this._mouseDownOrigin);Math.abs(i)<9*(t.devicePixelRatio||1)&&this.addVertex(e.latlng)}this._mouseDownOrigin=null},_onTouch:function(t){L.Browser.touch&&(this._onMouseDown(t),this._onMouseUp(t))},_onMouseOut:function(){this._tooltip&&this._tooltip._onMouseOut.call(this._tooltip)},_updateFinishHandler:function(){var t=this._markers.length;t>1&&this._markers[t-1].on("click",this._finishShape,this),t>2&&this._markers[t-2].off("click",this._finishShape,this)},_createMarker:function(t){var e=new L.Marker(t,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset});return this._markerGroup.addLayer(e),e},_updateGuide:function(t){var e=this._markers.length;e>0&&(t=t||this._map.latLngToLayerPoint(this._currentLatLng),this._clearGuides(),this._drawGuide(this._map.latLngToLayerPoint(this._markers[e-1].getLatLng()),t))},_updateTooltip:function(t){var e=this._getTooltipText();t&&this._tooltip.updatePosition(t),this._errorShown||this._tooltip.updateContent(e)},_drawGuide:function(t,e){var i,n,o,s=Math.floor(Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))),r=this.options.guidelineDistance,a=this.options.maxGuideLineLength,l=s>a?s-a:r;for(this._guidesContainer||(this._guidesContainer=L.DomUtil.create("div","leaflet-draw-guides",this._overlayPane));s>l;l+=this.options.guidelineDistance)i=l/s,n={x:Math.floor(t.x*(1-i)+i*e.x),y:Math.floor(t.y*(1-i)+i*e.y)},o=L.DomUtil.create("div","leaflet-draw-guide-dash",this._guidesContainer),o.style.backgroundColor=this._errorShown?this.options.drawError.color:this.options.shapeOptions.color,L.DomUtil.setPosition(o,n)},_updateGuideColor:function(t){if(this._guidesContainer)for(var e=0,i=this._guidesContainer.childNodes.length;i>e;e++)this._guidesContainer.childNodes[e].style.backgroundColor=t},_clearGuides:function(){if(this._guidesContainer)for(;this._guidesContainer.firstChild;)this._guidesContainer.removeChild(this._guidesContainer.firstChild)},_getTooltipText:function(){var t,e,i=this.options.showLength;return 0===this._markers.length?t={text:L.drawLocal.draw.handlers.polyline.tooltip.start}:(e=i?this._getMeasurementString():"",t=1===this._markers.length?{text:L.drawLocal.draw.handlers.polyline.tooltip.cont,subtext:e}:{text:L.drawLocal.draw.handlers.polyline.tooltip.end,subtext:e}),t},_updateRunningMeasure:function(t,e){var i,n,o=this._markers.length;1===this._markers.length?this._measurementRunningTotal=0:(i=o-(e?2:1),n=t.distanceTo(this._markers[i].getLatLng()),this._measurementRunningTotal+=n*(e?1:-1))},_getMeasurementString:function(){var t,e=this._currentLatLng,i=this._markers[this._markers.length-1].getLatLng();return t=this._measurementRunningTotal+e.distanceTo(i),L.GeometryUtil.readableDistance(t,this.options.metric,this.options.feet)},_showErrorTooltip:function(){this._errorShown=!0,this._tooltip.showAsError().updateContent({text:this.options.drawError.message}),this._updateGuideColor(this.options.drawError.color),this._poly.setStyle({color:this.options.drawError.color}),this._clearHideErrorTimeout(),this._hideErrorTimeout=setTimeout(L.Util.bind(this._hideErrorTooltip,this),this.options.drawError.timeout)},_hideErrorTooltip:function(){this._errorShown=!1,this._clearHideErrorTimeout(),this._tooltip.removeError().updateContent(this._getTooltipText()),this._updateGuideColor(this.options.shapeOptions.color),this._poly.setStyle({color:this.options.shapeOptions.color})},_clearHideErrorTimeout:function(){this._hideErrorTimeout&&(clearTimeout(this._hideErrorTimeout),this._hideErrorTimeout=null)},_cleanUpShape:function(){this._markers.length>1&&this._markers[this._markers.length-1].off("click",this._finishShape,this)},_fireCreatedEvent:function(){var t=new this.Poly(this._poly.getLatLngs(),this.options.shapeOptions);L.Draw.Feature.prototype._fireCreatedEvent.call(this,t)}}),L.Draw.Polygon=L.Draw.Polyline.extend({statics:{TYPE:"polygon"},Poly:L.Polygon,options:{showArea:!1,shapeOptions:{stroke:!0,color:"#f06eaa",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0}},initialize:function(t,e){L.Draw.Polyline.prototype.initialize.call(this,t,e),this.type=L.Draw.Polygon.TYPE},_updateFinishHandler:function(){var t=this._markers.length;1===t&&this._markers[0].on("click",this._finishShape,this),t>2&&(this._markers[t-1].on("dblclick",this._finishShape,this),t>3&&this._markers[t-2].off("dblclick",this._finishShape,this))},_getTooltipText:function(){var t,e;return 0===this._markers.length?t=L.drawLocal.draw.handlers.polygon.tooltip.start:this._markers.length<3?t=L.drawLocal.draw.handlers.polygon.tooltip.cont:(t=L.drawLocal.draw.handlers.polygon.tooltip.end,e=this._getMeasurementString()),{text:t,subtext:e}},_getMeasurementString:function(){var t=this._area;return t?L.GeometryUtil.readableArea(t,this.options.metric):null},_shapeIsValid:function(){return this._markers.length>=3},_vertexChanged:function(t,e){var i;!this.options.allowIntersection&&this.options.showArea&&(i=this._poly.getLatLngs(),this._area=L.GeometryUtil.geodesicArea(i)),L.Draw.Polyline.prototype._vertexChanged.call(this,t,e)},_cleanUpShape:function(){var t=this._markers.length;t>0&&(this._markers[0].off("click",this._finishShape,this),t>2&&this._markers[t-1].off("dblclick",this._finishShape,this))}}),L.SimpleShape={},L.Draw.SimpleShape=L.Draw.Feature.extend({options:{repeatMode:!1},initialize:function(t,e){this._endLabelText=L.drawLocal.draw.handlers.simpleshape.tooltip.end,L.Draw.Feature.prototype.initialize.call(this,t,e)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._mapDraggable=this._map.dragging.enabled(),this._mapDraggable&&this._map.dragging.disable(),this._container.style.cursor="crosshair",this._tooltip.updateContent({text:this._initialLabelText}),this._map.on("mousedown",this._onMouseDown,this).on("mousemove",this._onMouseMove,this).on("touchstart",this._onMouseDown,this).on("touchmove",this._onMouseMove,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._mapDraggable&&this._map.dragging.enable(),this._container.style.cursor="",this._map.off("mousedown",this._onMouseDown,this).off("mousemove",this._onMouseMove,this).off("touchstart",this._onMouseDown,this).off("touchmove",this._onMouseMove,this),L.DomEvent.off(e,"mouseup",this._onMouseUp,this),L.DomEvent.off(e,"touchend",this._onMouseUp,this),this._shape&&(this._map.removeLayer(this._shape),delete this._shape)),this._isDrawing=!1},_getTooltipText:function(){return{text:this._endLabelText}},_onMouseDown:function(t){this._isDrawing=!0,this._startLatLng=t.latlng,L.DomEvent.on(e,"mouseup",this._onMouseUp,this).on(e,"touchend",this._onMouseUp,this).preventDefault(t.originalEvent)},_onMouseMove:function(t){var e=t.latlng;this._tooltip.updatePosition(e),this._isDrawing&&(this._tooltip.updateContent(this._getTooltipText()),this._drawShape(e))},_onMouseUp:function(){this._shape&&this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()}}),L.Draw.Rectangle=L.Draw.SimpleShape.extend({statics:{TYPE:"rectangle"},options:{shapeOptions:{stroke:!0,color:"#f06eaa",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},metric:!0},initialize:function(t,e){this.type=L.Draw.Rectangle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.rectangle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,t,e)},_drawShape:function(t){this._shape?this._shape.setBounds(new L.LatLngBounds(this._startLatLng,t)):(this._shape=new L.Rectangle(new L.LatLngBounds(this._startLatLng,t),this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var t=new L.Rectangle(this._shape.getBounds(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,t)},_getTooltipText:function(){var t,e,i,n=L.Draw.SimpleShape.prototype._getTooltipText.call(this),o=this._shape;return o&&(t=this._shape.getLatLngs(),e=L.GeometryUtil.geodesicArea(t),i=L.GeometryUtil.readableArea(e,this.options.metric)),{text:n.text,subtext:i}}}),L.Draw.Circle=L.Draw.SimpleShape.extend({statics:{TYPE:"circle"},options:{shapeOptions:{stroke:!0,color:"#f06eaa",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showRadius:!0,metric:!0,feet:!0},initialize:function(t,e){this.type=L.Draw.Circle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,t,e)},_drawShape:function(t){this._shape?this._shape.setRadius(this._startLatLng.distanceTo(t)):(this._shape=new L.Circle(this._startLatLng,this._startLatLng.distanceTo(t),this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var t=new L.Circle(this._startLatLng,this._shape.getRadius(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,t)},_onMouseMove:function(t){var e,i=t.latlng,n=this.options.showRadius,o=this.options.metric;this._tooltip.updatePosition(i),this._isDrawing&&(this._drawShape(i),e=this._shape.getRadius().toFixed(1),this._tooltip.updateContent({text:this._endLabelText,subtext:n?L.drawLocal.draw.handlers.circle.radius+": "+L.GeometryUtil.readableDistance(e,o,this.options.feet):""}))}}),L.Draw.Marker=L.Draw.Feature.extend({statics:{TYPE:"marker"},options:{icon:new L.Icon.Default,repeatMode:!1,zIndexOffset:2e3},initialize:function(t,e){this.type=L.Draw.Marker.TYPE,L.Draw.Feature.prototype.initialize.call(this,t,e)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._tooltip.updateContent({text:L.drawLocal.draw.handlers.marker.tooltip.start}),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("click",this._onClick,this).addTo(this._map),this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onTouch,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._marker&&(this._marker.off("click",this._onClick,this),this._map.off("click",this._onClick,this).off("click",this._onTouch,this).removeLayer(this._marker),delete this._marker),this._mouseMarker.off("click",this._onClick,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._map.off("mousemove",this._onMouseMove,this))},_onMouseMove:function(t){var e=t.latlng;this._tooltip.updatePosition(e),this._mouseMarker.setLatLng(e),this._marker?(e=this._mouseMarker.getLatLng(),this._marker.setLatLng(e)):(this._marker=new L.Marker(e,{icon:this.options.icon,zIndexOffset:this.options.zIndexOffset}),this._marker.on("click",this._onClick,this),this._map.on("click",this._onClick,this).addLayer(this._marker))},_onClick:function(){this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()},_onTouch:function(t){this._onMouseMove(t),this._onClick()},_fireCreatedEvent:function(){var t=new L.Marker.Touch(this._marker.getLatLng(),{icon:this.options.icon});L.Draw.Feature.prototype._fireCreatedEvent.call(this,t)}}),L.Edit=L.Edit||{},L.Edit.Marker=L.Handler.extend({initialize:function(t,e){this._marker=t,L.setOptions(this,e)},addHooks:function(){var t=this._marker;t.dragging.enable(),t.on("dragend",this._onDragEnd,t),this._toggleMarkerHighlight()},removeHooks:function(){var t=this._marker;t.dragging.disable(),t.off("dragend",this._onDragEnd,t),this._toggleMarkerHighlight()},_onDragEnd:function(t){var e=t.target;e.edited=!0},_toggleMarkerHighlight:function(){var t=this._marker._icon;t&&(t.style.display="none",L.DomUtil.hasClass(t,"leaflet-edit-marker-selected")?(L.DomUtil.removeClass(t,"leaflet-edit-marker-selected"),this._offsetMarker(t,-4)):(L.DomUtil.addClass(t,"leaflet-edit-marker-selected"),this._offsetMarker(t,4)),t.style.display="")},_offsetMarker:function(t,e){var i=parseInt(t.style.marginTop,10)-e,n=parseInt(t.style.marginLeft,10)-e;t.style.marginTop=i+"px",t.style.marginLeft=n+"px"}}),L.Marker.addInitHook(function(){L.Edit.Marker&&(this.editing=new L.Edit.Marker(this),this.options.editable&&this.editing.enable())}),L.Edit=L.Edit||{},L.Edit.Poly=L.Handler.extend({options:{},initialize:function(t,e){this.latlngs=[t._latlngs],t._holes&&(this.latlngs=this.latlngs.concat(t._holes)),this._verticesHandlers=[];for(var i=0;it;t++)n=this._createMarker(o[t],t),n.on("click",this._onMarkerClick,this),this._markers.push(n);var s,r;for(t=0,e=i-1;i>t;e=t++)(0!==t||L.Polygon&&this._poly instanceof L.Polygon)&&(s=this._markers[e],r=this._markers[t],this._createMiddleMarker(s,r),this._updatePrevNext(s,r))},_createMarker:function(t,e){var i=new L.Marker.Touch(t,{draggable:!0,icon:this.options.icon});return i._origLatLng=t,i._index=e,i.on("dragstart",this._onMarkerDragStart,this).on("drag",this._onMarkerDrag,this).on("dragend",this._fireEdit,this).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._fireEdit,this).on("MSPointerUp",this._fireEdit,this),this._markerGroup.addLayer(i),i},_onMarkerDragStart:function(){this._poly.fire("editstart")},_spliceLatLngs:function(){var t=[].splice.apply(this._latlngs,arguments);return this._poly._convertLatLngs(this._latlngs,!0),this._poly.redraw(),t},_removeMarker:function(t){var e=t._index;this._markerGroup.removeLayer(t),this._markers.splice(e,1),this._spliceLatLngs(e,1),this._updateIndexes(e,-1),t.off("dragstart",this._onMarkerDragStart,this).off("drag",this._onMarkerDrag,this).off("dragend",this._fireEdit,this).off("touchmove",this._onMarkerDrag,this).off("touchend",this._fireEdit,this).off("click",this._onMarkerClick,this)},_fireEdit:function(){this._poly.edited=!0,this._poly.fire("edit"),this._poly._map.fire("draw:editvertex",{layers:this._markerGroup})},_onMarkerDrag:function(t){var e=t.target;L.extend(e._origLatLng,e._latlng),e._middleLeft&&e._middleLeft.setLatLng(this._getMiddleLatLng(e._prev,e)),e._middleRight&&e._middleRight.setLatLng(this._getMiddleLatLng(e,e._next)),this._poly.redraw(),this._poly.fire("editdrag")},_onMarkerClick:function(t){var e=L.Polygon&&this._poly instanceof L.Polygon?4:3,i=t.target;this._latlngs.lengtht&&(i._index+=e)})},_createMiddleMarker:function(t,e){var i,n,o,s=this._getMiddleLatLng(t,e),r=this._createMarker(s);r.setOpacity(.6),t._middleRight=e._middleLeft=r,n=function(){var n=e._index;r._index=n,r.off("click",i,this).on("click",this._onMarkerClick,this),s.lat=r.getLatLng().lat,s.lng=r.getLatLng().lng,this._spliceLatLngs(n,0,s),this._markers.splice(n,0,r),r.setOpacity(1),this._updateIndexes(n,1),e._index++,this._updatePrevNext(t,r),this._updatePrevNext(r,e),this._poly.fire("editstart")},o=function(){r.off("dragstart",n,this),r.off("dragend",o,this),r.off("touchmove",n,this),this._createMiddleMarker(t,r),this._createMiddleMarker(r,e)},i=function(){n.call(this),o.call(this),this._fireEdit()},r.on("click",i,this).on("dragstart",n,this).on("dragend",o,this).on("touchmove",n,this),this._markerGroup.addLayer(r)},_updatePrevNext:function(t,e){t&&(t._next=e),e&&(e._prev=t)},_getMiddleLatLng:function(t,e){var i=this._poly._map,n=i.project(t.getLatLng()),o=i.project(e.getLatLng());return i.unproject(n._add(o)._divideBy(2))}}),L.Polyline.addInitHook(function(){this.editing||(L.Edit.Poly&&(this.editing=new L.Edit.Poly(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()}))}),L.Edit=L.Edit||{},L.Edit.SimpleShape=L.Handler.extend({options:{moveIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-move"}),resizeIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize"}),touchMoveIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-move leaflet-touch-icon"}),touchResizeIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize leaflet-touch-icon"})},initialize:function(t,e){L.Browser.touch&&(this.options.moveIcon=this.options.touchMoveIcon,this.options.resizeIcon=this.options.touchResizeIcon),this._shape=t,L.Util.setOptions(this,e)},addHooks:function(){var t=this._shape;this._shape._map&&(this._map=this._shape._map,t.setStyle(t.options.editing),t._map&&(this._map=t._map,this._markerGroup||this._initMarkers(),this._map.addLayer(this._markerGroup)))},removeHooks:function(){var t=this._shape;if(t.setStyle(t.options.original),t._map){ +this._unbindMarker(this._moveMarker);for(var e=0,i=this._resizeMarkers.length;i>e;e++)this._unbindMarker(this._resizeMarkers[e]);this._resizeMarkers=null,this._map.removeLayer(this._markerGroup),delete this._markerGroup}this._map=null},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._createMoveMarker(),this._createResizeMarker()},_createMoveMarker:function(){},_createResizeMarker:function(){},_createMarker:function(t,e){var i=new L.Marker.Touch(t,{draggable:!0,icon:e,zIndexOffset:10});return this._bindMarker(i),this._markerGroup.addLayer(i),i},_bindMarker:function(t){t.on("dragstart",this._onMarkerDragStart,this).on("drag",this._onMarkerDrag,this).on("dragend",this._onMarkerDragEnd,this).on("touchstart",this._onTouchStart,this).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onTouchEnd,this).on("MSPointerUp",this._onTouchEnd,this)},_unbindMarker:function(t){t.off("dragstart",this._onMarkerDragStart,this).off("drag",this._onMarkerDrag,this).off("dragend",this._onMarkerDragEnd,this).off("touchstart",this._onTouchStart,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onTouchEnd,this).off("MSPointerUp",this._onTouchEnd,this)},_onMarkerDragStart:function(t){var e=t.target;e.setOpacity(0),this._shape.fire("editstart")},_fireEdit:function(){this._shape.edited=!0,this._shape.fire("edit")},_onMarkerDrag:function(t){var e=t.target,i=e.getLatLng();e===this._moveMarker?this._move(i):this._resize(i),this._shape.redraw(),this._shape.fire("editdrag")},_onMarkerDragEnd:function(t){var e=t.target;e.setOpacity(1),this._fireEdit()},_onTouchStart:function(t){if(L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,t),"function"==typeof this._getCorners){var e=this._getCorners(),i=t.target,n=i._cornerIndex;i.setOpacity(0),this._oppositeCorner=e[(n+2)%4],this._toggleCornerMarkers(0,n)}this._shape.fire("editstart")},_onTouchMove:function(t){var e=this._map.mouseEventToLayerPoint(t.originalEvent.touches[0]),i=this._map.layerPointToLatLng(e),n=t.target;return n===this._moveMarker?this._move(i):this._resize(i),this._shape.redraw(),!1},_onTouchEnd:function(t){var e=t.target;e.setOpacity(1),this.updateMarkers(),this._fireEdit()},_move:function(){},_resize:function(){}}),L.Edit=L.Edit||{},L.Edit.Rectangle=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var t=this._shape.getBounds(),e=t.getCenter();this._moveMarker=this._createMarker(e,this.options.moveIcon)},_createResizeMarker:function(){var t=this._getCorners();this._resizeMarkers=[];for(var e=0,i=t.length;i>e;e++)this._resizeMarkers.push(this._createMarker(t[e],this.options.resizeIcon)),this._resizeMarkers[e]._cornerIndex=e},_onMarkerDragStart:function(t){L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,t);var e=this._getCorners(),i=t.target,n=i._cornerIndex;this._oppositeCorner=e[(n+2)%4],this._toggleCornerMarkers(0,n)},_onMarkerDragEnd:function(t){var e,i,n=t.target;n===this._moveMarker&&(e=this._shape.getBounds(),i=e.getCenter(),n.setLatLng(i)),this._toggleCornerMarkers(1),this._repositionCornerMarkers(),L.Edit.SimpleShape.prototype._onMarkerDragEnd.call(this,t)},_move:function(t){for(var e,i=this._shape.getLatLngs(),n=this._shape.getBounds(),o=n.getCenter(),s=[],r=0,a=i.length;a>r;r++)e=[i[r].lat-o.lat,i[r].lng-o.lng],s.push([t.lat+e[0],t.lng+e[1]]);this._shape.setLatLngs(s),this._repositionCornerMarkers()},_resize:function(t){var e;this._shape.setBounds(L.latLngBounds(t,this._oppositeCorner)),e=this._shape.getBounds(),this._moveMarker.setLatLng(e.getCenter())},_getCorners:function(){var t=this._shape.getBounds(),e=t.getNorthWest(),i=t.getNorthEast(),n=t.getSouthEast(),o=t.getSouthWest();return[e,i,n,o]},_toggleCornerMarkers:function(t){for(var e=0,i=this._resizeMarkers.length;i>e;e++)this._resizeMarkers[e].setOpacity(t)},_repositionCornerMarkers:function(){for(var t=this._getCorners(),e=0,i=this._resizeMarkers.length;i>e;e++)this._resizeMarkers[e].setLatLng(t[e])}}),L.Rectangle.addInitHook(function(){L.Edit.Rectangle&&(this.editing=new L.Edit.Rectangle(this),this.options.editable&&this.editing.enable())}),L.Edit=L.Edit||{},L.Edit.Circle=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var t=this._shape.getLatLng();this._moveMarker=this._createMarker(t,this.options.moveIcon)},_createResizeMarker:function(){var t=this._shape.getLatLng(),e=this._getResizeMarkerPoint(t);this._resizeMarkers=[],this._resizeMarkers.push(this._createMarker(e,this.options.resizeIcon))},_getResizeMarkerPoint:function(t){var e=this._shape._radius*Math.cos(Math.PI/4),i=this._map.project(t);return this._map.unproject([i.x+e,i.y-e])},_move:function(t){var e=this._getResizeMarkerPoint(t);this._resizeMarkers[0].setLatLng(e),this._shape.setLatLng(t)},_resize:function(t){var e=this._moveMarker.getLatLng(),i=e.distanceTo(t);this._shape.setRadius(i)}}),L.Circle.addInitHook(function(){L.Edit.Circle&&(this.editing=new L.Edit.Circle(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()})}),L.Map.mergeOptions({touchExtend:!0}),L.Map.TouchExtend=L.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane},addHooks:function(){L.DomEvent.on(this._container,"touchstart",this._onTouchStart,this),L.DomEvent.on(this._container,"touchend",this._onTouchEnd,this),L.DomEvent.on(this._container,"touchmove",this._onTouchMove,this),this._detectIE()?(L.DomEvent.on(this._container,"MSPointerDown",this._onTouchStart,this),L.DomEvent.on(this._container,"MSPointerUp",this._onTouchEnd,this),L.DomEvent.on(this._container,"MSPointerMove",this._onTouchMove,this),L.DomEvent.on(this._container,"MSPointerCancel",this._onTouchCancel,this)):(L.DomEvent.on(this._container,"touchcancel",this._onTouchCancel,this),L.DomEvent.on(this._container,"touchleave",this._onTouchLeave,this))},removeHooks:function(){L.DomEvent.off(this._container,"touchstart",this._onTouchStart),L.DomEvent.off(this._container,"touchend",this._onTouchEnd),L.DomEvent.off(this._container,"touchmove",this._onTouchMove),this._detectIE()?(L.DomEvent.off(this._container,"MSPointerDowm",this._onTouchStart),L.DomEvent.off(this._container,"MSPointerUp",this._onTouchEnd),L.DomEvent.off(this._container,"MSPointerMove",this._onTouchMove),L.DomEvent.off(this._container,"MSPointerCancel",this._onTouchCancel)):(L.DomEvent.off(this._container,"touchcancel",this._onTouchCancel),L.DomEvent.off(this._container,"touchleave",this._onTouchLeave))},_touchEvent:function(t,e){var i={};if("undefined"!=typeof t.touches){if(!t.touches.length)return;i=t.touches[0]}else{if("touch"!==t.pointerType)return;if(i=t,!this._filterClick(t))return}var n=this._map.mouseEventToContainerPoint(i),o=this._map.mouseEventToLayerPoint(i),s=this._map.layerPointToLatLng(o);this._map.fire(e,{latlng:s,layerPoint:o,containerPoint:n,pageX:i.pageX,pageY:i.pageY,originalEvent:t})},_filterClick:function(t){var e=t.timeStamp||t.originalEvent.timeStamp,i=L.DomEvent._lastClick&&e-L.DomEvent._lastClick;return i&&i>100&&500>i||t.target._simulatedClick&&!t._simulated?(L.DomEvent.stop(t),!1):(L.DomEvent._lastClick=e,!0)},_onTouchStart:function(t){if(this._map._loaded){var e="touchstart";this._touchEvent(t,e)}},_onTouchEnd:function(t){if(this._map._loaded){var e="touchend";this._touchEvent(t,e)}},_onTouchCancel:function(t){if(this._map._loaded){var e="touchcancel";this._detectIE()&&(e="pointercancel"),this._touchEvent(t,e)}},_onTouchLeave:function(t){if(this._map._loaded){var e="touchleave";this._touchEvent(t,e)}},_onTouchMove:function(t){if(this._map._loaded){var e="touchmove";this._touchEvent(t,e)}},_detectIE:function(){var e=t.navigator.userAgent,i=e.indexOf("MSIE ");if(i>0)return parseInt(e.substring(i+5,e.indexOf(".",i)),10);var n=e.indexOf("Trident/");if(n>0){var o=e.indexOf("rv:");return parseInt(e.substring(o+3,e.indexOf(".",o)),10)}var s=e.indexOf("Edge/");return s>0&&parseInt(e.substring(s+5,e.indexOf(".",s)),10)}}),L.Map.addInitHook("addHandler","touchExtend",L.Map.TouchExtend),L.Marker.Touch=L.Marker.extend({_initInteraction:function(){if(this.options.clickable){var t=this._icon,e=["dblclick","mousedown","mouseover","mouseout","contextmenu","touchstart","touchend","touchmove"];this._detectIE?e.concat(["MSPointerDown","MSPointerUp","MSPointerMove","MSPointerCancel"]):e.concat(["touchcancel"]),L.DomUtil.addClass(t,"leaflet-clickable"),L.DomEvent.on(t,"click",this._onMouseClick,this),L.DomEvent.on(t,"keypress",this._onKeyPress,this);for(var i=0;i0)return parseInt(e.substring(i+5,e.indexOf(".",i)),10);var n=e.indexOf("Trident/");if(n>0){var o=e.indexOf("rv:");return parseInt(e.substring(o+3,e.indexOf(".",o)),10)}var s=e.indexOf("Edge/");return s>0&&parseInt(e.substring(s+5,e.indexOf(".",s)),10)}}),L.LatLngUtil={cloneLatLngs:function(t){for(var e=[],i=0,n=t.length;n>i;i++)e.push(this.cloneLatLng(t[i]));return e},cloneLatLng:function(t){return L.latLng(t.lat,t.lng)}},L.GeometryUtil=L.extend(L.GeometryUtil||{},{geodesicArea:function(t){var e,i,n=t.length,o=0,s=L.LatLng.DEG_TO_RAD;if(n>2){for(var r=0;n>r;r++)e=t[r],i=t[(r+1)%n],o+=(i.lng-e.lng)*s*(2+Math.sin(e.lat*s)+Math.sin(i.lat*s));o=6378137*o*6378137/2}return Math.abs(o)},readableArea:function(t,e){var i;return e?i=t>=1e4?(1e-4*t).toFixed(2)+" ha":t.toFixed(2)+" m²":(t/=.836127,i=t>=3097600?(t/3097600).toFixed(2)+" mi²":t>=4840?(t/4840).toFixed(2)+" acres":Math.ceil(t)+" yd²"),i},readableDistance:function(t,e,i){var n;if(e)n=t>1e3?(t/1e3).toFixed(2)+" km":Math.ceil(t)+" m";else if(t*=1.09361,t>1760)n=(t/1760).toFixed(2)+" miles";else{var o=" yd";i&&(t=3*t,o=" ft"),n=Math.ceil(t)+o}return n}}),L.Util.extend(L.LineUtil,{segmentsIntersect:function(t,e,i,n){return this._checkCounterclockwise(t,i,n)!==this._checkCounterclockwise(e,i,n)&&this._checkCounterclockwise(t,e,i)!==this._checkCounterclockwise(t,e,n)},_checkCounterclockwise:function(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}}),L.Polyline.include({intersects:function(){var t,e,i,n=this._originalPoints,o=n?n.length:0;if(this._tooFewPointsForIntersection())return!1;for(t=o-1;t>=3;t--)if(e=n[t-1],i=n[t],this._lineSegmentsIntersectsRange(e,i,t-2))return!0;return!1},newLatLngIntersects:function(t,e){return!!this._map&&this.newPointIntersects(this._map.latLngToLayerPoint(t),e)},newPointIntersects:function(t,e){var i=this._originalPoints,n=i?i.length:0,o=i?i[n-1]:null,s=n-2;return!this._tooFewPointsForIntersection(1)&&this._lineSegmentsIntersectsRange(o,t,s,e?1:0)},_tooFewPointsForIntersection:function(t){var e=this._originalPoints,i=e?e.length:0;return i+=t||0,!this._originalPoints||3>=i},_lineSegmentsIntersectsRange:function(t,e,i,n){var o,s,r=this._originalPoints;n=n||0;for(var a=i;a>n;a--)if(o=r[a-1],s=r[a],L.LineUtil.segmentsIntersect(t,e,o,s))return!0;return!1}}),L.Polygon.include({intersects:function(){var t,e,i,n,o,s=this._originalPoints;return!this._tooFewPointsForIntersection()&&(!!(t=L.Polyline.prototype.intersects.call(this))||(e=s.length,i=s[0],n=s[e-1],o=e-2,this._lineSegmentsIntersectsRange(n,i,o,1)))}}),L.Control.Draw=L.Control.extend({options:{position:"topleft",draw:{},edit:!1},initialize:function(t){if(L.version<"0.7")throw new Error("Leaflet.draw 0.2.3+ requires Leaflet 0.7.0+. Download latest from https://github.com/Leaflet/Leaflet/");L.Control.prototype.initialize.call(this,t);var e;this._toolbars={},L.DrawToolbar&&this.options.draw&&(e=new L.DrawToolbar(this.options.draw),this._toolbars[L.DrawToolbar.TYPE]=e,this._toolbars[L.DrawToolbar.TYPE].on("enable",this._toolbarEnabled,this)),L.EditToolbar&&this.options.edit&&(e=new L.EditToolbar(this.options.edit),this._toolbars[L.EditToolbar.TYPE]=e,this._toolbars[L.EditToolbar.TYPE].on("enable",this._toolbarEnabled,this)),L.toolbar=this},onAdd:function(t){var e,i=L.DomUtil.create("div","leaflet-draw"),n=!1,o="leaflet-draw-toolbar-top";for(var s in this._toolbars)this._toolbars.hasOwnProperty(s)&&(e=this._toolbars[s].addToolbar(t),e&&(n||(L.DomUtil.hasClass(e,o)||L.DomUtil.addClass(e.childNodes[0],o),n=!0),i.appendChild(e)));return i},onRemove:function(){for(var t in this._toolbars)this._toolbars.hasOwnProperty(t)&&this._toolbars[t].removeToolbar()},setDrawingOptions:function(t){for(var e in this._toolbars)this._toolbars[e]instanceof L.DrawToolbar&&this._toolbars[e].setOptions(t)},_toolbarEnabled:function(t){var e=t.target;for(var i in this._toolbars)this._toolbars[i]!==e&&this._toolbars[i].disable()}}),L.Map.mergeOptions({drawControlTooltips:!0,drawControl:!1}),L.Map.addInitHook(function(){this.options.drawControl&&(this.drawControl=new L.Control.Draw,this.addControl(this.drawControl))}),L.Toolbar=L.Class.extend({includes:[L.Mixin.Events],initialize:function(t){L.setOptions(this,t),this._modes={},this._actionButtons=[],this._activeMode=null},enabled:function(){return null!==this._activeMode},disable:function(){this.enabled()&&this._activeMode.handler.disable()},addToolbar:function(t){var e,i=L.DomUtil.create("div","leaflet-draw-section"),n=0,o=this._toolbarClass||"",s=this.getModeHandlers(t);for(this._toolbarContainer=L.DomUtil.create("div","leaflet-draw-toolbar leaflet-bar"),this._map=t,e=0;ee;e++)this._disposeButton(this._actionButtons[e].button,this._actionButtons[e].callback,this);this._actionButtons=[],this._actionsContainer=null},_initModeHandler:function(t,e,i,n,o){var s=t.type;this._modes[s]={},this._modes[s].handler=t,this._modes[s].button=this._createButton({type:s,title:o,className:n+"-"+s,container:e,callback:this._modes[s].handler.enable,context:this._modes[s].handler}),this._modes[s].buttonIndex=i,this._modes[s].handler.on("enabled",this._handlerActivated,this).on("disabled",this._handlerDeactivated,this)},_createButton:function(t){var e=L.DomUtil.create("a",t.className||"",t.container);return e.href="#",t.text&&(e.innerHTML=t.text),t.title&&(e.title=t.title),L.DomEvent.on(e,"click",L.DomEvent.stopPropagation).on(e,"mousedown",L.DomEvent.stopPropagation).on(e,"dblclick",L.DomEvent.stopPropagation).on(e,"click",L.DomEvent.preventDefault).on(e,"click",t.callback,t.context),e},_disposeButton:function(t,e){L.DomEvent.off(t,"click",L.DomEvent.stopPropagation).off(t,"mousedown",L.DomEvent.stopPropagation).off(t,"dblclick",L.DomEvent.stopPropagation).off(t,"click",L.DomEvent.preventDefault).off(t,"click",e)},_handlerActivated:function(t){this.disable(),this._activeMode=this._modes[t.handler],L.DomUtil.addClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled"),this._showActionsToolbar(),this.fire("enable")},_handlerDeactivated:function(){this._hideActionsToolbar(),L.DomUtil.removeClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled"),this._activeMode=null,this.fire("disable")},_createActions:function(t){var e,i,n,o,s=this._actionsContainer,r=this.getActions(t),a=r.length;for(i=0,n=this._actionButtons.length;n>i;i++)this._disposeButton(this._actionButtons[i].button,this._actionButtons[i].callback);for(this._actionButtons=[];s.firstChild;)s.removeChild(s.firstChild);for(var l=0;a>l;l++)"enabled"in r[l]&&!r[l].enabled||(e=L.DomUtil.create("li","",s),o=this._createButton({title:r[l].title,text:r[l].text,container:e,callback:r[l].callback,context:r[l].context}),this._actionButtons.push({button:o,callback:r[l].callback}))},_showActionsToolbar:function(){var t=this._activeMode.buttonIndex,e=this._lastButtonIndex,i=this._activeMode.button.offsetTop-1;this._createActions(this._activeMode.handler),this._actionsContainer.style.top=i+"px",0===t&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-top")),t===e&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-bottom")),this._actionsContainer.style.display="block"},_hideActionsToolbar:function(){this._actionsContainer.style.display="none",L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-top"),L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-bottom")}}),L.Tooltip=L.Class.extend({initialize:function(t){this._map=t,this._popupPane=t._panes.popupPane,this._container=t.options.drawControlTooltips?L.DomUtil.create("div","leaflet-draw-tooltip",this._popupPane):null,this._singleLineLabel=!1,this._map.on("mouseout",this._onMouseOut,this)},dispose:function(){this._map.off("mouseout",this._onMouseOut,this),this._container&&(this._popupPane.removeChild(this._container),this._container=null)},updateContent:function(t){return this._container?(t.subtext=t.subtext||"",0!==t.subtext.length||this._singleLineLabel?t.subtext.length>0&&this._singleLineLabel&&(L.DomUtil.removeClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!1):(L.DomUtil.addClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!0),this._container.innerHTML=(t.subtext.length>0?''+t.subtext+"
":"")+""+t.text+"",this):this},updatePosition:function(t){var e=this._map.latLngToLayerPoint(t),i=this._container;return this._container&&(i.style.visibility="inherit",L.DomUtil.setPosition(i,e)),this},showAsError:function(){return this._container&&L.DomUtil.addClass(this._container,"leaflet-error-draw-tooltip"),this},removeError:function(){return this._container&&L.DomUtil.removeClass(this._container,"leaflet-error-draw-tooltip"),this},_onMouseOut:function(){this._container&&(this._container.style.visibility="hidden")}}),L.DrawToolbar=L.Toolbar.extend({statics:{TYPE:"draw"},options:{polyline:{},polygon:{},rectangle:{},circle:{},marker:{}},initialize:function(t){for(var e in this.options)this.options.hasOwnProperty(e)&&t[e]&&(t[e]=L.extend({},this.options[e],t[e]));this._toolbarClass="leaflet-draw-draw",L.Toolbar.prototype.initialize.call(this,t)},getModeHandlers:function(t){return[{enabled:this.options.polyline,handler:new L.Draw.Polyline(t,this.options.polyline),title:L.drawLocal.draw.toolbar.buttons.polyline},{enabled:this.options.polygon,handler:new L.Draw.Polygon(t,this.options.polygon),title:L.drawLocal.draw.toolbar.buttons.polygon},{enabled:this.options.rectangle,handler:new L.Draw.Rectangle(t,this.options.rectangle),title:L.drawLocal.draw.toolbar.buttons.rectangle},{enabled:this.options.circle,handler:new L.Draw.Circle(t,this.options.circle),title:L.drawLocal.draw.toolbar.buttons.circle},{enabled:this.options.marker,handler:new L.Draw.Marker(t,this.options.marker),title:L.drawLocal.draw.toolbar.buttons.marker}]},getActions:function(t){return[{enabled:t.completeShape,title:L.drawLocal.draw.toolbar.finish.title,text:L.drawLocal.draw.toolbar.finish.text,callback:t.completeShape,context:t},{enabled:t.deleteLastVertex,title:L.drawLocal.draw.toolbar.undo.title,text:L.drawLocal.draw.toolbar.undo.text,callback:t.deleteLastVertex,context:t},{title:L.drawLocal.draw.toolbar.actions.title,text:L.drawLocal.draw.toolbar.actions.text,callback:this.disable,context:this}]},setOptions:function(t){L.setOptions(this,t);for(var e in this._modes)this._modes.hasOwnProperty(e)&&t.hasOwnProperty(e)&&this._modes[e].handler.setOptions(t[e])}}),L.EditToolbar=L.Toolbar.extend({statics:{TYPE:"edit"},options:{edit:{selectedPathOptions:{dashArray:"10, 10",fill:!0,fillColor:"#fe57a1",fillOpacity:.1,maintainColor:!1}},remove:{},featureGroup:null},initialize:function(t){t.edit&&("undefined"==typeof t.edit.selectedPathOptions&&(t.edit.selectedPathOptions=this.options.edit.selectedPathOptions),t.edit.selectedPathOptions=L.extend({},this.options.edit.selectedPathOptions,t.edit.selectedPathOptions)),t.remove&&(t.remove=L.extend({},this.options.remove,t.remove)),this._toolbarClass="leaflet-draw-edit",L.Toolbar.prototype.initialize.call(this,t),this._selectedFeatureCount=0},getModeHandlers:function(t){var e=this.options.featureGroup;return[{enabled:this.options.edit,handler:new L.EditToolbar.Edit(t,{featureGroup:e,selectedPathOptions:this.options.edit.selectedPathOptions}),title:L.drawLocal.edit.toolbar.buttons.edit},{enabled:this.options.remove,handler:new L.EditToolbar.Delete(t,{featureGroup:e}),title:L.drawLocal.edit.toolbar.buttons.remove}]},getActions:function(){return[{title:L.drawLocal.edit.toolbar.actions.save.title,text:L.drawLocal.edit.toolbar.actions.save.text,callback:this._save,context:this},{title:L.drawLocal.edit.toolbar.actions.cancel.title,text:L.drawLocal.edit.toolbar.actions.cancel.text,callback:this.disable,context:this}]},addToolbar:function(t){var e=L.Toolbar.prototype.addToolbar.call(this,t);return this._checkDisabled(),this.options.featureGroup.on("layeradd layerremove",this._checkDisabled,this),e},removeToolbar:function(){this.options.featureGroup.off("layeradd layerremove",this._checkDisabled,this),L.Toolbar.prototype.removeToolbar.call(this)},disable:function(){this.enabled()&&(this._activeMode.handler.revertLayers(),L.Toolbar.prototype.disable.call(this))},_save:function(){this._activeMode.handler.save(),this._activeMode.handler.disable()},_checkDisabled:function(){var t,e=this.options.featureGroup,i=0!==e.getLayers().length;this.options.edit&&(t=this._modes[L.EditToolbar.Edit.TYPE].button,i?L.DomUtil.removeClass(t,"leaflet-disabled"):L.DomUtil.addClass(t,"leaflet-disabled"),t.setAttribute("title",i?L.drawLocal.edit.toolbar.buttons.edit:L.drawLocal.edit.toolbar.buttons.editDisabled)),this.options.remove&&(t=this._modes[L.EditToolbar.Delete.TYPE].button,i?L.DomUtil.removeClass(t,"leaflet-disabled"):L.DomUtil.addClass(t,"leaflet-disabled"),t.setAttribute("title",i?L.drawLocal.edit.toolbar.buttons.remove:L.drawLocal.edit.toolbar.buttons.removeDisabled))}}),L.EditToolbar.Edit=L.Handler.extend({statics:{TYPE:"edit"},includes:L.Mixin.Events,initialize:function(t,e){if(L.Handler.prototype.initialize.call(this,t),L.setOptions(this,e),this._featureGroup=e.featureGroup,!(this._featureGroup instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this._uneditedLayerProps={},this.type=L.EditToolbar.Edit.TYPE},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire("draw:editstart",{handler:this.type}),L.Handler.prototype.enable.call(this),this._featureGroup.on("layeradd",this._enableLayerEdit,this).on("layerremove",this._disableLayerEdit,this))},disable:function(){this._enabled&&(this._featureGroup.off("layeradd",this._enableLayerEdit,this).off("layerremove",this._disableLayerEdit,this),L.Handler.prototype.disable.call(this),this._map.fire("draw:editstop",{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(t.getContainer().focus(),this._featureGroup.eachLayer(this._enableLayerEdit,this),this._tooltip=new L.Tooltip(this._map),this._updateTooltip(),this._map.on("mousemove",this._onMouseMove,this).on("touchmove",this._onMouseMove,this).on("MSPointerMove",this._onMouseMove,this).on("click",this._editStyle,this).on("draw:editvertex",this._updateTooltip,this))},removeHooks:function(){this._map&&(this._featureGroup.eachLayer(this._disableLayerEdit,this),this._uneditedLayerProps={},this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this).off("touchmove",this._onMouseMove,this).off("MSPointerMove",this._onMouseMove,this))},revertLayers:function(){this._featureGroup.eachLayer(function(t){this._revertLayer(t)},this)},save:function(){var t=new L.LayerGroup;this._featureGroup.eachLayer(function(e){e.edited&&(t.addLayer(e),e.edited=!1)}),this._map.fire("draw:edited",{layers:t})},_backupLayer:function(t){var e=L.Util.stamp(t);this._uneditedLayerProps[e]||(t instanceof L.Polyline||t instanceof L.Polygon||t instanceof L.Rectangle?this._uneditedLayerProps[e]={latlngs:L.LatLngUtil.cloneLatLngs(t.getLatLngs())}:t instanceof L.Circle?this._uneditedLayerProps[e]={latlng:L.LatLngUtil.cloneLatLng(t.getLatLng()),radius:t.getRadius()}:t instanceof L.Marker&&(this._uneditedLayerProps[e]={latlng:L.LatLngUtil.cloneLatLng(t.getLatLng())}))},_getTooltipText:function(){return{text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}},_updateTooltip:function(){this._tooltip.updateContent(this._getTooltipText())},_revertLayer:function(t){var e=L.Util.stamp(t);t.edited=!1,this._uneditedLayerProps.hasOwnProperty(e)&&(t instanceof L.Polyline||t instanceof L.Polygon||t instanceof L.Rectangle?t.setLatLngs(this._uneditedLayerProps[e].latlngs):t instanceof L.Circle?(t.setLatLng(this._uneditedLayerProps[e].latlng),t.setRadius(this._uneditedLayerProps[e].radius)):t instanceof L.Marker&&t.setLatLng(this._uneditedLayerProps[e].latlng),t.fire("revert-edited",{layer:t}))},_enableLayerEdit:function(t){var e,i=t.layer||t.target||t;this._backupLayer(i),this.options.selectedPathOptions&&(e=L.Util.extend({},this.options.selectedPathOptions),e.maintainColor&&(e.color=i.options.color,e.fillColor=i.options.fillColor),i.options.original=L.extend({},i.options),i.options.editing=e),this.isMarker?(i.dragging.enable(),i.on("dragend",this._onMarkerDragEnd).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onMarkerDragEnd,this).on("MSPointerUp",this._onMarkerDragEnd,this)):i.editing.enable()},_disableLayerEdit:function(t){var e=t.layer||t.target||t;e.edited=!1,e.editing.disable(),delete e.options.editing,delete e.options.original,this._selectedPathOptions&&(e instanceof L.Marker?this._toggleMarkerHighlight(e):(e.setStyle(e.options.previousOptions),delete e.options.previousOptions)),e instanceof L.Marker?(e.dragging.disable(),e.off("dragend",this._onMarkerDragEnd,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onMarkerDragEnd,this).off("MSPointerUp",this._onMarkerDragEnd,this)):e.editing.disable()},_onMouseMove:function(t){this._tooltip.updatePosition(t.latlng)},_onTouchMove:function(t){var e=t.originalEvent.changedTouches[0],i=this._map.mouseEventToLayerPoint(e),n=this._map.layerPointToLatLng(i);t.target.setLatLng(n)},_hasAvailableLayers:function(){return 0!==this._featureGroup.getLayers().length}}),L.EditToolbar.Delete=L.Handler.extend({statics:{TYPE:"remove"},includes:L.Mixin.Events,initialize:function(t,e){if(L.Handler.prototype.initialize.call(this,t),L.Util.setOptions(this,e),this._deletableLayers=this.options.featureGroup,!(this._deletableLayers instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this.type=L.EditToolbar.Delete.TYPE},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire("draw:deletestart",{handler:this.type}),L.Handler.prototype.enable.call(this),this._deletableLayers.on("layeradd",this._enableLayerDelete,this).on("layerremove",this._disableLayerDelete,this))},disable:function(){this._enabled&&(this._deletableLayers.off("layeradd",this._enableLayerDelete,this).off("layerremove",this._disableLayerDelete,this),L.Handler.prototype.disable.call(this),this._map.fire("draw:deletestop",{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(t.getContainer().focus(),this._deletableLayers.eachLayer(this._enableLayerDelete,this),this._deletedLayers=new L.LayerGroup,this._tooltip=new L.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.remove.tooltip.text}),this._map.on("mousemove",this._onMouseMove,this))},removeHooks:function(){this._map&&(this._deletableLayers.eachLayer(this._disableLayerDelete,this),this._deletedLayers=null,this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this))},revertLayers:function(){this._deletedLayers.eachLayer(function(t){this._deletableLayers.addLayer(t),t.fire("revert-deleted",{layer:t})},this)},save:function(){this._map.fire("draw:deleted",{layers:this._deletedLayers})},_enableLayerDelete:function(t){var e=t.layer||t.target||t;e.on("click",this._removeLayer,this)},_disableLayerDelete:function(t){var e=t.layer||t.target||t;e.off("click",this._removeLayer,this),this._deletedLayers.removeLayer(e)},_removeLayer:function(t){var e=t.layer||t.target||t;this._deletableLayers.removeLayer(e),this._deletedLayers.addLayer(e),e.fire("deleted")},_onMouseMove:function(t){this._tooltip.updatePosition(t.latlng)},_hasAvailableLayers:function(){return 0!==this._deletableLayers.getLayers().length}})}(window,document),leafletDraw=void 0,function(t){"use strict";sortable=function(){return"function"==typeof t?t():t}()}(function(){"use strict";function t(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be HTMLElement, and not "+{}.toString.call(t);this.el=t,this.options=e=v({},e),t[U]=this;var i={group:Math.random(),sort:!0,disabled:!1,store:null,handle:null,scroll:!0,scrollSensitivity:30,scrollSpeed:10,draggable:/[uo]l/i.test(t.nodeName)?"li":">*",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",ignore:"a, img",filter:null,animation:0,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1};for(var n in i)!(n in e)&&(e[n]=i[n]);K(e);for(var s in this)"_"===s.charAt(0)&&(this[s]=this[s].bind(this));this.nativeDraggable=!e.forceFallback&&B,o(t,"mousedown",this._onTapStart),o(t,"touchstart",this._onTapStart),this.nativeDraggable&&(o(t,"dragover",this),o(t,"dragenter",this)),V.push(this._onDragOver),e.store&&this.sort(e.store.get(this))}function e(t){C&&C.state!==t&&(a(C,"display",t?"none":""),!t&&C.state&&S.insertBefore(C,y),C.state=t)}function i(t,e,i){if(t){i=i||F;do if(">*"===e&&t.parentNode===i||_(t,e))return t;while(t!==i&&(t=t.parentNode))}return null}function n(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.preventDefault()}function o(t,e,i){t.addEventListener(e,i,!1)}function s(t,e,i){t.removeEventListener(e,i,!1)}function r(t,e,i){if(t)if(t.classList)t.classList[i?"add":"remove"](e);else{var n=(" "+t.className+" ").replace(N," ").replace(" "+e+" "," ");t.className=(n+(i?" "+e:"")).replace(N," ")}}function a(t,e,i){var n=t&&t.style;if(n){if(void 0===i)return F.defaultView&&F.defaultView.getComputedStyle?i=F.defaultView.getComputedStyle(t,""):t.currentStyle&&(i=t.currentStyle),void 0===e?i:i[e];e in n||(e="-webkit-"+e),n[e]=i+("string"==typeof i?"":"px")}}function l(t,e,i){if(t){var n=t.getElementsByTagName(e),o=0,s=n.length;if(i)for(;o5||e.clientX-(n.right+n.width)>5)&&i}function m(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,i=e.length,n=0;i--;)n+=e.charCodeAt(i);return n.toString(36)}function f(t,e){var i=0;if(!t||!t.parentNode)return-1;for(;t&&(t=t.previousElementSibling);)"TEMPLATE"!==t.nodeName.toUpperCase()&&_(t,e)&&i++;return i}function _(t,e){if(t){e=e.split(".");var i=e.shift().toUpperCase(),n=new RegExp("\\s("+e.join("|")+")(?=\\s)","g");return!(""!==i&&t.nodeName.toUpperCase()!=i||e.length&&((" "+t.className+" ").match(n)||[]).length!=e.length)}return!1}function g(t,e){var i,n;return function(){void 0===i&&(i=arguments,n=this,setTimeout(function(){1===i.length?t.call(n,i[0]):t.apply(n,i),i=void 0},e))}}function v(t,e){if(t&&e)for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}if("undefined"==typeof window||"undefined"==typeof window.document)return function(){throw new Error("Sortable.js requires a window with a document")};var y,E,P,C,S,M,w,L,R,b,x,G,I,A,T,k,O,D={},N=/\s+/g,U="Sortable"+(new Date).getTime(),j=window,F=j.document,z=j.parseInt,B=!!("draggable"in F.createElement("div")),q=function(t){return t=F.createElement("x"),t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}(),W=!1,H=Math.abs,V=([].slice,[]),Y=g(function(t,e,i){if(i&&e.scroll){var n,o,s,r,a=e.scrollSensitivity,l=e.scrollSpeed,c=t.clientX,h=t.clientY,u=window.innerWidth,d=window.innerHeight;if(L!==i&&(w=e.scroll,L=i,w===!0)){w=i;do if(w.offsetWidth-1){for(;n--;)V[n]({clientX:k.clientX,clientY:k.clientY,target:t,rootEl:e});break}t=e}while(e=e.parentNode);q||a(P,"display","")}},_onTouchMove:function(e){if(T){t.active||this._dragStarted(),this._appendGhost();var i=e.touches?e.touches[0]:e,n=i.clientX-T.clientX,o=i.clientY-T.clientY,s=e.touches?"translate3d("+n+"px,"+o+"px,0)":"translate("+n+"px,"+o+"px)";O=!0,k=i,a(P,"webkitTransform",s),a(P,"mozTransform",s),a(P,"msTransform",s),a(P,"transform",s),e.preventDefault()}},_appendGhost:function(){if(!P){var t,e=y.getBoundingClientRect(),i=a(y),n=this.options;P=y.cloneNode(!0),r(P,n.ghostClass,!1),r(P,n.fallbackClass,!0),a(P,"top",e.top-z(i.marginTop,10)),a(P,"left",e.left-z(i.marginLeft,10)),a(P,"width",e.width),a(P,"height",e.height),a(P,"opacity","0.8"),a(P,"position","fixed"),a(P,"zIndex","100000"),a(P,"pointerEvents","none"),n.fallbackOnBody&&F.body.appendChild(P)||S.appendChild(P),t=P.getBoundingClientRect(),a(P,"width",2*e.width-t.width),a(P,"height",2*e.height-t.height)}},_onDragStart:function(t,e){var i=t.dataTransfer,n=this.options;this._offUpEvents(),"clone"==A.pull&&(C=y.cloneNode(!0),a(C,"display","none"),S.insertBefore(C,y)),e?("touch"===e?(o(F,"touchmove",this._onTouchMove),o(F,"touchend",this._onDrop),o(F,"touchcancel",this._onDrop)):(o(F,"mousemove",this._onTouchMove),o(F,"mouseup",this._onDrop)),this._loopId=setInterval(this._emulateDragOver,50)):(i&&(i.effectAllowed="move",n.setData&&n.setData.call(this,i,y)),o(F,"drop",this),setTimeout(this._dragStarted,0))},_onDragOver:function(t){var n,o,s,r=this.el,l=this.options,c=l.group,u=c.put,m=A===c,f=l.sort;if(void 0!==t.preventDefault&&(t.preventDefault(),!l.dragoverBubble&&t.stopPropagation()),O=!0,A&&!l.disabled&&(m?f||(s=!S.contains(y)):A.pull&&u&&(A.name===c.name||u.indexOf&&~u.indexOf(A.name)))&&(void 0===t.rootEl||t.rootEl===this.el)){if(Y(t,l,this.el),W)return;if(n=i(t.target,l.draggable,r),o=y.getBoundingClientRect(),s)return e(!0),void(C||M?S.insertBefore(y,C||M):f||S.appendChild(y));if(0===r.children.length||r.children[0]===P||r===t.target&&(n=p(r,t))){if(n){if(n.animated)return;g=n.getBoundingClientRect()}e(m),h(S,r,y,o,n,g)!==!1&&(y.contains(r)||(r.appendChild(y),E=r),this._animate(o,y),n&&this._animate(g,n))}else if(n&&!n.animated&&n!==y&&void 0!==n.parentNode[U]){R!==n&&(R=n,b=a(n),x=a(n.parentNode));var _,g=n.getBoundingClientRect(),v=g.right-g.left,w=g.bottom-g.top,L=/left|right|inline/.test(b.cssFloat+b.display)||"flex"==x.display&&0===x["flex-direction"].indexOf("row"),G=n.offsetWidth>y.offsetWidth,I=n.offsetHeight>y.offsetHeight,T=(L?(t.clientX-g.left)/v:(t.clientY-g.top)/w)>.5,k=n.nextElementSibling,D=h(S,r,y,o,n,g);if(D!==!1){if(W=!0,setTimeout(d,30),e(m),1===D||D===-1)_=1===D;else if(L){var N=y.offsetTop,j=n.offsetTop;_=N===j?n.previousElementSibling===y&&!G||T&&G:j>N}else _=k!==y&&!I||T&&I;y.contains(r)||(_&&!k?r.appendChild(y):n.parentNode.insertBefore(y,_?k:n)),E=y.parentNode,this._animate(o,y),this._animate(g,n)}}}},_animate:function(t,e){var i=this.options.animation;if(i){var n=e.getBoundingClientRect();a(e,"transition","none"),a(e,"transform","translate3d("+(t.left-n.left)+"px,"+(t.top-n.top)+"px,0)"),e.offsetWidth,a(e,"transition","all "+i+"ms"),a(e,"transform","translate3d(0,0,0)"),clearTimeout(e.animated),e.animated=setTimeout(function(){a(e,"transition",""),a(e,"transform",""),e.animated=!1},i)}},_offUpEvents:function(){var t=this.el.ownerDocument;s(F,"touchmove",this._onTouchMove),s(t,"mouseup",this._onDrop),s(t,"touchend",this._onDrop),s(t,"touchcancel",this._onDrop)},_onDrop:function(e){var i=this.el,n=this.options;clearInterval(this._loopId),clearInterval(D.pid),clearTimeout(this._dragStartTimer),s(F,"mousemove",this._onTouchMove),this.nativeDraggable&&(s(F,"drop",this),s(i,"dragstart",this._onDragStart)),this._offUpEvents(),e&&(O&&(e.preventDefault(),!n.dropBubble&&e.stopPropagation()),P&&P.parentNode.removeChild(P),y&&(this.nativeDraggable&&s(y,"dragend",this),u(y),r(y,this.options.ghostClass,!1),r(y,this.options.chosenClass,!1),S!==E?(I=f(y,n.draggable),I>=0&&(c(null,E,"sort",y,S,G,I),c(this,S,"sort",y,S,G,I),c(null,E,"add",y,S,G,I),c(this,S,"remove",y,S,G,I))):(C&&C.parentNode.removeChild(C),y.nextSibling!==M&&(I=f(y,n.draggable),I>=0&&(c(this,S,"update",y,S,G,I),c(this,S,"sort",y,S,G,I)))),t.active&&(null!==I&&I!==-1||(I=G),c(this,S,"end",y,S,G,I),this.save()))),this._nulling()},_nulling:function(){S=y=E=P=M=C=w=L=T=k=O=I=R=b=A=t.active=null},handleEvent:function(t){var e=t.type;"dragover"===e||"dragenter"===e?y&&(this._onDragOver(t),n(t)):"drop"!==e&&"dragend"!==e||this._onDrop(t)},toArray:function(){for(var t,e=[],n=this.el.children,o=0,s=n.length,r=this.options;othis._map.getZoom()||e.layer.options.maxZoome.getZoom()||o.options.maxZoom2?document.getElementById(i._addUID("GPlocationAutoCompleteList_"+o)).style.display="block":document.getElementById(i._addUID("GPlocationAutoCompleteList_"+o)).style.display="none",i.onAutoCompleteSearchText(e)}}),n.addEventListener("keydown",function(n){var o=n.which||n.keyCode,s=document.getElementById(i._addUID("GPlocationAutoCompleteList_"+e));if(s){var r=s.getElementsByClassName("GPautoCompleteProposal current"),a=s.getElementsByClassName("GPautoCompleteProposal"),l=a.length;if(l){var c=null;if(!r.length)return c=a[0],c.className="GPautoCompleteProposal current",c.style.color="#000000",void(c.style["background-color"]="#CEDBEF");c=r[0];var h=parseInt(t.index(c.id),10),u=h===l-1?a[0]:a[h+1],d=0===h?a[l-1]:a[h-1];switch(c.style["background-color"]="",c.style.color="",d.style["background-color"]="",d.style.color="",u.style["background-color"]="",u.style.color="",o){case 38:console.log("arrow up"),c.className="GPautoCompleteProposal",d.className="GPautoCompleteProposal current",d.style.color="#000000",d.style["background-color"]="#CEDBEF";break;case 40:console.log("arrow down"),c.className="GPautoCompleteProposal",u.className="GPautoCompleteProposal current",u.style.color="#000000",u.style["background-color"]="#CEDBEF";break;case 13:console.log("enter"),c.click(n)}c.focus()}}}),n},_createLocationCoordinateInputElement:function(e){var i=this,n=document.createElement("input");return n.id=this._addUID("GPlocationOriginCoords_"+e),n.className="GPlocationOriginHidden",n.type="text",n.disabled=!1,n.addEventListener("click",function(){var e=t.index(this.id);document.getElementById(i._addUID("GPlocationOriginLabel_"+e)).click()}),n},_createLocationPointerShowInputElement:function(t){var e=document.createElement("input");return e.id=this._addUID("GPlocationOriginPointer_"+t),e.type="checkbox",e},_createLocationPointerInputElement:function(e){var i=this,n=document.createElement("label");return n.id=this._addUID("GPlocationOriginPointerImg_"+e),n.htmlFor="GPlocationOriginPointer_"+e,n.className="GPlocationOriginPointerImg",n.title="Pointer un lieu sur la carte",n.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation();var n,o,s,r=t.index(this.id),a=document.getElementsByClassName(i._addUID("GPlocationPoint"));for(n=0;n",color:"blue",display:!0,addOption:!1,removeOption:!1},disableReverse:!1,displayInfo:!0,autocompleteOptions:{},reverseGeocodeOptions:{}},initialize:function(e){t.Util.setOptions(this,e),this._uid=this.options.tag.unique||null,this._activeDragAndDrop=!1,this._pressedKeyOnDragAndDrop=!1,this._map=null,this._inputsContainer=null,this._inputLabelContainer=null,this._inputAutoCompleteContainer=null,this._inputShowPointerContainer=null,this._inputCoordinateContainer=null,this._coordinate=null,this._suggestedContainer=null,this._suggestedLocations=[],this._currentLocation=null,this._marker=null,this._resources={},this._noRightManagement=!1,this._checkRightsManagement(),this._container=this._uid?this._initLayout():null},onAdd:function(){this._uid=o.generate();var e=this._initLayout();return t.DomEvent.disableClickPropagation(e).disableScrollPropagation(e),e},onRemove:function(){},getCoordinate:function(){return this._coordinate},getCoordinateInverse:function(){if(this._coordinate){var t={x:this._coordinate.y,y:this._coordinate.x};return t}},setMap:function(t){this._map||(this._map=t)},clear:function(){this._setCursor(),this._setMarker(),this._clearResults(),this._inputLabelContainer.click()},dragging:function(t){this._marker&&(t?this._marker.dragging.enable():this._marker.dragging.disable())},_initLayout:function(){var t=this.options.tag.id,e=this._createMainContainerElement(),i=this._inputsContainer=this._createLocationPointElement(t,this.options.tag.display);e.appendChild(i);var n=this._inputLabelContainer=this._createLocationPointLabelElement(t,this.options.tag.label);i.appendChild(n);var o=this._inputAutoCompleteContainer=this._createLocationAutoCompleteteInputElement(t);i.appendChild(o);var s=this._inputCoordinateContainer=this._createLocationCoordinateInputElement(t);i.appendChild(s);var r=this._inputShowPointerContainer=this._createLocationPointerShowInputElement(t);i.appendChild(r);var a=this._createLocationPointerInputElement(t);if(i.appendChild(a),this.options.tag.addOption){var l=this._createLocationAddPointElement();i.appendChild(l)}if(this.options.tag.removeOption){var c=this._createLocationRemovePointElement(t);i.appendChild(c)}var h=this._suggestedContainer=this._createLocationAutoCompleteResultElement(t);return e.appendChild(h),e},_checkRightsManagement:function(){var t=null,e=[],i=null;i=this.options.reverseGeocodeOptions.apiKey,t=this.options.reverseGeocodeOptions.filterOptions,e=t?t.type:[],e&&0!==e.length||(e=["PositionOfInterest","StreetAddress"]);var o=n.check({key:i||this.options.apiKey,resources:e,services:["ReverseGeocode"]});i=this.options.autocompleteOptions.apiKey,t=this.options.autocompleteOptions.filterOptions,e=t?t.type:[],e&&0!==e.length||(e=["PositionOfInterest","StreetAddress"]);var s=n.check({key:i||this.options.apiKey,resources:e,services:["AutoCompletion"]});o||s||(this._noRightManagement=!0),s&&(this._resources.AutoCompletion={},this._resources.AutoCompletion.resources=s.AutoCompletion,this._resources.AutoCompletion.key=s.key),o&&(this._resources.ReverseGeocode={},this._resources.ReverseGeocode.resources=o.ReverseGeocode,this._resources.ReverseGeocode.key=o.key)},_setLabel:function(t){this._inputAutoCompleteContainer.value=t||""},_setCoordinate:function(t){this._coordinate={x:t.lng,y:t.lat};var e=null,i=null;e=r.roundToDecimal(t.lat,4),i=r.roundToDecimal(t.lng,4);var n=i+" , "+e;this.GPdisplayCoordinate(n)},_setPosition:function(e){var i=this._map;i.panTo(t.latLng(e.y,e.x))},_setMarker:function(e,i,n){if(!this._activeDragAndDrop){var o=this._map;if(null!=this._marker&&(this._marker.off("mousedown",this.onMouseDownMarker,this),this._marker.off("dragstart",this.onStartDragMarker,this),this._marker.off("drag",this.onDragMarker,this),this._marker.off("dragend",this.onEndDragMarker,this),o.removeLayer(this._marker),this._marker=null),e){var s={icon:new a(this.options.tag.color),draggable:!0,clickable:!0,zIndexOffset:1e3};if(this._marker=t.marker(t.latLng(e.y,e.x),s),this._marker.on("mousedown",this.onMouseDownMarker,this),this._marker.on("dragstart",this.onStartDragMarker,this),this._marker.on("drag",this.onDragMarker,this),this._marker.on("dragend",this.onEndDragMarker,this),this._marker.addTo(o),n){var r=null;if("string"!=typeof i)if(i.fields.fullText)r=i.fields.fullText;else{var l=[];l.push(i.fields.street||""),l.push(i.fields.postalCode||""),l.push(i.fields.commune||""),"PositionOfInterest"===i.type&&(l.push(i.fields.poi||""),l.push(i.fields.kind||"")),r=l.join(" - ")}else r=i;this._marker.bindPopup(r)}}}},_setCursor:function(t){var e=this._map.getContainer();t?e.style.cursor=t:e.style.cursor=null},_clearResults:function(){this._currentLocation=null,this._coordinate=null,this._clearSuggestedLocation()},_clearSuggestedLocation:function(){if(this._suggestedLocations=[],this._suggestedContainer)for(;this._suggestedContainer.firstChild;)this._suggestedContainer.removeChild(this._suggestedContainer.firstChild)},_requestAutoComplete:function(e){if(e&&0!==Object.keys(e).length&&e.text){if(this._noRightManagement)return void console.log("no rights for all service !?");if(!this._resources.AutoCompletion)return void console.log("no rights for this service !?");var n=this._resources.AutoCompletion.resources;if(n&&0!==Object.keys(n).length){var o=this._resources.AutoCompletion.key,s={};t.Util.extend(s,this.options.autocompleteOptions),t.Util.extend(s,e),t.Util.extend(s,{apiKey:s.apiKey||this.options.apiKey||o}),i.Services.autoComplete(s)}}},_fillAutoCompletedLocationListContainer:function(t){if(t&&0!==t.length){var e=this._suggestedContainer;if(e.childElementCount)for(;e.firstChild;)e.removeChild(e.firstChild);for(var i=0;is;s++)if(!e||2!==s||void 0!==i.z)switch(0===s?(n=r,o="x"):1===s?(n=a,o="y"):(n=l,o="z"),t.axis[s]){case"e":i[o]=n;break;case"w":i[o]=-n;break;case"n":i[o]=n;break;case"s":i[o]=-n;break;case"u":void 0!==i[o]&&(i.z=n);break;case"d":void 0!==i[o]&&(i.z=-n);break;default:return null}return i}},{}],4:[function(t,e){var i=Math.PI/2,n=t("./sign");e.exports=function(t){return Math.abs(t)1&&(t=t>1?1:-1),Math.asin(t)}},{}],7:[function(t,e){e.exports=function(t){return 1-.25*t*(1+t/16*(3+1.25*t))}},{}],8:[function(t,e){e.exports=function(t){return.375*t*(1+.25*t*(1+.46875*t))}},{}],9:[function(t,e){e.exports=function(t){return.05859375*t*t*(1+.75*t)}},{}],10:[function(t,e){e.exports=function(t){return t*t*t*(35/3072)}},{}],11:[function(t,e){e.exports=function(t,e,i){var n=e*i;return t/Math.sqrt(1-n*n)}},{}],12:[function(t,e){e.exports=function(t,e,i,n,o){var s,r;s=t/e;for(var a=0;15>a;a++)if(r=(t-(e*s-i*Math.sin(2*s)+n*Math.sin(4*s)-o*Math.sin(6*s)))/(e-2*i*Math.cos(2*s)+4*n*Math.cos(4*s)-6*o*Math.cos(6*s)),s+=r,Math.abs(r)<=1e-10)return s;return NaN}},{}],13:[function(t,e){var i=Math.PI/2;e.exports=function(t,e){var n=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-n)<1e-6)return 0>e?-1*i:i;for(var o,s,r,a,l=Math.asin(.5*e),c=0;30>c;c++)if(s=Math.sin(l),r=Math.cos(l),a=t*s,o=Math.pow(1-a*a,2)/(2*r)*(e/(1-t*t)-s/(1-a*a)+.5/t*Math.log((1-a)/(1+a))),l+=o,Math.abs(o)<=1e-10)return l;return NaN}},{}],14:[function(t,e){e.exports=function(t,e,i,n,o){return t*o-e*Math.sin(2*o)+i*Math.sin(4*o)-n*Math.sin(6*o)}},{}],15:[function(t,e){e.exports=function(t,e,i){var n=t*e;return i/Math.sqrt(1-n*n)}},{}],16:[function(t,e){var i=Math.PI/2;e.exports=function(t,e){for(var n,o,s=.5*t,r=i-2*Math.atan(e),a=0;15>=a;a++)if(n=t*Math.sin(r),o=i-2*Math.atan(e*Math.pow((1-n)/(1+n),s))-r,r+=o,Math.abs(o)<=1e-10)return r;return-9999}},{}],17:[function(t,e){var i=1,n=.25,o=.046875,s=.01953125,r=.01068115234375,a=.75,l=.46875,c=.013020833333333334,h=.007120768229166667,u=.3645833333333333,d=.005696614583333333,p=.3076171875;e.exports=function(t){var e=[];e[0]=i-t*(n+t*(o+t*(s+t*r))),e[1]=t*(a-t*(o+t*(s+t*r)));var m=t*t;return e[2]=m*(l-t*(c+t*h)),m*=t,e[3]=m*(u-t*d),e[4]=m*t*p,e}},{}],18:[function(t,e){var i=t("./pj_mlfn"),n=1e-10,o=20;e.exports=function(t,e,s){for(var r=1/(1-e),a=t,l=o;l;--l){var c=Math.sin(a),h=1-e*c*c;if(h=(i(a,c,Math.cos(a),s)-t)*h*Math.sqrt(h)*r,a-=h,Math.abs(h)1e-7?(i=t*e,(1-t*t)*(e/(1-i*i)-.5/t*Math.log((1-i)/(1+i)))):2*e}},{}],21:[function(t,e){e.exports=function(t){return 0>t?-1:1}},{}],22:[function(t,e){e.exports=function(t,e){return Math.pow((1-t)/(1+t),e)}},{}],23:[function(t,e){e.exports=function(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}},{}],24:[function(t,e){var i=Math.PI/2;e.exports=function(t,e,n){var o=t*n,s=.5*t;return o=Math.pow((1-o)/(1+o),s),Math.tan(.5*(i-e))/o}},{}],25:[function(t,e,i){i.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},i.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},i.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},i.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},i.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},i.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},i.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},i.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},i.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},i.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},i.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},i.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},i.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},i.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},i.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},i.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},{}],26:[function(t,e,i){i.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},i.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},i.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},i.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},i.airy={a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},i.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},i.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},i.mod_airy={a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},i.andrae={a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},i.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},i.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},i.bessel={a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},i.bess_nam={a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},i.clrk66={a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},i.clrk80={a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},i.clrk58={a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},i.CPM={a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},i.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},i.engelis={a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},i.evrst30={a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},i.evrst48={a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},i.evrst56={a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},i.evrst69={a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},i.evrstSS={a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},i.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},i.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},i.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},i.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},i.hough={a:6378270,rf:297,ellipseName:"Hough"},i.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},i.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},i.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},i.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},i.new_intl={a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},i.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},i.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},i.SEasia={a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},i.walbeck={a:6376896,b:6355834.8467,ellipseName:"Walbeck"},i.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},i.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},i.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"},i.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"},i.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},{}],27:[function(t,e,i){i.greenwich=0,i.lisbon=-9.131906111111,i.paris=2.337229166667,i.bogota=-74.080916666667,i.madrid=-3.687938888889,i.rome=12.452333333333,i.bern=7.439583333333,i.jakarta=106.807719444444,i.ferro=-17.666666666667,i.brussels=4.367975,i.stockholm=18.058277777778,i.athens=23.7163375,i.oslo=10.722916666667},{}],28:[function(t,e){function i(t,e,i){var n;return Array.isArray(i)?(n=r(t,e,i),3===i.length?[n.x,n.y,n.z]:[n.x,n.y]):r(t,e,i)}function n(t){return t instanceof s?t:t.oProj?t.oProj:s(t)}function o(t,e,o){t=n(t);var s,r=!1;return"undefined"==typeof e?(e=t,t=a,r=!0):("undefined"!=typeof e.x||Array.isArray(e))&&(o=e,e=t,t=a,r=!0),e=n(e),o?i(t,e,o):(s={forward:function(n){return i(t,e,n)},inverse:function(n){return i(e,t,n)}},r&&(s.oProj=e),s)}var s=t("./Proj"),r=t("./transform"),a=s("WGS84");e.exports=o},{"./Proj":2,"./transform":64}],29:[function(t,e){var i=Math.PI/2,n=1,o=2,s=3,r=4,a=5,l=484813681109536e-20,c=1.0026,h=.3826834323650898,u=function(t){if(!(this instanceof u))return new u(t);if(this.datum_type=r,t){if(t.datumCode&&"none"===t.datumCode&&(this.datum_type=a),t.datum_params){for(var e=0;e3&&(0!==t.datum_params[3]||0!==t.datum_params[4]||0!==t.datum_params[5]||0!==t.datum_params[6])&&(this.datum_type=o,t.datum_params[3]*=l,t.datum_params[4]*=l,t.datum_params[5]*=l,t.datum_params[6]=t.datum_params[6]/1e6+1)}this.datum_type=t.grids?s:this.datum_type,this.a=t.a,this.b=t.b,this.es=t.es,this.ep2=t.ep2,this.datum_params=t.datum_params,this.datum_type===s&&(this.grids=t.grids)}};u.prototype={compare_datums:function(t){return this.datum_type===t.datum_type&&(!(this.a!==t.a||Math.abs(this.es-t.es)>5e-11)&&(this.datum_type===n?this.datum_params[0]===t.datum_params[0]&&this.datum_params[1]===t.datum_params[1]&&this.datum_params[2]===t.datum_params[2]:this.datum_type===o?this.datum_params[0]===t.datum_params[0]&&this.datum_params[1]===t.datum_params[1]&&this.datum_params[2]===t.datum_params[2]&&this.datum_params[3]===t.datum_params[3]&&this.datum_params[4]===t.datum_params[4]&&this.datum_params[5]===t.datum_params[5]&&this.datum_params[6]===t.datum_params[6]:this.datum_type!==s&&t.datum_type!==s||this.nadgrids===t.nadgrids))},geodetic_to_geocentric:function(t){var e,n,o,s,r,a,l,c=t.x,h=t.y,u=t.z?t.z:0,d=0;if(-i>h&&h>-1.001*i)h=-i;else if(h>i&&1.001*i>h)h=i;else if(-i>h||h>i)return null;return c>Math.PI&&(c-=2*Math.PI),r=Math.sin(h),l=Math.cos(h),a=r*r,s=this.a/Math.sqrt(1-this.es*a),e=(s+u)*l*Math.cos(c),n=(s+u)*l*Math.sin(c),o=(s*(1-this.es)+u)*r,t.x=e,t.y=n,t.z=o,d},geocentric_to_geodetic:function(t){var e,n,o,s,r,a,l,c,h,u,d,p,m,f,_,g,v,y=1e-12,E=y*y,P=30,C=t.x,S=t.y,M=t.z?t.z:0;if(m=!1,e=Math.sqrt(C*C+S*S),n=Math.sqrt(C*C+S*S+M*M),e/this.aE&&P>f);return g=Math.atan(d/Math.abs(u)),t.x=_,t.y=g,t.z=v,t},geocentric_to_geodetic_noniter:function(t){var e,n,o,s,r,a,l,u,d,p,m,f,_,g,v,y,E,P=t.x,C=t.y,S=t.z?t.z:0;if(P=parseFloat(P),C=parseFloat(C),S=parseFloat(S),E=!1,0!==P)e=Math.atan2(C,P);else if(C>0)e=i;else if(0>C)e=-i;else if(E=!0,e=0,S>0)n=i;else{if(!(0>S))return n=i,void(o=-this.b);n=-i}return r=P*P+C*C,s=Math.sqrt(r),a=S*c,u=Math.sqrt(a*a+r),p=a/u,f=s/u,m=p*p*p,l=S+this.b*this.ep2*m,y=s-this.a*this.es*f*f*f,d=Math.sqrt(l*l+y*y),_=l/d,g=y/d,v=this.a/Math.sqrt(1-this.es*_*_),o=g>=h?s/g-v:-h>=g?s/-g-v:S/_+v*(this.es-1),E===!1&&(n=Math.atan(_/g)),t.x=e,t.y=n,t.z=o,t},geocentric_to_wgs84:function(t){if(this.datum_type===n)t.x+=this.datum_params[0],t.y+=this.datum_params[1],t.z+=this.datum_params[2];else if(this.datum_type===o){var e=this.datum_params[0],i=this.datum_params[1],s=this.datum_params[2],r=this.datum_params[3],a=this.datum_params[4],l=this.datum_params[5],c=this.datum_params[6],h=c*(t.x-l*t.y+a*t.z)+e,u=c*(l*t.x+t.y-r*t.z)+i,d=c*(-a*t.x+r*t.y+t.z)+s;t.x=h,t.y=u,t.z=d}},geocentric_from_wgs84:function(t){if(this.datum_type===n)t.x-=this.datum_params[0],t.y-=this.datum_params[1],t.z-=this.datum_params[2];else if(this.datum_type===o){var e=this.datum_params[0],i=this.datum_params[1],s=this.datum_params[2],r=this.datum_params[3],a=this.datum_params[4],l=this.datum_params[5],c=this.datum_params[6],h=(t.x-e)/c,u=(t.y-i)/c,d=(t.z-s)/c;t.x=h+l*u-a*d,t.y=-l*h+u+r*d,t.z=a*h-r*u+d}}},e.exports=u},{}],30:[function(t,e){var i=1,n=2,o=3,s=5,r=6378137,a=.006694379990141316;e.exports=function(t,e,l){function c(t){return t===i||t===n}var h,u,d;if(t.compare_datums(e))return l;if(t.datum_type===s||e.datum_type===s)return l;var p=t.a,m=t.es,f=e.a,_=e.es,g=t.datum_type;if(g===o)if(0===this.apply_gridshift(t,0,l))t.a=r,t.es=a;else{if(!t.datum_params)return t.a=p,t.es=t.es,l;for(h=1,u=0,d=t.datum_params.length;d>u;u++)h*=t.datum_params[u];if(0===h)return t.a=p,t.es=t.es,l;g=t.datum_params.length>3?n:i}return e.datum_type===o&&(e.a=r,e.es=a),(t.es!==e.es||t.a!==e.a||c(g)||c(e.datum_type))&&(t.geodetic_to_geocentric(l),c(t.datum_type)&&t.geocentric_to_wgs84(l),c(e.datum_type)&&e.geocentric_from_wgs84(l),e.geocentric_to_geodetic(l)),e.datum_type===o&&this.apply_gridshift(e,1,l),t.a=p,t.es=m,e.a=f,e.es=_,l}},{}],31:[function(t,e){function i(t){var e=this;if(2===arguments.length){var n=arguments[1];i[t]="string"==typeof n?"+"===n[0]?o(arguments[1]):s(arguments[1]):n}else if(1===arguments.length){if(Array.isArray(t))return t.map(function(t){Array.isArray(t)?i.apply(e,t):i(t)});if("string"==typeof t){if(t in i)return i[t]}else"EPSG"in t?i["EPSG:"+t.EPSG]=t:"ESRI"in t?i["ESRI:"+t.ESRI]=t:"IAU2000"in t?i["IAU2000:"+t.IAU2000]=t:console.log(t);return}}var n=t("./global"),o=t("./projString"),s=t("./wkt");n(i),e.exports=i},{"./global":34,"./projString":37,"./wkt":65}],32:[function(t,e){var i=t("./constants/Datum"),n=t("./constants/Ellipsoid"),o=t("./extend"),s=t("./datum"),r=1e-10,a=.16666666666666666,l=.04722222222222222,c=.022156084656084655;e.exports=function(t){if(t.datumCode&&"none"!==t.datumCode){var e=i[t.datumCode];e&&(t.datum_params=e.towgs84?e.towgs84.split(","):null,t.ellps=e.ellipse,t.datumName=e.datumName?e.datumName:t.datumCode)}if(!t.a){var h=n[t.ellps]?n[t.ellps]:n.WGS84;o(t,h)}return t.rf&&!t.b&&(t.b=(1-1/t.rf)*t.a),(0===t.rf||Math.abs(t.a-t.b)n?(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},i.forward=function(t){var e=t.x,i=t.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var n=s(this.e3,this.sin_phi,this.cos_phi),o=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,a=this.ns0*r(e-this.long0),l=o*Math.sin(a)+this.x0,c=this.rh-o*Math.cos(a)+this.y0;return t.x=l,t.y=c,t},i.inverse=function(t){var e,i,n,o,s,a;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),n=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),n=-1),o=0,0!==e&&(o=Math.atan2(n*t.x,n*t.y)),n=e*this.ns0/this.a,this.sphere?a=Math.asin((this.c-n*n)/(2*this.ns0)):(i=(this.c-n*n)/this.ns0,a=this.phi1z(this.e3,i)),s=r(o/this.ns0+this.long0),t.x=s,t.y=a,t},i.phi1z=function(t,e){var i,o,s,r,l,c=a(.5*e);if(n>t)return c;for(var h=t*t,u=1;25>=u;u++)if(i=Math.sin(c),o=Math.cos(c),s=t*i,r=1-s*s,l=.5*r*r/o*(e/(1-h)-i/r+.5/t*Math.log((1-s)/(1+s))),c+=l,Math.abs(l)<=1e-7)return c;return null},i.names=["Albers_Conic_Equal_Area","Albers","aea"]},{"../common/adjust_lon":5,"../common/asinz":6,"../common/msfnz":15,"../common/qsfnz":20}],40:[function(t,e,i){var n=t("../common/adjust_lon"),o=Math.PI/2,s=1e-10,r=t("../common/mlfn"),a=t("../common/e0fn"),l=t("../common/e1fn"),c=t("../common/e2fn"),h=t("../common/e3fn"),u=t("../common/gN"),d=t("../common/asinz"),p=t("../common/imlfn");i.init=function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},i.forward=function(t){var e,i,d,p,m,f,_,g,v,y,E,P,C,S,M,w,L,R,b,x,G,I,A,T=t.x,k=t.y,O=Math.sin(t.y),D=Math.cos(t.y),N=n(T-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=s?(t.x=this.x0+this.a*(o-k)*Math.sin(N),t.y=this.y0-this.a*(o-k)*Math.cos(N),t):Math.abs(this.sin_p12+1)<=s?(t.x=this.x0+this.a*(o+k)*Math.sin(N),t.y=this.y0+this.a*(o+k)*Math.cos(N),t):(R=this.sin_p12*O+this.cos_p12*D*Math.cos(N),w=Math.acos(R),L=w/Math.sin(w),t.x=this.x0+this.a*L*D*Math.sin(N),t.y=this.y0+this.a*L*(this.cos_p12*O-this.sin_p12*D*Math.cos(N)),t):(e=a(this.es),i=l(this.es),d=c(this.es),p=h(this.es),Math.abs(this.sin_p12-1)<=s?(m=this.a*r(e,i,d,p,o),f=this.a*r(e,i,d,p,k),t.x=this.x0+(m-f)*Math.sin(N),t.y=this.y0-(m-f)*Math.cos(N),t):Math.abs(this.sin_p12+1)<=s?(m=this.a*r(e,i,d,p,o),f=this.a*r(e,i,d,p,k),t.x=this.x0+(m+f)*Math.sin(N),t.y=this.y0+(m+f)*Math.cos(N),t):(_=O/D,g=u(this.a,this.e,this.sin_p12),v=u(this.a,this.e,O),y=Math.atan((1-this.es)*_+this.es*g*this.sin_p12/(v*D)),E=Math.atan2(Math.sin(N),this.cos_p12*Math.tan(y)-this.sin_p12*Math.cos(N)),b=0===E?Math.asin(this.cos_p12*Math.sin(y)-this.sin_p12*Math.cos(y)):Math.abs(Math.abs(E)-Math.PI)<=s?-Math.asin(this.cos_p12*Math.sin(y)-this.sin_p12*Math.cos(y)):Math.asin(Math.sin(N)*Math.cos(y)/Math.sin(E)),P=this.e*this.sin_p12/Math.sqrt(1-this.es),C=this.e*this.cos_p12*Math.cos(E)/Math.sqrt(1-this.es),S=P*C,M=C*C,x=b*b,G=x*b,I=G*b,A=I*b,w=g*b*(1-x*M*(1-M)/6+G/8*S*(1-2*M)+I/120*(M*(4-7*M)-3*P*P*(1-7*M))-A/48*S),t.x=this.x0+w*Math.sin(E),t.y=this.y0+w*Math.cos(E),t))},i.inverse=function(t){t.x-=this.x0,t.y-=this.y0;var e,i,m,f,_,g,v,y,E,P,C,S,M,w,L,R,b,x,G,I,A,T,k;if(this.sphere){if(e=Math.sqrt(t.x*t.x+t.y*t.y),e>2*o*this.a)return;return i=e/this.a,m=Math.sin(i),f=Math.cos(i),_=this.long0,Math.abs(e)<=s?g=this.lat0:(g=d(f*this.sin_p12+t.y*m*this.cos_p12/e),v=Math.abs(this.lat0)-o,_=n(Math.abs(v)<=s?this.lat0>=0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y):this.long0+Math.atan2(t.x*m,e*this.cos_p12*f-t.y*this.sin_p12*m))),t.x=_,t.y=g,t}return y=a(this.es),E=l(this.es),P=c(this.es),C=h(this.es),Math.abs(this.sin_p12-1)<=s?(S=this.a*r(y,E,P,C,o),e=Math.sqrt(t.x*t.x+t.y*t.y),M=S-e,g=p(M/this.a,y,E,P,C),_=n(this.long0+Math.atan2(t.x,-1*t.y)),t.x=_,t.y=g,t):Math.abs(this.sin_p12+1)<=s?(S=this.a*r(y,E,P,C,o),e=Math.sqrt(t.x*t.x+t.y*t.y),M=e-S,g=p(M/this.a,y,E,P,C),_=n(this.long0+Math.atan2(t.x,t.y)),t.x=_,t.y=g,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),R=Math.atan2(t.x,t.y),w=u(this.a,this.e,this.sin_p12),b=Math.cos(R),x=this.e*this.cos_p12*b,G=-x*x/(1-this.es),I=3*this.es*(1-G)*this.sin_p12*this.cos_p12*b/(1-this.es),A=e/w,T=A-G*(1+G)*Math.pow(A,3)/6-I*(1+3*G)*Math.pow(A,4)/24,k=1-G*T*T/2-A*T*T*T/6,L=Math.asin(this.sin_p12*Math.cos(T)+this.cos_p12*Math.sin(T)*b),_=n(this.long0+Math.asin(Math.sin(R)*Math.sin(T)/Math.cos(L))),g=Math.atan((1-this.es*k*this.sin_p12/Math.sin(L))*Math.tan(L)/(1-this.es)),t.x=_,t.y=g,t)},i.names=["Azimuthal_Equidistant","aeqd"]},{"../common/adjust_lon":5,"../common/asinz":6,"../common/e0fn":7,"../common/e1fn":8,"../common/e2fn":9,"../common/e3fn":10,"../common/gN":11,"../common/imlfn":12,"../common/mlfn":14}],41:[function(t,e,i){var n=t("../common/mlfn"),o=t("../common/e0fn"),s=t("../common/e1fn"),r=t("../common/e2fn"),a=t("../common/e3fn"),l=t("../common/gN"),c=t("../common/adjust_lon"),h=t("../common/adjust_lat"),u=t("../common/imlfn"),d=Math.PI/2,p=1e-10;i.init=function(){this.sphere||(this.e0=o(this.es),this.e1=s(this.es),this.e2=r(this.es),this.e3=a(this.es),this.ml0=this.a*n(this.e0,this.e1,this.e2,this.e3,this.lat0))},i.forward=function(t){var e,i,o=t.x,s=t.y;if(o=c(o-this.long0),this.sphere)e=this.a*Math.asin(Math.cos(s)*Math.sin(o)),i=this.a*(Math.atan2(Math.tan(s),Math.cos(o))-this.lat0);else{var r=Math.sin(s),a=Math.cos(s),h=l(this.a,this.e,r),u=Math.tan(s)*Math.tan(s),d=o*Math.cos(s),p=d*d,m=this.es*a*a/(1-this.es),f=this.a*n(this.e0,this.e1,this.e2,this.e3,s);e=h*d*(1-p*u*(1/6-(8-u+8*m)*p/120)),i=f-this.ml0+h*r/a*p*(.5+(5-u+6*m)*p/24)}return t.x=e+this.x0,t.y=i+this.y0,t},i.inverse=function(t){t.x-=this.x0,t.y-=this.y0;var e,i,n=t.x/this.a,o=t.y/this.a;if(this.sphere){var s=o+this.lat0;e=Math.asin(Math.sin(s)*Math.cos(n)),i=Math.atan2(Math.tan(n),Math.cos(s))}else{var r=this.ml0/this.a+o,a=u(r,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(a)-d)<=p)return t.x=this.long0,t.y=d,0>o&&(t.y*=-1),t;var m=l(this.a,this.e,Math.sin(a)),f=m*m*m/this.a/this.a*(1-this.es),_=Math.pow(Math.tan(a),2),g=n*this.a/m,v=g*g;e=a-m*Math.tan(a)/f*g*g*(.5-(1+3*_)*g*g/24),i=g*(1-v*(_/3+(1+3*_)*_*v/15))/Math.cos(a)}return t.x=c(i+this.long0),t.y=h(e),t},i.names=["Cassini","Cassini_Soldner","cass"]},{"../common/adjust_lat":4,"../common/adjust_lon":5,"../common/e0fn":7,"../common/e1fn":8,"../common/e2fn":9,"../common/e3fn":10,"../common/gN":11,"../common/imlfn":12,"../common/mlfn":14}],42:[function(t,e,i){var n=t("../common/adjust_lon"),o=t("../common/qsfnz"),s=t("../common/msfnz"),r=t("../common/iqsfnz");i.init=function(){this.sphere||(this.k0=s(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},i.forward=function(t){var e,i,s=t.x,r=t.y,a=n(s-this.long0);if(this.sphere)e=this.x0+this.a*a*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(r)/Math.cos(this.lat_ts);else{var l=o(this.e,Math.sin(r));e=this.x0+this.a*this.k0*a,i=this.y0+this.a*l*.5/this.k0}return t.x=e,t.y=i,t},i.inverse=function(t){t.x-=this.x0,t.y-=this.y0;var e,i;return this.sphere?(e=n(this.long0+t.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(i=r(this.e,2*t.y*this.k0/this.a),e=n(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=i,t},i.names=["cea"]},{"../common/adjust_lon":5,"../common/iqsfnz":13,"../common/msfnz":15,"../common/qsfnz":20}],43:[function(t,e,i){var n=t("../common/adjust_lon"),o=t("../common/adjust_lat");i.init=function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},i.forward=function(t){var e=t.x,i=t.y,s=n(e-this.long0),r=o(i-this.lat0);return t.x=this.x0+this.a*s*this.rc,t.y=this.y0+this.a*r,t},i.inverse=function(t){var e=t.x,i=t.y;return t.x=n(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=o(this.lat0+(i-this.y0)/this.a),t},i.names=["Equirectangular","Equidistant_Cylindrical","eqc"]},{"../common/adjust_lat":4,"../common/adjust_lon":5}],44:[function(t,e,i){var n=t("../common/e0fn"),o=t("../common/e1fn"),s=t("../common/e2fn"),r=t("../common/e3fn"),a=t("../common/msfnz"),l=t("../common/mlfn"),c=t("../common/adjust_lon"),h=t("../common/adjust_lat"),u=t("../common/imlfn"),d=1e-10;i.init=function(){Math.abs(this.lat1+this.lat2)=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var s=0;if(0!==i&&(s=Math.atan2(e*t.x,e*t.y)),this.sphere)return o=c(this.long0+s/this.ns),n=h(this.g-i/this.a),t.x=o,t.y=n,t;var r=this.g-i/this.a;return n=u(r,this.e0,this.e1,this.e2,this.e3),o=c(this.long0+s/this.ns),t.x=o,t.y=n,t},i.names=["Equidistant_Conic","eqdc"]},{"../common/adjust_lat":4,"../common/adjust_lon":5,"../common/e0fn":7,"../common/e1fn":8,"../common/e2fn":9,"../common/e3fn":10,"../common/imlfn":12,"../common/mlfn":14,"../common/msfnz":15}],45:[function(t,e,i){var n=Math.PI/4,o=t("../common/srat"),s=Math.PI/2,r=20;i.init=function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+n)/(Math.pow(Math.tan(.5*this.lat0+n),this.C)*o(this.e*t,this.ratexp))},i.forward=function(t){var e=t.x,i=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+n),this.C)*o(this.e*Math.sin(i),this.ratexp))-s,t.x=this.C*e,t},i.inverse=function(t){for(var e=1e-14,i=t.x/this.C,a=t.y,l=Math.pow(Math.tan(.5*a+n)/this.K,1/this.C),c=r;c>0&&(a=2*Math.atan(l*o(this.e*Math.sin(t.y),-.5*this.e))-s,!(Math.abs(a-t.y)0||Math.abs(l)<=o?(c=this.x0+this.a*a*i*Math.sin(s)/l,h=this.y0+this.a*a*(this.cos_p14*e-this.sin_p14*i*r)/l):(c=this.x0+this.infinity_dist*i*Math.sin(s),h=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*i*r)),t.x=c,t.y=h,t},i.inverse=function(t){var e,i,o,r,a,l;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(r=Math.atan2(e,this.rc),i=Math.sin(r),o=Math.cos(r),l=s(o*this.sin_p14+t.y*i*this.cos_p14/e),a=Math.atan2(t.x*i,e*this.cos_p14*o-t.y*this.sin_p14*i),a=n(this.long0+a)):(l=this.phic0,a=0),t.x=a,t.y=l,t},i.names=["gnom"]},{"../common/adjust_lon":5,"../common/asinz":6}],47:[function(t,e,i){var n=t("../common/adjust_lon");i.init=function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},i.forward=function(t){var e,i,o,s,r,a,l,c=t.x,h=t.y,u=n(c-this.long0);return e=Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(h/2+this.s45),this.alfa)/e)-this.s45),o=-u*this.alfa,s=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(o)),r=Math.asin(Math.cos(i)*Math.sin(o)/Math.cos(s)),a=this.n*r,l=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(s/2+this.s45),this.n),t.y=l*Math.cos(a)/1,t.x=l*Math.sin(a)/1,this.czech||(t.y*=-1,t.x*=-1),t},i.inverse=function(t){var e,i,n,o,s,r,a,l,c=t.x;t.x=t.y,t.y=c,this.czech||(t.y*=-1,t.x*=-1),r=Math.sqrt(t.x*t.x+t.y*t.y),s=Math.atan2(t.y,t.x),o=s/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/r,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(o)),i=Math.asin(Math.cos(n)*Math.sin(o)/Math.cos(e)),t.x=this.long0-i/this.alfa,a=e,l=0;var h=0;do t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-t.y)<1e-10&&(l=1),a=t.y,h+=1;while(0===l&&15>h);return h>=15?null:t},i.names=["Krovak","krovak"]},{"../common/adjust_lon":5}],48:[function(t,e,i){var n=Math.PI/2,o=Math.PI/4,s=1e-10,r=t("../common/qsfnz"),a=t("../common/adjust_lon");i.S_POLE=1,i.N_POLE=2,i.EQUIT=3,i.OBLIQ=4,i.init=function(){var t=Math.abs(this.lat0);if(this.mode=Math.abs(t-n)0){var e;switch(this.qp=r(this.e,1),this.mmf=.5/(1-this.es),this.apa=this.authset(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=r(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},i.forward=function(t){var e,i,l,c,h,u,d,p,m,f,_=t.x,g=t.y;if(_=a(_-this.long0),this.sphere){if(h=Math.sin(g),f=Math.cos(g),l=Math.cos(_),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(i=this.mode===this.EQUIT?1+f*l:1+this.sinph0*h+this.cosph0*f*l,s>=i)return null;i=Math.sqrt(2/i),e=i*f*Math.sin(_),i*=this.mode===this.EQUIT?h:this.cosph0*h-this.sinph0*f*l}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(l=-l),Math.abs(g+this.phi0)=0?(e=(m=Math.sqrt(u))*c,i=l*(this.mode===this.S_POLE?m:-m)):e=i=0}}return t.x=this.a*e+this.x0,t.y=this.a*i+this.y0,t},i.inverse=function(t){t.x-=this.x0,t.y-=this.y0;var e,i,o,r,l,c,h,u=t.x/this.a,d=t.y/this.a;if(this.sphere){var p,m=0,f=0;if(p=Math.sqrt(u*u+d*d),i=.5*p,i>1)return null;switch(i=2*Math.asin(i),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(f=Math.sin(i),m=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(p)<=s?0:Math.asin(d*f/p),u*=f,d=m*p;break;case this.OBLIQ:i=Math.abs(p)<=s?this.phi0:Math.asin(m*this.sinph0+d*f*this.cosph0/p),u*=f*this.cosph0,d=(m-Math.sin(i)*this.sinph0)*p;break;case this.N_POLE:d=-d,i=n-i;break;case this.S_POLE:i-=n}e=0!==d||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(u,d):0}else{if(h=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(u/=this.dd,d*=this.dd,c=Math.sqrt(u*u+d*d),s>c)return t.x=0,t.y=this.phi0,t;r=2*Math.asin(.5*c/this.rq),o=Math.cos(r),u*=r=Math.sin(r),this.mode===this.OBLIQ?(h=o*this.sinb1+d*r*this.cosb1/c,l=this.qp*h,d=c*this.cosb1*o-d*this.sinb1*r):(h=d*r/c,l=this.qp*h,d=c*o)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(d=-d),l=u*u+d*d,!l)return t.x=0,t.y=this.phi0,t;h=1-l/this.qp,this.mode===this.S_POLE&&(h=-h)}e=Math.atan2(u,d),i=this.authlat(Math.asin(h),this.apa)}return t.x=a(this.long0+e),t.y=i,t},i.P00=.3333333333333333,i.P01=.17222222222222222,i.P02=.10257936507936508,i.P10=.06388888888888888,i.P11=.0664021164021164,i.P20=.016415012942191543,i.authset=function(t){var e,i=[];return i[0]=t*this.P00,e=t*t,i[0]+=e*this.P01,i[1]=e*this.P10,e*=t,i[0]+=e*this.P02,i[1]+=e*this.P11,i[2]=e*this.P20,i},i.authlat=function(t,e){var i=t+t;return t+e[0]*Math.sin(i)+e[1]*Math.sin(i+i)+e[2]*Math.sin(i+i+i)},i.names=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"]},{"../common/adjust_lon":5,"../common/qsfnz":20}],49:[function(t,e,i){var n=1e-10,o=t("../common/msfnz"),s=t("../common/tsfnz"),r=Math.PI/2,a=t("../common/sign"),l=t("../common/adjust_lon"),c=t("../common/phi2z");i.init=function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)n?Math.log(r/h)/Math.log(a/u):e,isNaN(this.ns)&&(this.ns=e),this.f0=r/(this.ns*Math.pow(a,this.ns)),this.rh=this.a*this.f0*Math.pow(d,this.ns),this.title||(this.title="Lambert Conformal Conic")}},i.forward=function(t){var e=t.x,i=t.y;Math.abs(2*Math.abs(i)-Math.PI)<=n&&(i=a(i)*(r-2*n));var o,c,h=Math.abs(Math.abs(i)-r);if(h>n)o=s(this.e,i,Math.sin(i)),c=this.a*this.f0*Math.pow(o,this.ns);else{if(h=i*this.ns,0>=h)return null;c=0}var u=this.ns*l(e-this.long0);return t.x=this.k0*c*Math.sin(u)+this.x0,t.y=this.k0*(this.rh-c*Math.cos(u))+this.y0,t},i.inverse=function(t){var e,i,n,o,s,a=(t.x-this.x0)/this.k0,h=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(a*a+h*h),i=1):(e=-Math.sqrt(a*a+h*h),i=-1);var u=0;if(0!==e&&(u=Math.atan2(i*a,i*h)),0!==e||this.ns>0){if(i=1/this.ns,n=Math.pow(e/(this.a*this.f0),i),o=c(this.e,n),-9999===o)return null}else o=-r;return s=l(u/this.ns+this.long0),t.x=s,t.y=o,t},i.names=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_2SP","lcc"]},{"../common/adjust_lon":5,"../common/msfnz":15,"../common/phi2z":16,"../common/sign":21,"../common/tsfnz":24}],50:[function(t,e,i){function n(t){return t}i.init=function(){},i.forward=n,i.inverse=n,i.names=["longlat","identity"]},{}],51:[function(t,e,i){var n=t("../common/msfnz"),o=Math.PI/2,s=1e-10,r=57.29577951308232,a=t("../common/adjust_lon"),l=Math.PI/4,c=t("../common/tsfnz"),h=t("../common/phi2z");i.init=function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.k0=this.sphere?Math.cos(this.lat_ts):n(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k0=this.k?this.k:1)},i.forward=function(t){var e=t.x,i=t.y;if(i*r>90&&-90>i*r&&e*r>180&&-180>e*r)return null;var n,h;if(Math.abs(Math.abs(i)-o)<=s)return null;if(this.sphere)n=this.x0+this.a*this.k0*a(e-this.long0),h=this.y0+this.a*this.k0*Math.log(Math.tan(l+.5*i));else{var u=Math.sin(i),d=c(this.e,i,u);n=this.x0+this.a*this.k0*a(e-this.long0),h=this.y0-this.a*this.k0*Math.log(d)}return t.x=n,t.y=h,t},i.inverse=function(t){var e,i,n=t.x-this.x0,s=t.y-this.y0;if(this.sphere)i=o-2*Math.atan(Math.exp(-s/(this.a*this.k0)));else{var r=Math.exp(-s/(this.a*this.k0));if(i=h(this.e,r),-9999===i)return null}return e=a(this.long0+n/(this.a*this.k0)),t.x=e,t.y=i,t},i.names=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{"../common/adjust_lon":5,"../common/msfnz":15,"../common/phi2z":16,"../common/tsfnz":24}],52:[function(t,e,i){var n=t("../common/adjust_lon");i.init=function(){},i.forward=function(t){var e=t.x,i=t.y,o=n(e-this.long0),s=this.x0+this.a*o,r=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;return t.x=s,t.y=r,t},i.inverse=function(t){t.x-=this.x0,t.y-=this.y0;var e=n(this.long0+t.x/this.a),i=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=e,t.y=i,t},i.names=["Miller_Cylindrical","mill"]},{"../common/adjust_lon":5}],53:[function(t,e,i){var n=t("../common/adjust_lon"),o=1e-10;i.init=function(){},i.forward=function(t){for(var e=t.x,i=t.y,s=n(e-this.long0),r=i,a=Math.PI*Math.sin(i),l=0;!0;l++){var c=-(r+Math.sin(r)-a)/(1+Math.cos(r));if(r+=c,Math.abs(c).999999999999&&(i=.999999999999),e=Math.asin(i);var o=n(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));o<-Math.PI&&(o=-Math.PI),o>Math.PI&&(o=Math.PI),i=(2*e+Math.sin(2*e))/Math.PI,Math.abs(i)>1&&(i=1);var s=Math.asin(i);return t.x=o,t.y=s,t},i.names=["Mollweide","moll"]},{"../common/adjust_lon":5}],54:[function(t,e,i){var n=484813681109536e-20;i.iterations=1,i.init=function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},i.forward=function(t){var e,i=t.x,o=t.y,s=o-this.lat0,r=i-this.long0,a=s/n*1e-5,l=r,c=1,h=0;for(e=1;10>=e;e++)c*=a,h+=this.A[e]*c;var u,d,p=h,m=l,f=1,_=0,g=0,v=0;for(e=1;6>=e;e++)u=f*p-_*m,d=_*p+f*m,f=u,_=d,g=g+this.B_re[e]*f-this.B_im[e]*_,v=v+this.B_im[e]*f+this.B_re[e]*_;return t.x=v*this.a+this.x0,t.y=g*this.a+this.y0,t},i.inverse=function(t){var e,i,o,s=t.x,r=t.y,a=s-this.x0,l=r-this.y0,c=l/this.a,h=a/this.a,u=1,d=0,p=0,m=0;for(e=1;6>=e;e++)i=u*c-d*h,o=d*c+u*h,u=i,d=o,p=p+this.C_re[e]*u-this.C_im[e]*d,m=m+this.C_im[e]*u+this.C_re[e]*d;for(var f=0;f=e;e++)_=v*p-y*m,g=y*p+v*m,v=_,y=g,E+=(e-1)*(this.B_re[e]*v-this.B_im[e]*y),P+=(e-1)*(this.B_im[e]*v+this.B_re[e]*y);v=1,y=0;var C=this.B_re[1],S=this.B_im[1];for(e=2;6>=e;e++)_=v*p-y*m,g=y*p+v*m,v=_,y=g,C+=e*(this.B_re[e]*v-this.B_im[e]*y),S+=e*(this.B_im[e]*v+this.B_re[e]*y);var M=C*C+S*S;p=(E*C+P*S)/M,m=(P*C-E*S)/M}var w=p,L=m,R=1,b=0;for(e=1;9>=e;e++)R*=w,b+=this.D[e]*R;var x=this.lat0+b*n*1e5,G=this.long0+L;return t.x=G,t.y=x,t},i.names=["New_Zealand_Map_Grid","nzmg"]},{}],55:[function(t,e,i){var n=t("../common/tsfnz"),o=t("../common/adjust_lon"),s=t("../common/phi2z"),r=Math.PI/2,a=Math.PI/4,l=1e-10;i.init=function(){this.no_off=this.no_off||!1,this.no_rot=this.no_rot||!1,isNaN(this.k0)&&(this.k0=1);var t=Math.sin(this.lat0),e=Math.cos(this.lat0),i=this.e*t;this.bl=Math.sqrt(1+this.es/(1-this.es)*Math.pow(e,4)),this.al=this.a*this.bl*this.k0*Math.sqrt(1-this.es)/(1-i*i);var s=n(this.e,this.lat0,t),r=this.bl/e*Math.sqrt((1-this.es)/(1-i*i));1>r*r&&(r=1);var a,l;if(isNaN(this.longc)){var c=n(this.e,this.lat1,Math.sin(this.lat1)),h=n(this.e,this.lat2,Math.sin(this.lat2));this.el=this.lat0>=0?(r+Math.sqrt(r*r-1))*Math.pow(s,this.bl):(r-Math.sqrt(r*r-1))*Math.pow(s,this.bl);var u=Math.pow(c,this.bl),d=Math.pow(h,this.bl);a=this.el/u,l=.5*(a-1/a);var p=(this.el*this.el-d*u)/(this.el*this.el+d*u),m=(d-u)/(d+u),f=o(this.long1-this.long2);this.long0=.5*(this.long1+this.long2)-Math.atan(p*Math.tan(.5*this.bl*f)/m)/this.bl,this.long0=o(this.long0);var _=o(this.long1-this.long0);this.gamma0=Math.atan(Math.sin(this.bl*_)/l),this.alpha=Math.asin(r*Math.sin(this.gamma0))}else a=this.lat0>=0?r+Math.sqrt(r*r-1):r-Math.sqrt(r*r-1),this.el=a*Math.pow(s,this.bl),l=.5*(a-1/a),this.gamma0=Math.asin(Math.sin(this.alpha)/r),this.long0=this.longc-Math.asin(l*Math.tan(this.gamma0))/this.bl;this.uc=this.no_off?0:this.lat0>=0?this.al/this.bl*Math.atan2(Math.sqrt(r*r-1),Math.cos(this.alpha)):-1*this.al/this.bl*Math.atan2(Math.sqrt(r*r-1),Math.cos(this.alpha))},i.forward=function(t){var e,i,s,c=t.x,h=t.y,u=o(c-this.long0);if(Math.abs(Math.abs(h)-r)<=l)s=h>0?-1:1,i=this.al/this.bl*Math.log(Math.tan(a+s*this.gamma0*.5)),e=-1*s*r*this.al/this.bl;else{var d=n(this.e,h,Math.sin(h)),p=this.el/Math.pow(d,this.bl),m=.5*(p-1/p),f=.5*(p+1/p),_=Math.sin(this.bl*u),g=(m*Math.sin(this.gamma0)-_*Math.cos(this.gamma0))/f;i=Math.abs(Math.abs(g)-1)<=l?Number.POSITIVE_INFINITY:.5*this.al*Math.log((1-g)/(1+g))/this.bl,e=Math.abs(Math.cos(this.bl*u))<=l?this.al*this.bl*u:this.al*Math.atan2(m*Math.cos(this.gamma0)+_*Math.sin(this.gamma0),Math.cos(this.bl*u))/this.bl}return this.no_rot?(t.x=this.x0+e,t.y=this.y0+i):(e-=this.uc,t.x=this.x0+i*Math.cos(this.alpha)+e*Math.sin(this.alpha),t.y=this.y0+e*Math.cos(this.alpha)-i*Math.sin(this.alpha)),t},i.inverse=function(t){var e,i;this.no_rot?(i=t.y-this.y0,e=t.x-this.x0):(i=(t.x-this.x0)*Math.cos(this.alpha)-(t.y-this.y0)*Math.sin(this.alpha),e=(t.y-this.y0)*Math.cos(this.alpha)+(t.x-this.x0)*Math.sin(this.alpha),e+=this.uc);var n=Math.exp(-1*this.bl*i/this.al),a=.5*(n-1/n),c=.5*(n+1/n),h=Math.sin(this.bl*e/this.al),u=(h*Math.cos(this.gamma0)+a*Math.sin(this.gamma0))/c,d=Math.pow(this.el/Math.sqrt((1+u)/(1-u)),1/this.bl);return Math.abs(u-1)r?(r=Math.sin(e),i=this.long0+t.x*Math.sqrt(1-this.es*r*r)/(this.a*Math.cos(e)),s=n(i)):c>r-h&&(s=this.long0)),t.x=s,t.y=e,t},i.names=["Sinusoidal","sinu"]},{"../common/adjust_lat":4,"../common/adjust_lon":5,"../common/asinz":6,"../common/pj_enfn":17,"../common/pj_inv_mlfn":18,"../common/pj_mlfn":19}],58:[function(t,e,i){i.init=function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),i=this.a,n=this.rf,o=1/n,s=2*o-Math.pow(o,2),r=this.e=Math.sqrt(s);this.R=this.k0*i*Math.sqrt(1-s)/(1-s*Math.pow(e,2)),this.alpha=Math.sqrt(1+s/(1-s)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),l=Math.log(Math.tan(Math.PI/4+t/2)),c=Math.log((1+r*e)/(1-r*e));this.K=a-this.alpha*l+this.alpha*r/2*c},i.forward=function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),n=-this.alpha*(e+i)+this.K,o=2*(Math.atan(Math.exp(n))-Math.PI/4),s=this.alpha*(t.x-this.lambda0),r=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(o)+Math.cos(this.b0)*Math.cos(s))),a=Math.asin(Math.cos(this.b0)*Math.sin(o)-Math.sin(this.b0)*Math.cos(o)*Math.cos(s));return t.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,t.x=this.R*r+this.x0,t},i.inverse=function(t){for(var e=t.x-this.x0,i=t.y-this.y0,n=e/this.R,o=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(o)+Math.sin(this.b0)*Math.cos(o)*Math.cos(n)),r=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(o))),a=this.lambda0+r/this.alpha,l=0,c=s,h=-1e3,u=0;Math.abs(c-h)>1e-7;){if(++u>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(c))/2)),h=c,c=2*Math.atan(Math.exp(l))-Math.PI/2}return t.x=a,t.y=c,t},i.names=["somerc"]},{}],59:[function(t,e,i){var n=Math.PI/2,o=1e-10,s=t("../common/sign"),r=t("../common/msfnz"),a=t("../common/tsfnz"),l=t("../common/phi2z"),c=t("../common/adjust_lon");i.ssfn_=function(t,e,i){return e*=i,Math.tan(.5*(n+t))*Math.pow((1-e)/(1+e),.5*i)},i.init=function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=o&&(this.k0=.5*(1+s(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=o&&(this.con=this.lat0>0?1:-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=o&&(this.k0=.5*this.cons*r(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/a(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=r(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-n,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},i.forward=function(t){var e,i,s,r,l,h,u=t.x,d=t.y,p=Math.sin(d),m=Math.cos(d),f=c(u-this.long0);return Math.abs(Math.abs(u-this.long0)-Math.PI)<=o&&Math.abs(d+this.lat0)<=o?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*p+this.coslat0*m*Math.cos(f)),t.x=this.a*e*m*Math.sin(f)+this.x0,t.y=this.a*e*(this.coslat0*p-this.sinlat0*m*Math.cos(f))+this.y0,t):(i=2*Math.atan(this.ssfn_(d,p,this.e))-n,r=Math.cos(i),s=Math.sin(i),Math.abs(this.coslat0)<=o?(l=a(this.e,d*this.con,this.con*p),h=2*this.a*this.k0*l/this.cons,t.x=this.x0+h*Math.sin(u-this.long0),t.y=this.y0-this.con*h*Math.cos(u-this.long0),t):(Math.abs(this.sinlat0)=h?(t.x=e,t.y=i,t):(i=Math.asin(Math.cos(u)*this.sinlat0+t.y*Math.sin(u)*this.coslat0/h),e=c(Math.abs(this.coslat0)0?this.long0+Math.atan2(t.x,-1*t.y):this.long0+Math.atan2(t.x,t.y):this.long0+Math.atan2(t.x*Math.sin(u),h*this.coslat0*Math.cos(u)-t.y*this.sinlat0*Math.sin(u))),t.x=e,t.y=i,t)}if(Math.abs(this.coslat0)<=o){if(o>=h)return i=this.lat0,e=this.long0,t.x=e,t.y=i,t;t.x*=this.con,t.y*=this.con,s=h*this.cons/(2*this.a*this.k0),i=this.con*l(this.e,s),e=this.con*c(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else r=2*Math.atan(h*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,o>=h?a=this.X0:(a=Math.asin(Math.cos(r)*this.sinX0+t.y*Math.sin(r)*this.cosX0/h),e=c(this.long0+Math.atan2(t.x*Math.sin(r),h*this.cosX0*Math.cos(r)-t.y*this.sinX0*Math.sin(r)))),i=-1*l(this.e,Math.tan(.5*(n+a)));return t.x=e,t.y=i,t},i.names=["stere"]},{"../common/adjust_lon":5,"../common/msfnz":15,"../common/phi2z":16,"../common/sign":21,"../common/tsfnz":24}],60:[function(t,e,i){var n=t("./gauss"),o=t("../common/adjust_lon");i.init=function(){n.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},i.forward=function(t){var e,i,s,r;return t.x=o(t.x-this.long0),n.forward.apply(this,[t]),e=Math.sin(t.y),i=Math.cos(t.y),s=Math.cos(t.x),r=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*i*s),t.x=r*i*Math.sin(t.x),t.y=r*(this.cosc0*e-this.sinc0*i*s),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},i.inverse=function(t){var e,i,s,r,a;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,a=Math.sqrt(t.x*t.x+t.y*t.y)){var l=2*Math.atan2(a,this.R2);e=Math.sin(l),i=Math.cos(l),r=Math.asin(i*this.sinc0+t.y*e*this.cosc0/a),s=Math.atan2(t.x*e,a*this.cosc0*i-t.y*this.sinc0*e)}else r=this.phic0,s=0;return t.x=s,t.y=r,n.inverse.apply(this,[t]),t.x=o(t.x+this.long0),t},i.names=["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative"]},{"../common/adjust_lon":5,"./gauss":45}],61:[function(t,e,i){var n=t("../common/e0fn"),o=t("../common/e1fn"),s=t("../common/e2fn"),r=t("../common/e3fn"),a=t("../common/mlfn"),l=t("../common/adjust_lon"),c=Math.PI/2,h=1e-10,u=t("../common/sign"),d=t("../common/asinz");i.init=function(){this.e0=n(this.es),this.e1=o(this.es),this.e2=s(this.es),this.e3=r(this.es),this.ml0=this.a*a(this.e0,this.e1,this.e2,this.e3,this.lat0)},i.forward=function(t){var e,i,n,o=t.x,s=t.y,r=l(o-this.long0),c=Math.sin(s),h=Math.cos(s);if(this.sphere){var u=h*Math.sin(r);if(Math.abs(Math.abs(u)-1)<1e-10)return 93;i=.5*this.a*this.k0*Math.log((1+u)/(1-u)),e=Math.acos(h*Math.cos(r)/Math.sqrt(1-u*u)),0>s&&(e=-e),n=this.a*this.k0*(e-this.lat0)}else{var d=h*r,p=Math.pow(d,2),m=this.ep2*Math.pow(h,2),f=Math.tan(s),_=Math.pow(f,2);e=1-this.es*Math.pow(c,2);var g=this.a/Math.sqrt(e),v=this.a*a(this.e0,this.e1,this.e2,this.e3,s);i=this.k0*g*d*(1+p/6*(1-_+m+p/20*(5-18*_+Math.pow(_,2)+72*m-58*this.ep2)))+this.x0,n=this.k0*(v-this.ml0+g*f*p*(.5+p/24*(5-_+9*m+4*Math.pow(m,2)+p/30*(61-58*_+Math.pow(_,2)+600*m-330*this.ep2))))+this.y0}return t.x=i,t.y=n,t},i.inverse=function(t){var e,i,n,o,s,r,a=6;if(this.sphere){var p=Math.exp(t.x/(this.a*this.k0)),m=.5*(p-1/p),f=this.lat0+t.y/(this.a*this.k0),_=Math.cos(f);e=Math.sqrt((1-_*_)/(1+m*m)),s=d(e),0>f&&(s=-s),r=0===m&&0===_?this.long0:l(Math.atan2(m,_)+this.long0)}else{var g=t.x-this.x0,v=t.y-this.y0;for(e=(this.ml0+v/this.k0)/this.a,i=e,o=0;n=(e+this.e1*Math.sin(2*i)-this.e2*Math.sin(4*i)+this.e3*Math.sin(6*i))/this.e0-i,i+=n,!(Math.abs(n)<=h);o++)if(o>=a)return 95;if(Math.abs(i)=0?this.y0+Math.PI*this.R*Math.tan(.5*h):this.y0+Math.PI*this.R*-Math.tan(.5*h));var u=.5*Math.abs(Math.PI/c-c/Math.PI),d=u*u,p=Math.sin(h),m=Math.cos(h),f=m/(p+m-1),_=f*f,g=f*(2/p-1),v=g*g,y=Math.PI*this.R*(u*(f-v)+Math.sqrt(d*(f-v)*(f-v)-(v+d)*(_-v)))/(v+d);0>c&&(y=-y),e=this.x0+y;var E=d+f;return y=Math.PI*this.R*(g*E-u*Math.sqrt((v+d)*(d+1)-E*E))/(v+d),i=l>=0?this.y0+y:this.y0-y,t.x=e,t.y=i,t},i.inverse=function(t){var e,i,o,r,a,l,c,h,u,d,p,m,f;return t.x-=this.x0,t.y-=this.y0,p=Math.PI*this.R,o=t.x/p,r=t.y/p,a=o*o+r*r,l=-Math.abs(r)*(1+a),c=l-2*r*r+o*o,h=-2*l+1+2*r*r+a*a,f=r*r/h+(2*c*c*c/h/h/h-9*l*c/h/h)/27,u=(l-c*c/3/h)/h,d=2*Math.sqrt(-u/3),p=3*f/u/d,Math.abs(p)>1&&(p=p>=0?1:-1),m=Math.acos(p)/3,i=t.y>=0?(-d*Math.cos(m+Math.PI/3)-c/3/h)*Math.PI:-(-d*Math.cos(m+Math.PI/3)-c/3/h)*Math.PI,e=Math.abs(o)-1?(e[o]={name:t[0].toLowerCase(),convert:t[1]},3===t.length&&(e[o].auth=t[2])):"SPHEROID"===o?(e[o]={name:t[0],a:t[1],rf:t[2]},4===t.length&&(e[o].auth=t[3])):["GEOGCS","GEOCCS","DATUM","VERT_CS","COMPD_CS","LOCAL_CS","FITTED_CS","LOCAL_DATUM"].indexOf(o)>-1?(t[0]=["name",t[0]],i(e,o,t)):t.every(function(t){return Array.isArray(t)})?i(e,o,t):n(t,e[o])):e[o]=!0)):void(e[t]=!0)}function o(t,e){var i=e[0],n=e[1];!(i in t)&&n in t&&(t[i]=t[n],3===e.length&&(t[i]=e[2](t[i])))}function s(t){return t*a}function r(t){function e(e){var i=t.to_meter||1;return parseFloat(e,10)*i}"GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):t.projName="object"==typeof t.PROJECTION?Object.keys(t.PROJECTION)[0]:t.PROJECTION,t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&(t.to_meter=parseFloat(t.UNIT.convert,10))),t.GEOGCS&&(t.datumCode=t.GEOGCS.DATUM?t.GEOGCS.DATUM.name.toLowerCase():t.GEOGCS.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),("new_zealand_geodetic_datum_1949"===t.datumCode||"new_zealand_1949"===t.datumCode)&&(t.datumCode="nzgd49"),"wgs_1984"===t.datumCode&&("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"_ferro"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),"_jakarta"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),t.GEOGCS.DATUM&&t.GEOGCS.DATUM.SPHEROID&&(t.ellps=t.GEOGCS.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=t.GEOGCS.DATUM.SPHEROID.a,t.rf=parseFloat(t.GEOGCS.DATUM.SPHEROID.rf,10)),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36")),t.b&&!isFinite(t.b)&&(t.b=t.a);var i=function(e){return o(t,e)},n=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_2","Standard_Parallel_2"],["false_easting","False_Easting"],["false_northing","False_Northing"],["central_meridian","Central_Meridian"],["latitude_of_origin","Latitude_Of_Origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",s],["longitude_of_center","Longitude_Of_Center"],["longc","longitude_of_center",s],["x0","false_easting",e],["y0","false_northing",e],["long0","central_meridian",s],["lat0","latitude_of_origin",s],["lat0","standard_parallel_1",s],["lat1","standard_parallel_1",s],["lat2","standard_parallel_2",s],["alpha","azimuth",s],["srsCode","name"]];n.forEach(i),t.long0||!t.longc||"Albers_Conic_Equal_Area"!==t.PROJECTION&&"Lambert_Azimuthal_Equal_Area"!==t.PROJECTION||(t.long0=t.longc)}var a=.017453292519943295,l=t("./extend");e.exports=function(t,e){var i=JSON.parse((","+t).replace(/\s*\,\s*([A-Z_0-9]+?)(\[)/g,',["$1",').slice(1).replace(/\s*\,\s*([A-Z_0-9]+?)\]/g,',"$1"]')),o=i.shift(),s=i.shift();i.unshift(["name",s]),i.unshift(["type",o]),i.unshift("output");var a={};return n(i,a),r(a.output),l(e,a.output)}},{"./extend":33}],66:[function(t,e,i){function n(t){return t*(Math.PI/180)}function o(t){return 180*(t/Math.PI)}function s(t){var e,i,o,s,r,l,c,h,u,d=t.lat,p=t.lon,m=6378137,f=.00669438,_=.9996,g=n(d),v=n(p);u=Math.floor((p+180)/6)+1,180===p&&(u=60),d>=56&&64>d&&p>=3&&12>p&&(u=32),d>=72&&84>d&&(p>=0&&9>p?u=31:p>=9&&21>p?u=33:p>=21&&33>p?u=35:p>=33&&42>p&&(u=37)),e=6*(u-1)-180+3,h=n(e),i=f/(1-f),o=m/Math.sqrt(1-f*Math.sin(g)*Math.sin(g)),s=Math.tan(g)*Math.tan(g),r=i*Math.cos(g)*Math.cos(g),l=Math.cos(g)*(v-h),c=m*((1-f/4-3*f*f/64-5*f*f*f/256)*g-(3*f/8+3*f*f/32+45*f*f*f/1024)*Math.sin(2*g)+(15*f*f/256+45*f*f*f/1024)*Math.sin(4*g)-35*f*f*f/3072*Math.sin(6*g));var y=_*o*(l+(1-s+r)*l*l*l/6+(5-18*s+s*s+72*r-58*i)*l*l*l*l*l/120)+5e5,E=_*(c+o*Math.tan(g)*(l*l/2+(5-s+9*r+4*r*r)*l*l*l*l/24+(61-58*s+s*s+600*r-330*i)*l*l*l*l*l*l/720));return 0>d&&(E+=1e7),{northing:Math.round(E),easting:Math.round(y),zoneNumber:u,zoneLetter:a(d)}}function r(t){var e=t.northing,i=t.easting,n=t.zoneLetter,s=t.zoneNumber;if(0>s||s>60)return null;var a,l,c,h,u,d,p,m,f,_,g=.9996,v=6378137,y=.00669438,E=(1-Math.sqrt(1-y))/(1+Math.sqrt(1-y)),P=i-5e5,C=e;"N">n&&(C-=1e7),m=6*(s-1)-180+3,a=y/(1-y),p=C/g,f=p/(v*(1-y/4-3*y*y/64-5*y*y*y/256)),_=f+(3*E/2-27*E*E*E/32)*Math.sin(2*f)+(21*E*E/16-55*E*E*E*E/32)*Math.sin(4*f)+151*E*E*E/96*Math.sin(6*f),l=v/Math.sqrt(1-y*Math.sin(_)*Math.sin(_)),c=Math.tan(_)*Math.tan(_),h=a*Math.cos(_)*Math.cos(_),u=v*(1-y)/Math.pow(1-y*Math.sin(_)*Math.sin(_),1.5),d=P/(l*g);var S=_-l*Math.tan(_)/u*(d*d/2-(5+3*c+10*h-4*h*h-9*a)*d*d*d*d/24+(61+90*c+298*h+45*c*c-252*a-3*h*h)*d*d*d*d*d*d/720);S=o(S);var M=(d-(1+2*c+h)*d*d*d/6+(5-2*h+28*c-3*h*h+8*a+24*c*c)*d*d*d*d*d/120)/Math.cos(_);M=m+o(M);var w;if(t.accuracy){var L=r({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});w={top:L.lat,right:L.lon,bottom:S,left:M}}else w={lat:S,lon:M};return w}function a(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function l(t,e){var i=""+t.easting,n=""+t.northing;return t.zoneNumber+t.zoneLetter+c(t.easting,t.northing,t.zoneNumber)+i.substr(i.length-5,e)+n.substr(n.length-5,e)}function c(t,e,i){var n=h(i),o=Math.floor(t/1e5),s=Math.floor(e/1e5)%20;return u(o,s,n)}function h(t){var e=t%_;return 0===e&&(e=_),e}function u(t,e,i){var n=i-1,o=g.charCodeAt(n),s=v.charCodeAt(n),r=o+t-1,a=s+e,l=!1;r>S&&(r=r-S+y-1,l=!0),(r===E||E>o&&r>E||(r>E||E>o)&&l)&&r++,(r===P||P>o&&r>P||(r>P||P>o)&&l)&&(r++,r===E&&r++),r>S&&(r=r-S+y-1),a>C?(a=a-C+y-1, +l=!0):l=!1,(a===E||E>s&&a>E||(a>E||E>s)&&l)&&a++,(a===P||P>s&&a>P||(a>P||P>s)&&l)&&(a++,a===E&&a++),a>C&&(a=a-C+y-1);var c=String.fromCharCode(r)+String.fromCharCode(a);return c}function d(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,i=t.length,n=null,o="",s=0;!/[A-Z]/.test(e=t.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+t;o+=e,s++}var r=parseInt(o,10);if(0===s||s+3>i)throw"MGRSPoint bad conversion from: "+t;var a=t.charAt(s++);if("A">=a||"B"===a||"Y"===a||a>="Z"||"I"===a||"O"===a)throw"MGRSPoint zone letter "+a+" not handled: "+t;n=t.substring(s,s+=2);for(var l=h(r),c=p(n.charAt(0),l),u=m(n.charAt(1),l);u0&&(_=1e5/Math.pow(10,P),g=t.substring(s,s+P),C=parseFloat(g)*_,v=t.substring(s+P),S=parseFloat(v)*_),y=C+c,E=S+u,{easting:y,northing:E,zoneLetter:a,zoneNumber:r,accuracy:_}}function p(t,e){for(var i=g.charCodeAt(e-1),n=1e5,o=!1;i!==t.charCodeAt(0);){if(i++,i===E&&i++,i===P&&i++,i>S){if(o)throw"Bad character: "+t;i=y,o=!0}n+=1e5}return n}function m(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var i=v.charCodeAt(e-1),n=0,o=!1;i!==t.charCodeAt(0);){if(i++,i===E&&i++,i===P&&i++,i>C){if(o)throw"Bad character: "+t;i=y,o=!0}n+=1e5}return n}function f(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}var _=6,g="AJSAJS",v="AFAFAF",y=65,E=73,P=79,C=86,S=90;i.forward=function(t,e){return e=e||5,l(s({lat:t[1],lon:t[0]}),e)},i.inverse=function(t){var e=r(d(t.toUpperCase()));return[e.left,e.bottom,e.right,e.top]},i.toPoint=function(t){var e=i.inverse(t);return[(e[2]+e[0])/2,(e[3]+e[1])/2]}},{}],67:[function(t,e){e.exports={name:"proj4",version:"2.2.1",description:"Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.",main:"lib/index.js",directories:{test:"test",doc:"docs"},scripts:{test:"./node_modules/istanbul/lib/cli.js test ./node_modules/mocha/bin/_mocha test/test.js"},repository:{type:"git",url:"git://github.com/proj4js/proj4js.git"},author:"",license:"MIT",jam:{main:"dist/proj4.js",include:["dist/proj4.js","README.md","AUTHORS","LICENSE.md"]},devDependencies:{"grunt-cli":"~0.1.13",grunt:"~0.4.2","grunt-contrib-connect":"~0.6.0","grunt-contrib-jshint":"~0.8.0",chai:"~1.8.1",mocha:"~1.17.1","grunt-mocha-phantomjs":"~0.4.0",browserify:"~3.24.5","grunt-browserify":"~1.3.0","grunt-contrib-uglify":"~0.3.2",curl:"git://github.com/cujojs/curl.git",istanbul:"~0.2.4",tin:"~0.4.0"},dependencies:{mgrs:"0.0.0"}}},{}],"./includedProjections":[function(t,e){e.exports=t("gWUPNW")},{}],gWUPNW:[function(t,e){var i=[t("./lib/projections/tmerc"),t("./lib/projections/utm"),t("./lib/projections/sterea"),t("./lib/projections/stere"),t("./lib/projections/somerc"),t("./lib/projections/omerc"),t("./lib/projections/lcc"),t("./lib/projections/krovak"),t("./lib/projections/cass"),t("./lib/projections/laea"),t("./lib/projections/aea"),t("./lib/projections/gnom"),t("./lib/projections/cea"),t("./lib/projections/eqc"),t("./lib/projections/poly"),t("./lib/projections/nzmg"),t("./lib/projections/mill"),t("./lib/projections/sinu"),t("./lib/projections/moll"),t("./lib/projections/eqdc"),t("./lib/projections/vandg"),t("./lib/projections/aeqd")];e.exports=function(t){i.forEach(function(e){t.Proj.projections.add(e)})}},{"./lib/projections/aea":39,"./lib/projections/aeqd":40,"./lib/projections/cass":41,"./lib/projections/cea":42,"./lib/projections/eqc":43,"./lib/projections/eqdc":44,"./lib/projections/gnom":46,"./lib/projections/krovak":47,"./lib/projections/laea":48,"./lib/projections/lcc":49,"./lib/projections/mill":52,"./lib/projections/moll":53,"./lib/projections/nzmg":54,"./lib/projections/omerc":55,"./lib/projections/poly":56,"./lib/projections/sinu":57,"./lib/projections/somerc":58,"./lib/projections/stere":59,"./lib/projections/sterea":60,"./lib/projections/tmerc":61,"./lib/projections/utm":62,"./lib/projections/vandg":63}]},{},[35])(35)}),!function(t,e){proj4leaflet07x=function(t,i){return"function"==typeof e?e(t,i):e}(leaflet,proj4)}(this,function(t,e){return t.Proj={},t.Proj._isProj4Obj=function(t){return"undefined"!=typeof t.inverse&&"undefined"!=typeof t.forward},t.Proj.ScaleDependantTransformation=function(t){this.scaleTransforms=t},t.Proj.ScaleDependantTransformation.prototype.transform=function(t,e){return this.scaleTransforms[e].transform(t,e)},t.Proj.ScaleDependantTransformation.prototype.untransform=function(t,e){return this.scaleTransforms[e].untransform(t,e)},t.Proj.Projection=t.Class.extend({initialize:function(i,n){if(t.Proj._isProj4Obj(i))this._proj=i;else{var o=i;if(n)e.defs(o,n);else if(void 0===e.defs[o]){var s=o.split(":");if(s.length>3&&(o=s[s.length-3]+":"+s[s.length-1]),void 0===e.defs[o])throw"No projection definition for code "+o}this._proj=e(o)}},project:function(e){var i=this._proj.forward([e.lng,e.lat]);return new t.Point(i[0],i[1])},unproject:function(e,i){var n=this._proj.inverse([e.x,e.y]);return new t.LatLng(n[1],n[0],i)}}),t.Proj.CRS=t.Class.extend({includes:t.CRS,options:{transformation:new t.Transformation(1,0,-1,0)},initialize:function(e,i,n){var o,s,r,a;if(t.Proj._isProj4Obj(e)?(s=e,o=s.srsCode,a=i||{},this.projection=new t.Proj.Projection(s)):(o=e,r=i,a=n||{},this.projection=new t.Proj.Projection(o,r)),t.Util.setOptions(this,a),this.code=o,this.transformation=this.options.transformation,this.options.origin&&(this.transformation=new t.Transformation(1,-this.options.origin[0],-1,this.options.origin[1])),this.options.scales)this._scales=this.options.scales;else if(this.options.resolutions){this._scales=[];for(var l=this.options.resolutions.length-1;l>=0;l--)this.options.resolutions[l]&&(this._scales[l]=1/this.options.resolutions[l])}},scale:function(t){var e,i,n,o,s=Math.floor(t);return t===s?this._scales[t]:(e=this._scales[s],i=this._scales[s+1],n=i-e,o=t-s,e+n*o)},getSize:function(e){var i,n,o,s=this.options.bounds;return s?(i=this.scale(e),n=this.transformation.transform(s.min,i),o=this.transformation.transform(s.max,i),t.point(Math.abs(o.x-n.x),Math.abs(o.y-n.y))):(i=256*Math.pow(2,e),t.point(i,i))}}),t.Proj.CRS.TMS=t.Proj.CRS.extend({options:{tileSize:256},initialize:function(e,i,n,o){var s,r,a,l,c;t.Proj._isProj4Obj(e)?(a=e,l=i,c=n||{},c.origin=[l[0],l[3]],t.Proj.CRS.prototype.initialize.call(this,a,c)):(s=e,r=i,l=n,c=o||{},c.origin=[l[0],l[3]],t.Proj.CRS.prototype.initialize.call(this,s,r,c)),this.projectedBounds=l,this._sizes=this._calculateSizes()},_calculateSizes:function(){var e,i,n,o,s=[],r=this.projectedBounds;for(i=this._scales.length-1;i>=0;i--)this._scales[i]&&(e=this.options.tileSize/this._scales[i],n=Math.ceil(parseFloat((r[2]-r[0])/e).toPrecision(3))*e*this._scales[i],o=Math.ceil(parseFloat((r[3]-r[1])/e).toPrecision(3))*e*this._scales[i],s[i]=t.point(n,o));return s},getSize:function(t){return this._sizes[t]}}),t.Proj.TileLayer={},t.Proj.TileLayer.TMS=t.TileLayer.extend({options:{continuousWorld:!0},initialize:function(e,i,n){var o,s,r,a,l=!0;if(!(i instanceof t.Proj.CRS.TMS))throw"CRS is not L.Proj.CRS.TMS.";for(t.TileLayer.prototype.initialize.call(this,e,n),this.options.tms=!1,this.crs=i,r=this.crs.projectedBounds,a=this.options.minZoom;a.001}if(!l){for(o={},a=this.options.minZoom;a3&&(t=n[n.length-3]+":"+n[n.length-1]),void 0===e.defs[t])throw"No projection definition for code "+t}return e(t)}}),t.Proj.CRS=t.Class.extend({includes:t.CRS,options:{transformation:new t.Transformation(1,0,-1,0)},initialize:function(e,i,n){var o,s,r,a;if(t.Proj._isProj4Obj(e)?(s=e,o=s.srsCode,a=i||{},this.projection=new t.Proj.Projection(s,a.bounds)):(o=e,r=i,a=n||{},this.projection=new t.Proj.Projection(o,r,a.bounds)),t.Util.setOptions(this,a),this.code=o,this.transformation=this.options.transformation,this.options.origin&&(this.transformation=new t.Transformation(1,-this.options.origin[0],-1,this.options.origin[1])),this.options.scales)this._scales=this.options.scales;else if(this.options.resolutions){this._scales=[];for(var l=this.options.resolutions.length-1;l>=0;l--)this.options.resolutions[l]&&(this._scales[l]=1/this.options.resolutions[l])}this.infinite=!this.options.bounds},scale:function(t){var e,i,n,o,s=Math.floor(t);return t===s?this._scales[t]:(e=this._scales[s],i=this._scales[s+1],n=i-e,o=t-s,e+n*o)},zoom:function(t){var e,i,n=this._closestElement(this._scales,t),o=this._scales.indexOf(n);return t===n?o:(e=o+1,i=this._scales[e]-n,(t-n)/i+o)},_closestElement:function(t,e){for(var i,n=t.length;n--;)t[n]<=e&&(void 0===i||io.geoBBox.right||e.getBounds()._southWest.lat>o.geoBBox.top||e.getBounds()._northEast.lng1e3&&(this._requestCircleFilter.radius=1e3),t.Util.extend(o,{filterOptions:{type:s,circle:this._requestCircleFilter}})),"extent"===this._currentGeocodingDelimitation.toLowerCase()&&this._requestBboxFilter&&t.Util.extend(o,{filterOptions:{type:s,bbox:this._requestBboxFilter}}),this._displayWaitingContainer(),n.Services.reverseGeocode(o)},_displayGeocodedLocations:function(t){if(this._clearLocations(),this._clearLocationsFeature(),this._reverseGeocodingLocations=t,!t||0===t.length)return void this._clearInputRequest();this._formContainer.className="GPreverseGeocodingComponentHidden",this._hideWaitingContainer(),this._panelTitleContainer.innerHTML="Résultats de la recherche",this._returnPictoContainer.className="",this._resultsContainer.className="GPpanel",this._fillGeocodedLocationListContainer(t),this._displayGeocodedLocationsOnMap(t);var e=this._map;e.fitBounds(this._inputResultsLayer.getBounds())},_fillGeocodedLocationListContainer:function(t){for(var e=0;e",d=l.placeAttributes;for(var p in d)d.hasOwnProperty(p)&&"bbox"!==p&&(u+="
  • ",u+=''+p.toUpperCase()+" : ",u+=d[p],u+="
  • ");u+=" ",h.bindPopup(u),h.on("mouseover",i),h.on("mouseout",n),this._inputResultsLayer.addLayer(h)}}},onShowReverseGeocodingClick:function(){var t=this._map;this._showReverseGeocodingContainer.checked?this._removeMapInteraction(t):this._waiting||this._reverseGeocodingLocations.length||this._activateMapInteraction(t)},onReverseGeocodingTypeChange:function(t){var e=t.target.selectedIndex,i=t.target.options[e].value;i&&(this._currentGeocodingType=i)},onReverseGeocodingDelimitationChange:function(t){var e=t.target.selectedIndex,i=t.target.options[e].value;if(i){this._currentGeocodingDelimitation=i,this._clearInputRequest();var n=this._map;this._removeMapInteraction(n),this._activateMapInteraction(n)}},onGPreverseGeocodingReturnPictoClick:function(){this._clearLocations(),this._clearLocationsFeature(),this._clearInputRequest(),this._activateMapInteraction(this._map)},onReverseGeocodingSubmit:function(){if(this._requestPosition&&!this._noRightManagement){var t=this;this._reverseGeocodingRequest({position:t._requestPosition,filterOptions:{type:[t._currentGeocodingType]},onSuccess:function(e){if(e){var i=e.locations;t._displayGeocodedLocations(i),t._hideWaitingContainer()}},onFailure:function(e){t._hideWaitingContainer(),t._clearLocations(),t._clearLocationsFeature(),t._clearInputRequest()}})}},onReverseGeocodingResultClick:function(t){},onReverseGeocodingResultMouseOver:function(t){var e=s.index(t.target.id);t.target.classList&&t.target.classList.add("GPreverseGeocodedLocationHighlight"),this._inputResultsLayer&&this._inputResultsLayer.eachLayer(function(t){t.options.id===parseInt(e,10)&&t.fire("mouseover")})},onReverseGeocodingResultMouseOut:function(t){var e=s.index(t.target.id);t.target.classList&&t.target.classList.remove("GPreverseGeocodedLocationHighlight"),this._inputResultsLayer&&this._inputResultsLayer.eachLayer(function(t){t.options.id===parseInt(e,10)&&t.fire("mouseout")})},_clearLocations:function(){if(this._reverseGeocodingLocations=[],this._resultsListContainer)for(;this._resultsListContainer.firstChild;)this._resultsListContainer.removeChild(this._resultsListContainer.firstChild)},_clearLocationsFeature:function(){var t=this._map;null!==this._inputResultsLayer&&(t.removeLayer(this._inputResultsLayer),this._inputResultsLayer=null)},_clearInputRequest:function(){this._requestPosition=null,this._requestCircleFilter=null,this._requestBboxFilter=null},_displayWaitingContainer:function(){this._waitingContainer.className="GPreverseGeocodingCalcWaitingContainerVisible",this._waiting=!0,this._timer&&(clearTimeout(this._timer),this._timer=null);var t=this;this._timer=setTimeout(function(){t._waiting===!0?t._hideWaitingContainer():t._timer&&clearTimeout(t._timer)},16e3)},_hideWaitingContainer:function(){this._waiting&&(this._waitingContainer.className="GPreverseGeocodingCalcWaitingContainerHidden",this._waiting=!1,clearTimeout(this._timer),this._timer=null)}});return l}(leaflet,leafletDraw,{},gp,CommonUtilsCheckRightManagement,CommonUtilsSelectorID,LeafletControlsUtilsIconDefault,CommonControlsReverseGeocodingDOM),CommonControlsRouteDOM=function(t){var e={_addUID:function(t){return t+"-"+this._uid},_createMainContainerElement:function(){var t=document.createElement("div");return t.id=this._addUID("GProute"),t.className="GPwidget",t},_createShowRouteElement:function(){var t=document.createElement("input");return t.id=this._addUID("GPshowRoute"),t.type="checkbox",t},_createShowRoutePictoElement:function(){var t=this,e=document.createElement("label");e.id=this._addUID("GPshowRoutePicto"),e.className="GPshowAdvancedToolPicto",e.htmlFor=this._addUID("GPshowRoute"),e.title="Ouvrir le calcul d'itinéraire",e.addEventListener?e.addEventListener("click",function(e){t.onShowRoutePanelClick(e)}):e.attachEvent&&e.attachEvent("onclick",function(e){t.onShowRoutePanelClick(e)});var i=document.createElement("span");return i.id=this._addUID("GPshowRouteOpen"),i.className="GPshowAdvancedToolOpen",e.appendChild(i),e},_createRoutePanelElement:function(){var t=document.createElement("div");return t.id=this._addUID("GProutePanel"),t.className="GPpanel",t},_createRoutePanelHeaderElement:function(){var t=this,e=document.createElement("div");e.className="GPpanelHeader";var i=document.createElement("div");i.className="GPpanelTitle",i.innerHTML="Calcul d'itinéraire",e.appendChild(i);var n=document.createElement("div");return n.id=this._addUID("GProutePanelClose"),n.className="GPpanelClose",n.title="Masquer le panneau",n.addEventListener?n.addEventListener("click",function(){document.getElementById(t._addUID("GPshowRoutePicto")).click()},!1):n.attachEvent&&n.attachEvent("onclick",function(){document.getElementById(t._addUID("GPshowRoutePicto")).click()}),e.appendChild(n),e},_createRoutePanelFormElement:function(){var e=this,i=document.createElement("form");return i.id=this._addUID("GProuteForm"),i.setAttribute("onkeypress","return event.keyCode != 13;"),i.addEventListener("submit",function(i){console.log(i),i.preventDefault();var n=document.getElementsByClassName(e._addUID("GPlocationPoint")),o=n[0].childNodes[0].id,s=n[n.length-1].childNodes[0].id,r=t.index(o),a=t.index(s);if(""==document.getElementById(e._addUID("GPlocationOrigin_"+r)).value&&""==document.getElementById(e._addUID("GPlocationOriginCoords_"+r)).value||""==document.getElementById(e._addUID("GPlocationOrigin_"+a)).value&&""==document.getElementById(e._addUID("GPlocationOriginCoords_"+a)).value)return!1;var l;document.getElementById(e._addUID("GProuteResultsStages")).innerHTML="";for(var c=0;c2?document.getElementById("GProuteAutoCompleteList"+i).style.display="block":document.getElementById("GProuteAutoCompleteList"+i).style.display="none",n.onAutoCompleteSearchText(t)}}),r.addEventListener("blur",function(){var t=this.id.charAt(this.id.length-1);document.getElementById("GProuteAutoCompleteList"+t).style.display="none"}),o.appendChild(r);var a=document.createElement("input");a.id="GProuteOriginCoords"+t,a.className="GProuteOriginHidden",a.type="text",a.disabled=!0,o.appendChild(a);var l=document.createElement("input");l.id="GProuteOriginPointer"+t,l.type="checkbox",o.appendChild(l);var c=document.createElement("label");return c.id="GProuteOriginPointerImg"+t,c.htmlFor="GProuteOriginPointer"+t,c.className="GProuteOriginPointerImg",c.title="Pointer un lieu sur la carte",c.addEventListener("click",function(t){t.preventDefault(),t.stopPropagation();var e,i=this.id.charAt(this.id.length-1);for(e=1;e<8;e++)i!=e&&(document.getElementById("GProuteOriginPointer"+e).checked=!1,"Pointer un lieu sur la carte"==document.getElementById("GProuteOriginCoords"+e).value&&(document.getElementById("GProuteOriginCoords"+e).value="",document.getElementById("GProuteOrigin"+e).className="GProuteOriginVisible",document.getElementById("GProuteOriginCoords"+e).className="GProuteOriginHidden"));if(document.getElementById("GProuteOriginPointer"+i).checked){for(document.getElementById("GProuteOriginCoords"+i).value="",e=1;e<8;e++)document.getElementById("GProutePoint"+e).style.display="flex";document.getElementById("GProuteForm").className="",document.getElementById("GProuteOriginPointer"+i).checked=!1,document.getElementById("GProuteOrigin"+i).className="GProuteOriginVisible",document.getElementById("GProuteOriginCoords"+i).className="GProuteOriginHidden"}else{for(document.getElementById("GProuteOriginCoords"+i).value="Pointer un lieu sur la carte",e=1;e<8;e++)i==e?document.getElementById("GProutePoint"+e).style.display="flex":document.getElementById("GProutePoint"+e).style.display="none";document.getElementById("GProuteForm").className="GProuteFormMini",document.getElementById("GProuteOriginPointer"+i).checked=!0,document.getElementById("GProuteOrigin"+i).className="GProuteOriginHidden",document.getElementById("GProuteOriginCoords"+i).className="GProuteOriginVisible"}n.onRouteMapPointClick(t)}),o.appendChild(c),o},_createRoutePanelFormRemoveStageElement:function(t){var e=this,i=document.createElement("div");return i.id="GProuteStageRemove"+t,i.className="GProuteStageRemove",i.title="Supprimer l'étape",1!=t&&7!=t&&i.addEventListener("click",function(t){var i=this.id.charAt(this.id.length-1);document.getElementById("GProutePoint"+i).className="GPflexInput GProuteStageFlexInputHidden",document.getElementById("GProuteOrigin"+i).value="",document.getElementById("GProuteOrigin"+i).className="GProuteOriginVisible",document.getElementById("GProuteOriginCoords"+i).value="",document.getElementById("GProuteOriginCoords"+i).className="GProuteOriginHidden",document.getElementById("GProuteStageAdd").style.display="";var n=document.getElementById("GPshowRouteExclusionsPicto").style.top;document.getElementById("GPshowRouteExclusionsPicto").style.top=(parseInt(n,10)-33).toString()+"px",e.onRouteRemovePointClick(t)}),i},_createRoutePanelFormAddStageElement:function(){var t=this,e=document.createElement("div");return e.id="GProuteStageAdd",e.title="Ajouter une étape",e.addEventListener("click",function(e){for(var i=1,n=0,o=2;o<7;o++)"GPflexInput GProuteStageFlexInputHidden"==document.getElementById("GProutePoint"+o).className?1==i&&(i=o):n++;if(i<7){document.getElementById("GProutePoint"+i).className="GPflexInput GProuteStageFlexInput";var s=document.getElementById("GPshowRouteExclusionsPicto").style.top;document.getElementById("GPshowRouteExclusionsPicto").style.top=(parseInt(s,10)+33).toString()+"px"}4==n&&(document.getElementById("GProuteStageAdd").style.display="none"),t.onRouteAddPointClick(e)}),e},_createRoutePanelFormAutoCompleteListElement:function(t){var e=this,i=document.createElement("div");return i.id="GProuteAutoCompleteList"+t,i.className="GPadvancedAutoCompleteList",i.addEventListener?i.addEventListener("click",function(i){e.onAutoCompletedResultsItemClick(i),document.getElementById("GProuteAutoCompleteList"+t).style.display="none"},!1):i.attachEvent&&i.attachEvent("onclick",function(i){e.onAutoCompletedResultsItemClick(i),document.getElementById("GProuteAutoCompleteList"+t).style.display="none"}),i},_createRouteAutoCompletedLocationElement:function(t,e,i){var n=document.getElementById("GProuteAutoCompleteList"+e),o=document.createElement("div");o.id="AutoCompletedLocation"+i,o.className="GPautoCompleteProposal",o.innerHTML=t.fullText,n.appendChild(o)},_createRoutePanelFormModeChoiceElement:function(){var t=document.createElement("div");return t.id=this._addUID("GProuteModeChoice"),t},_createRoutePanelFormModeChoiceTransportElement:function(t){var e=this,i=document.createElement("div");i.id=this._addUID("GProuteTransportChoice");var n=document.createElement("span");n.className="GProuteModeLabel",n.innerHTML="Mode de transport",i.appendChild(n);for(var o=0;o2?document.getElementById(t._addUID("GPautoCompleteList")).style.display="block":document.getElementById(t._addUID("GPautoCompleteList")).style.display="none",t.onAutoCompleteSearchText(e))}),i.addEventListener("keydown",function(t){return}),e.appendChild(i);var n=document.createElement("div");return n.id=this._addUID("GPsearchInputReset"),n.addEventListener("click",function(){document.getElementById(t._addUID("GPsearchInputText")).value="",document.getElementById(t._addUID("GPautoCompleteList")).style.display="none",document.getElementById(t._addUID("GPgeocodeResultsList")).style.display="none",t.onSearchResetClick()}),e.appendChild(n),e},_createShowAdvancedSearchElement:function(){var t=this,e=document.createElement("div");e.id=this._addUID("GPshowAdvancedSearch"),e.className="GPshowAdvancedToolPicto",e.title="Ouvrir la recherche avancée",e.addEventListener("click",function(){var e="#GPsearchInput-"+t._uid;document.querySelector(e+" input").disabled=!0,document.getElementById(t._addUID("GPautoCompleteList")).style.display="none",document.getElementById(t._addUID("GPgeocodeResultsList")).style.display="none",document.getElementById(t._addUID("GPshowAdvancedSearch")).style.display="none",document.getElementById(t._addUID("GPadvancedSearchPanel")).style.display="inline-block"});var i=document.createElement("span");return i.id=this._addUID("GPshowAdvancedSearchOpen"),i.className="GPshowAdvancedToolOpen",e.appendChild(i),e},_createAdvancedSearchPanelElement:function(){var t=document.createElement("div");return t.id=this._addUID("GPadvancedSearchPanel"),t.className="GPpanel",t.style.display="none",t},_createGeocodeResultsElement:function(){var t=document.createElement("div");return t.id=this._addUID("GPgeocodeResultsList"),t.className="GPpanel",t.style.display="none",t.appendChild(this._createGeocodeResultsHeaderElement()),t},_createAutoCompleteElement:function(){var t=document.createElement("div");return t.id=this._addUID("GPautoCompleteList"),t.className="GPautoCompleteList",t.style.display="none",t},_createAutoCompleteListElement:function(){var t=this,e=document.createElement("div");return e.id=this._addUID("GPautocompleteResults"),e.addEventListener?e.addEventListener("click",function(e){t.onAutoCompletedResultsItemClick(e),document.getElementById(t._addUID("GPautoCompleteList")).style.display="none"},!1):e.attachEvent&&e.attachEvent("onclick",function(e){t.onAutoCompletedResultsItemClick(e),document.getElementById(t._addUID("GPautoCompleteList")).style.display="none"}),e},_createAutoCompletedLocationElement:function(t,e){var i=document.getElementById(this._addUID("GPautocompleteResults")),n=document.createElement("div");n.id=this._addUID("AutoCompletedLocation_"+e),n.className="GPautoCompleteProposal",n.innerHTML=t.fullText,n.addEventListener?n.addEventListener("click",function(t){i.click(t)},!1):n.attachEvent&&n.attachEvent("onclick",function(t){i.click(t)}),i.appendChild(n)},_createAdvancedSearchPanelHeaderElement:function(){var t=this,e=document.createElement("div");e.className="GPpanelHeader";var i=document.createElement("div");i.className="GPpanelTitle",i.innerHTML="Recherche avancée",e.appendChild(i);var n=document.createElement("div");return n.id=this._addUID("GPadvancedSearchClose"),n.className="GPpanelClose",n.title="Fermer la recherche avancée",n.addEventListener?n.addEventListener("click",function(){var e="#GPsearchInput-"+t._uid;document.querySelector(e+" input").disabled=!1,document.getElementById(t._addUID("GPgeocodeResultsList")).style.display="none",document.getElementById(t._addUID("GPshowAdvancedSearch")).style.display="inline-block",document.getElementById(t._addUID("GPadvancedSearchPanel")).style.display="none"},!1):n.attachEvent&&n.attachEvent("onclick",function(){var e="#GPsearchInput-"+t._uid;document.querySelector(e+" input").disabled=!1,document.getElementById(t._addUID("GPgeocodeResultsList")).style.display="none",document.getElementById(t._addUID("GPshowAdvancedSearch")).style.display="inline-block",document.getElementById(t._addUID("GPadvancedSearchPanel")).style.display="none"}),e.appendChild(n),e},_createAdvancedSearchPanelFormElement:function(t){var e=this,i=document.createElement("form");i.id=this._addUID("GPadvancedSearchForm"),i.addEventListener("submit",function(t){t.preventDefault();for(var i=[],n="#GPadvancedSearchFilters-"+e._uid,o=document.querySelectorAll(n+" > div > div > input"),s=0;sa&&(n=a),n},_setMarker:function(e,i,n){var o=this._map;if(null!=this._marker&&(o.removeLayer(this._marker),this._marker=null),e){var s={clickable:!0,zIndexOffset:1e3};if(this._marker=t.marker(t.latLng(e.x,e.y),s),this._marker.addTo(o),n){var r=null;if("string"!=typeof i){var a=[];if("DirectGeocodedLocation"===i.service)if(i.fields.freeform)r=i.fields.freeform;else{for(var l=this._advancedSearchFilters[i.type],c=0;c100?o=1:i>10&&(o=10);for(var s=0;sr[0]-n?r:s,h=a(l.dist),u=c(l.z);g.select("#focusCircle").attr("cx",h).attr("cy",u),g.select("#focusLineX").attr("x1",h).attr("y1",c(_[0])).attr("x2",h).attr("y2",c(_[1])),g.select("#focusLineY").attr("x1",a(f[0])).attr("y1",u).attr("x2",a(f[1])).attr("y2",u),E._marker.setLatLng(t.latLng(l.lat,l.lon)),E._marker.update(),v.transition().duration(200).style("opacity",.9),v.html("Alt : "+l.z+" m
    Lon : "+l.lon+"
    Lat : "+l.lat).style("left",d3.event.pageX+"px").style("top",d3.event.pageY-28+"px")}),n._profile=d3.selectAll("rect.overlay")[0][0]},h.DISPLAY_PROFILE_LIB_AMCHARTS=function(t,e,i){if("undefined"==typeof AmCharts)return void console.log("Lib. AmCharts is not loaded !");AmCharts.addInitHandler(function(){}),i._profile=AmCharts.makeChart(e,{type:"serial",pathToImages:"http://cdn.amcharts.com/lib/3/images/",categoryField:"dist",autoMarginOffset:0,marginRight:10,marginTop:10,startDuration:0,color:"#5E5E5E",fontSize:10,theme:"light",thousandsSeparator:"",categoryAxis:{color:"#5E5E5E",gridPosition:"start",minHorizontalGap:40,tickPosition:"start",title:"Distance (km)",titleColor:"#5E5E5E",startOnAxis:!0},chartCursor:{animationDuration:0,bulletsEnabled:!0,bulletSize:10,categoryBalloonEnabled:!1,cursorColor:"#F90",graphBulletAlpha:1,graphBulletSize:1,zoomable:!1},trendLines:[],graphs:[{balloonColor:"#CCCCCC",balloonText:"[[title]] : [[value]]m
    (lat: [[lat]] / lon:[[lon]])",bullet:"round",bulletAlpha:0,bulletBorderColor:"#FFF",bulletBorderThickness:2,bulletColor:"#F90",bulletSize:6,hidden:!1,id:"AmGraph-1",fillAlphas:.4,fillColors:"#C77A04",lineAlpha:1,lineColor:"#C77A04",lineThickness:1,title:"Altitude",valueField:"z"}],guides:[],valueAxes:[{id:"ValueAxis-1",minVerticalGap:20,title:"Altitude (m)"}],allLabel:[],balloon:{borderColor:"#CCCCCC",borderThickness:1,fillColor:"#FFFFFF",showBullet:!0},titles:[],dataProvider:t});var n=t[0];i._activateProfilEvent(n)},h}(leaflet,leafletDraw,{},gp,CommonUtilsCheckRightManagement,CommonUtilsSelectorID,LeafletControlsLocationSelector,LeafletControlsUtilsPositionFormater,LeafletControlsUtilsIconDefault,CommonControlsElevationPathDOM),LeafletControlsLogo=function(t){var e=t.Control.extend({options:{position:"topright",picto:null,url:null,text:null,size:"30px"},initialize:function(e){t.setOptions(this,e)},onAdd:function(){var e=t.DomUtil.create("div","gp-control-logo",e),i=!(!this.options.url&&!this.options.text),n=null;i&&(n=t.DomUtil.create("a","",e),n.target="_blank",this.options.url&&(n.href=this.options.url,this.options.text?n.title=this.options.text:null)),i&&this.options.text&&(n.text=this.options.text);var o=!!this.options.picto,s=null;return o&&(s=i?t.DomUtil.create("img","",n):t.DomUtil.create("img","",e),s.src=this.options.picto,"string"==typeof this.options.size?s.style.height=s.style.width=this.options.size:(s.style.height=this.options.size.height,s.style.width=this.options.size.width)),e}});return e}(leaflet),LeafletControlsControls=function(t,e,i,n,o,s,r,a){var l={LayerSwitcher:function(e){return new t(e)},Isocurve:function(t){return new e(t)},MousePosition:function(t){return new i(t)},ReverseGeocode:function(t){return new n(t)},Route:function(t){return new o(t)},SearchEngine:function(t){return new s(t)},ElevationPath:function(t){return new r(t)},Logo:function(t){return new a(t)}};return l}(LeafletControlsLayerSwitcher,LeafletControlsIsocurve,LeafletControlsMousePosition,LeafletControlsReverseGeocoding,LeafletControlsRoute,LeafletControlsSearchEngine,LeafletControlsElevationPath,LeafletControlsLogo),CommonUtilsLayerUtils=function(){var t={getZoomLevelFromScaleDenominator:function(t,e){var i={};switch(e){case"EPSG:2154":i={0:104579.224549894,1:52277.5323537905,2:26135.4870785954,3:13066.8913818,4:6533.2286041135,5:3266.5595244627,6:1633.2660045974,7:816.629554986,8:408.3139146768,9:204.1567415109,10:102.0783167832,11:51.0391448966,12:25.5195690743,13:12.7597836936,14:6.379891636,15:3.1899457653,16:1.5949728695,17:.7974864315,18:.3987432149,19:.1993716073,20:.0996858037,21:.0498429018};break;default:i={0:156543.033928041,1:78271.51696402048,2:39135.758482010235,3:19567.87924100512,4:9783.93962050256,5:4891.96981025128,6:2445.98490512564,7:1222.99245256282,8:611.49622628141,9:305.7481131407048,10:152.8740565703525,11:76.43702828517624,12:38.21851414258813,13:19.10925707129406,14:9.554628535647032,15:4.777314267823516,16:2.388657133911758,17:1.194328566955879,18:.5971642834779395,19:.2985821417389697,20:.1492910708694849,21:.0746455354347424}}var n=28e-5*t;for(var o in i)if(i.hasOwnProperty(o)&&i[o]<=n)return o;return 0},getAttributions:function(t){var e=t.zoom,i=[];if(null!=t.originators&&t.visibility)for(var n,o=0,s=t.originators.length;oe&&(n=!1),n&&d&&d=1.3&&i.indexOf(this._crs.code)!==-1?[l.y,a.x,a.y,l.x].join(","):[a.x,l.y,l.x,a.y].join(","),h=t.Util.template(this._url,{s:this._getSubdomain(e)});return h+t.Util.getParamString(this.wmsParams,h,!0)+"&BBOX="+c}});return o}(leaflet,gp,{},LeafletLayersLayerEvent),LeafletLayersWMTS=function(t,e,i,n){var o=t.TileLayer.extend({includes:n,defaultWmtsParams:{service:"WMTS",request:"GetTile",version:"1.0.0",layer:"",style:"",tilematrixset:"PM",format:"image/jpeg"},initialize:function(i,n){this._wmtsParams={},t.Util.extend(this._wmtsParams,this.defaultWmtsParams,n.paramsWmts), +t.TileLayer.prototype.initialize.call(this,e.Helper.normalyzeUrl(i,{"gp-leaflet-ext":"0.9.0"},!1),n.paramsNative),this._originators=n.originators,this._legends=n.legends,this._metadata=n.metadata,this._title=n.title,this._description=n.description,this._quicklookUrl=n.quicklookUrl,this._geoportal_id=0},onAdd:function(e){this._map=e,this._geoportal_id=t.stamp(this),t.TileLayer.prototype.onAdd.call(this,e),this.setVisible(!0),this.updateAttributions(e),e.on({overlayremove:this._onRemoveLayer,overlayadd:this._onAddLayer,layerremove:this._onRemoveLayer,layeradd:this._onAddLayer,moveend:this._onMoveEndLayer},this)},onRemove:function(e){this._map=e,t.TileLayer.prototype.onRemove.call(this,e),this.setVisible(!1),this.removeAttributions(e),e.off({overlayremove:this._onRemoveLayer,overlayadd:this._onAddLayer,layerremove:this._onRemoveLayer,layeradd:this._onAddLayer,moveend:this._onMoveEndLayer},this)},getTileUrl:function(e){var i=this._getZoomForUrl(),n=t.Util.template(this._url,{s:this._getSubdomain(e)});return n+t.Util.getParamString(this._wmtsParams,n)+"&tilematrix="+i+"&tilerow="+e.y+"&tilecol="+e.x},setParams:function(e,i){return t.extend(this._wmtsParams,e),i||this.redraw(),this}});return o}(leaflet,gp,{},LeafletLayersLayerEvent),LeafletLayersLayers=function(t,e,i,n,o){var s={options:{},params:{},serviceUrl:"http://localhost?no-rights-found-for=[{layer}]",_initLogger:function(){},_initOptions:function(){if(!this.options||0===Object.keys(this.options))throw new Error("PARAM_MISSING : options !");if(!this.options.layer)throw new Error("PARAM_MISSING : layer !");this.options.apiKey||console.log("PARAM_MISSING : apiKey !")},_initParams:function(t){t||(t="WMTS"),this.params=i.get({key:this.options.apiKey,layer:this.options.layer,service:t}),this.params&&0!==Object.keys(this.params)||(this.params={},this.options.apiKey||console.log("WARNING PARAM_MISSING : parameter 'apiKey' is mandatory if the contract key configuration has not been loaded !"))},WMS:function(e,i){this._initLogger(),this.options=e||{},this._initOptions(),this.settings=i||{},this._initParams("WMS");var o=null;o=this.params.key||this.options.apiKey?this.params.url||t.Util.template("http://wxs.ign.fr/{key}/geoportail/r/wms",{key:this.params.key||this.options.apiKey}):t.Util.template(this.serviceUrl,{layer:this.options.layer});var s={layers:this.options.layer,styles:this.params.styles||"normal",format:this.params.format||"image/jpeg",version:this.params.version||"1.3.0"},r={minZoom:this.params.minZoom||1,maxZoom:this.params.maxZoom||21};return t.Util.extend(r,this.settings),new n(o,{paramsNative:r,paramsWms:s,originators:this.params.originators||[],legends:this.params.legends||[],metadata:this.params.metadata||[],title:this.params.title||null,description:this.params.description||null,quicklookUrl:this.params.quicklookUrl||null})},WMTS:function(e,i){this._initLogger(),this.options=e||{},this._initOptions(),this.settings=i||{},this._initParams("WMTS");var n=null;n=this.params.key||this.options.apiKey?this.params.url||t.Util.template("http://wxs.ign.fr/{key}/geoportail/wmts",{key:this.params.key||this.options.apiKey}):t.Util.template(this.serviceUrl,{layer:this.options.layer});var s={layer:this.options.layer,style:this.params.styles||"normal",format:this.params.format||"image/jpeg",version:this.params.version||"1.0.0",tilematrixset:this.params.TMSLink||"PM"},r={minZoom:this.params.minZoom||1,maxZoom:this.params.maxZoom||21};return t.Util.extend(r,this.settings),new o(n,{paramsNative:r,paramsWmts:s,originators:this.params.originators||[],legends:this.params.legends||[],metadata:this.params.metadata||[],title:this.params.title||"",description:this.params.description||"",quicklookUrl:this.params.quicklookUrl||""})}};return s}(leaflet,{},LeafletLayersLayerConfig,LeafletLayersWMS,LeafletLayersWMTS),LeafletGpPluginLeaflet=function(t,e,i,n,o,s,r,a){return i.leafletExtVersion="0.9.0",i.leafletExtDate="2016-12-04",i.Register=a,t.geoportalLayer=s,t.geoportalControl=n,t.geoportalControl.ElevationPath.DISPLAY_PROFILE_LIB_D3=o.DISPLAY_PROFILE_LIB_D3,t.geoportalControl.ElevationPath.DISPLAY_PROFILE_LIB_AMCHARTS=o.DISPLAY_PROFILE_LIB_AMCHARTS,t.geoportalControl.ElevationPath.DISPLAY_PROFILE_RAW=o.DISPLAY_PROFILE_RAW,t.geoportalControl.ElevationPath.DISPLAY_PROFILE_BY_DEFAULT=o.DISPLAY_PROFILE_BY_DEFAULT,t.geoportalCRS=r,t.geoportalCRS.EPSG2154=r.EPSG2154(),t.geoportalCRS.EPSG27572=r.EPSG27572(),t.geoportalCRS.EPSG4326=r.EPSG4326(),i}(leaflet,leafletDraw,gp,LeafletControlsControls,LeafletControlsElevationPath,LeafletLayersLayers,LeafletCRSCRS,CommonUtilsRegister),window.proj4=proj4; +return Gp; +}));