src/pyams_gis/resources/js/leaflet-gp-3.0.2.min.js
changeset 0 c73bb834ccbe
equal deleted inserted replaced
-1:000000000000 0:c73bb834ccbe
       
     1 /*!
       
     2  * @brief Geoportal Extension for Leaflet
       
     3  *
       
     4  * This software is released under the licence CeCILL-B (Free BSD compatible)
       
     5  * @see http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt
       
     6  * @see http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt
       
     7  * @see http://www.cecill.info/
       
     8  *
       
     9  * copyright CeCILL-B
       
    10  * copyright IGN
       
    11  * @author IGN
       
    12  * @version 0.9.0
       
    13  * @date 2016-12-04
       
    14  *
       
    15  */
       
    16 /*!
       
    17  * @overview es6-promise - a tiny implementation of Promises/A+.
       
    18  * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and cont  ributors (Conversion to ES6 API by Jake Archibald)
       
    19  * @license   Licensed under MIT license
       
    20  *            See https://raw.githubusercontent.com/jakearchibald/es6-promise/  master/LICENSE
       
    21  * @version   3.0.2
       
    22  */
       
    23 /*!
       
    24  * Sortable -- minimalist JavaScript library for reorderable drag-and-drop lists
       
    25  *
       
    26  * Released under MIT LICENSE
       
    27  * 
       
    28  * Copyright 2013-2016 Lebedev Konstantin <ibnRubaXa@gmail.com>
       
    29  * http://rubaxa.github.io/Sortable/
       
    30  * 
       
    31  * Permission is hereby granted, free of charge, to any person obtaining
       
    32  * a copy of this software and associated documentation files (the
       
    33  * "Software"), to deal in the Software without restriction, including
       
    34  * without limitation the rights to use, copy, modify, merge, publish,
       
    35  * distribute, sublicense, and/or sell copies of the Software, and to
       
    36  * permit persons to whom the Software is furnished to do so, subject to
       
    37  * the following conditions:
       
    38  * 
       
    39  * The above copyright notice and this permission notice shall be
       
    40  * included in all copies or substantial portions of the Software.
       
    41  * 
       
    42  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
       
    43  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
       
    44  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
       
    45  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
       
    46  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
       
    47  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
       
    48  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
       
    49  */
       
    50 /*!
       
    51  * Proj4js - Javascript reprojection library. 
       
    52  * 
       
    53  * Authors:
       
    54  * 
       
    55  * - Mike Adair madairATdmsolutions.ca
       
    56  * - Richard Greenwood richATgreenwoodmap.com
       
    57  * - Didier Richard didier.richardATign.fr
       
    58  * - Stephen Irons stephen.ironsATclear.net.nz
       
    59  * - Olivier Terral oterralATgmail.com
       
    60  * - Calvin Metcalf cmetcalfATappgeo.com
       
    61  * 
       
    62  * Copyright (c) 2014, Mike Adair, Richard Greenwood, Didier Richard, Stephen Irons, Olivier Terral and Calvin Metcalf
       
    63  * 
       
    64  *  Permission is hereby granted, free of charge, to any person obtaining a
       
    65  *  copy of this software and associated documentation files (the "Software"),
       
    66  *  to deal in the Software without restriction, including without limitation
       
    67  *  the rights to use, copy, modify, merge, publish, distribute, sublicense,
       
    68  *  and/or sell copies of the Software, and to permit persons to whom the
       
    69  *  Software is furnished to do so, subject to the following conditions:
       
    70  * 
       
    71  *  The above copyright notice and this permission notice shall be included
       
    72  *  in all copies or substantial portions of the Software.
       
    73  * 
       
    74  *  _THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
       
    75  *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
       
    76  *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
       
    77  *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
       
    78  *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
       
    79  *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
       
    80  *  DEALINGS IN THE SOFTWARE._
       
    81  * 
       
    82  */
       
    83 /*!
       
    84  * Copyright 2012-2016 Jacob Toye and Leaflet
       
    85  *
       
    86  * Permission is hereby granted, free of charge, to any person obtaining a copy
       
    87  * of this software and associated documentation files (the "Software"), to deal
       
    88  * in the Software without restriction, including without limitation the rights
       
    89  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
       
    90  * of the Software, and to permit persons to whom the Software is furnished to do
       
    91  * so, subject to the following conditions:
       
    92  *
       
    93  * The above copyright notice and this permission notice shall be included in
       
    94  * all copies or substantial portions of the Software.
       
    95  *
       
    96  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
       
    97  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
       
    98  * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
       
    99  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
       
   100  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
       
   101  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
       
   102  */
       
   103 /*!
       
   104  * Proj4Leaflet --  Smooth Proj4js integration with Leaflet
       
   105  * 
       
   106  * Copyright (c) 2012, Kartena AB
       
   107  * All rights reserved.
       
   108  * 
       
   109  * Redistribution and use in source and binary forms, with or without
       
   110  * modification, are permitted provided that the following conditions are met:
       
   111  * 
       
   112  * 1. Redistributions of source code must retain the above copyright notice, this
       
   113  *    list of conditions and the following disclaimer.
       
   114  * 2. Redistributions in binary form must reproduce the above copyright notice,
       
   115  *    this list of conditions and the following disclaimer in the documentation
       
   116  *    and/or other materials provided with the distribution.
       
   117  * 
       
   118  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
       
   119  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
       
   120  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
       
   121  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
       
   122  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
       
   123  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
       
   124  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
       
   125  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
       
   126  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
       
   127  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
       
   128  */
       
   129 ;(function(root, factory) {
       
   130   if (typeof define === 'function' && define.amd) {
       
   131     define(['leaflet'], factory);
       
   132   } else if (typeof exports === 'object') {
       
   133     module.exports = factory(require('leaflet'));
       
   134   } else {
       
   135     root.Gp = factory(root.L);
       
   136   }
       
   137 }(this, function(leaflet) {
       
   138 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;t<H;t+=2){var e=J[t],i=J[t+1];e(i),J[t]=void 0,J[t+1]=void 0}H=0}function d(){try{var t=require,e=t("vertx");return z=e.runOnLoop||e.runOnContext,a()}catch(t){return h()}}function p(){}function m(){return new TypeError("You cannot resolve a promise with itself")}function f(){return new TypeError("A promises callback cannot return that same promise.")}function _(t){try{return t.then}catch(t){return it.error=t,it}}function g(t,e,i,n){try{t.call(e,i,n)}catch(t){return t}}function v(t,e,i){V(function(t){var n=!1,o=g(i,e,function(i){n||(n=!0,e!==i?P(t,i):S(t,i))},function(e){n||(n=!0,M(t,e))},"Settle: "+(t._label||" unknown promise"));!n&&o&&(n=!0,M(t,o))},t)}function y(t,e){e._state===tt?S(t,e._result):e._state===et?M(t,e._result):w(e,void 0,function(e){P(t,e)},function(e){M(t,e)})}function E(t,i){if(i.constructor===t.constructor)y(t,i);else{var n=_(i);n===it?M(t,it.error):void 0===n?S(t,i):e(n)?v(t,i,n):S(t,i)}}function P(e,i){e===i?M(e,m()):t(i)?E(e,i):S(e,i)}function C(t){t._onerror&&t._onerror(t._result),L(t)}function S(t,e){t._state===$&&(t._result=e,t._state=tt,0!==t._subscribers.length&&V(L,t))}function M(t,e){t._state===$&&(t._state=et,t._result=e,V(C,t))}function w(t,e,i,n){var o=t._subscribers,s=o.length;t._onerror=null,o[s]=e,o[s+tt]=i,o[s+et]=n,0===s&&t._state&&V(L,t)}function L(t){var e=t._subscribers,i=t._state;if(0!==e.length){for(var n,o,s=t._result,r=0;r<e.length;r+=3)n=e[r],o=e[r+i],n?x(i,n,o,s):o(s);t._subscribers.length=0}}function R(){this.error=null}function b(t,e){try{return t(e)}catch(t){return nt.error=t,nt}}function x(t,i,n,o){var s,r,a,l,c=e(n);if(c){if(s=b(n,o),s===nt?(l=!0,r=s.error,s=null):a=!0,i===s)return void M(i,f())}else s=o,a=!0;i._state!==$||(c&&a?P(i,s):l?M(i,r):t===tt?S(i,s):t===et&&M(i,s))}function G(t,e){try{e(function(e){P(t,e)},function(e){M(t,e)})}catch(e){M(t,e)}}function I(t,e){var i=this;i._instanceConstructor=t,i.promise=new t(p),i._validateInput(e)?(i._input=e,i.length=e.length,i._remaining=e.length,i._init(),0===i.length?S(i.promise,i._result):(i.length=i.length||0,i._enumerate(),0===i._remaining&&S(i.promise,i._result))):M(i.promise,i._validationError())}function A(t){return new ot(this,t).promise}function T(t){function e(t){P(o,t)}function i(t){M(o,t)}var n=this,o=new n(p);if(!W(t))return M(o,new TypeError("You must pass an array to race.")),o;for(var s=t.length,r=0;o._state===$&&r<s;r++)w(n.resolve(t[r]),void 0,e,i);return o}function k(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var i=new e(p);return P(i,t),i}function O(t){var e=this,i=new e(p);return M(i,t),i}function D(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function N(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function U(t){this._id=ct++,this._state=void 0,this._result=void 0,this._subscribers=[],p!==t&&(e(t)||D(),this instanceof U||N(),G(this,t))}function j(){var t;if("undefined"!=typeof global)t=global;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;e&&"[object Promise]"===Object.prototype.toString.call(e.resolve())&&!e.cast||(t.Promise=ht)}var F;F=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var z,B,q,W=F,H=0,V=({}.toString,function(t,e){J[H]=t,J[H+1]=e,H+=2,2===H&&(B?B(u):q())}),Y="undefined"!=typeof window?window:void 0,K=Y||{},X=K.MutationObserver||K.WebKitMutationObserver,Z="undefined"!=typeof process&&"[object process]"==={}.toString.call(process),Q="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,J=new Array(1e3);q=Z?r():X?l():Q?c():void 0===Y&&"function"==typeof require?d():h();var $=void 0,tt=1,et=2,it=new R,nt=new R;I.prototype._validateInput=function(t){return W(t)},I.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},I.prototype._init=function(){this._result=new Array(this.length)};var ot=I;I.prototype._enumerate=function(){for(var t=this,e=t.length,i=t.promise,n=t._input,o=0;i._state===$&&o<e;o++)t._eachEntry(n[o],o)},I.prototype._eachEntry=function(t,e){var n=this,o=n._instanceConstructor;i(t)?t.constructor===o&&t._state!==$?(t._onerror=null,n._settledAt(t._state,e,t._result)):n._willSettleAt(o.resolve(t),e):(n._remaining--,n._result[e]=t)},I.prototype._settledAt=function(t,e,i){var n=this,o=n.promise;o._state===$&&(n._remaining--,t===et?M(o,i):n._result[e]=i),0===n._remaining&&S(o,n._result)},I.prototype._willSettleAt=function(t,e){var i=this;w(t,void 0,function(t){i._settledAt(tt,e,t)},function(t){i._settledAt(et,e,t)})};var st=A,rt=T,at=k,lt=O,ct=0,ht=U;U.all=st,U.race=rt,U.resolve=at,U.reject=lt,U._setScheduler=n,U._setAsap=s,U._asap=V,U.prototype={constructor:U,then:function(t,e){var i=this,n=i._state;if(n===tt&&!t||n===et&&!e)return this;var o=new this.constructor(p),s=i._result;if(n){var r=arguments[n-1];V(function(){x(n,o,r,s)})}else w(i,o,t,e);return o},catch:function(t){return this.then(null,t)}};var ut=j,dt={Promise:ht,polyfill:ut};o=function(){return dt}(),ut()}.call(this),s=function(t,e,i){var n={call:function(t){if(i.polyfill(),!t.url)throw new Error("missing parameter : url is not defined !");if(!t.method)throw new Error("missing parameter : method is not defined !");t.format||(t.format="text");var e={};switch(e.url=t.url,e.data=t.data?t.data:null,e.method=t.method,e.timeOut=t.timeOut||0,e.scope=t.scope||this,t.method){case"DELETE":case"GET":break;case"PUT":case"POST":e.content=t.content?t.content:"application/x-www-form-urlencoded",e.headers=t.headers?t.headers:{referer:"http://localhost"};break;case"HEAD":case"OPTIONS":throw new Error("HTTP method not yet supported !");default:throw new Error("HTTP method unknown !")}switch(t.format){case"text":this.__call(e).then(function(e){t.onResponse.call(this,e)}).catch(function(e){t.onFailure.call(this,e)});break;case"json":this.__callJSON(e).then(function(e){t.onResponse.call(this,e)}).catch(function(e){t.onFailure.call(this,e)});break;case"xml":this.__callXML(e).then(function(e){t.onResponse.call(this,e)}).catch(function(e){t.onFailure.call(this,e)});break;default:throw new Error("This output Format is not yet supported !")}},__call:function(t){var i=new Promise(function(i,n){var o="POST"===t.method||"PUT"===t.method;t.data&&!o&&(t.url=e.normalyzeUrl(t.url,t.data));var s=null;if(window.XMLHttpRequest){s=new XMLHttpRequest,s.open(t.method,t.url,!0),s.overrideMimeType=t.content;var r=null;t.timeOut>0&&(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;s<n.length;s++)o+=","+n[s]}return{apiKey:this._key.apiKey.replace(n?i:null,n),apiKeys:this._key.apiKeys.replace(i,n[0]).replace("%KEYS%",o),aggregate:t+e.concat("/")+n+"/autoconf/id/"}}},Geocode:{_key:n+"/geoportail/ols",url:o},Route:{_key:{ols:n+"/itineraire/ols","route-json":n+"/itineraire/rest/route.json","route-xml":n+"/itineraire/rest/route.xml"},url:function(t){return{ols:this._key.ols.replace(t?i:null,t),"route-json":this._key["route-json"].replace(t?i:null,t),"route-xml":this._key["route-xml"].replace(t?i:null,t)}}}};return s}(),u=function(t,e,i,n,o,s){function r(t){if(!(this instanceof r))throw new TypeError(i.getMessage("CLASS_CONSTRUCTOR"));this.options={protocol:"JSONP",proxyURL:"",callbackSuffix:null,httpMethod:"GET",timeOut:0,rawResponse:!1,scope:this,onSuccess:function(t){console.log("onSuccess - la reponse est la suivante : ",t)},onFailure:function(t){200!==t.status&&t.status?console.log("onFailure - Erreur (",t.status,") : ",t.message):console.log("onFailure : ",t.message)}};for(var e in t)t.hasOwnProperty(e)&&(this.options[e]=t[e]);if(!this.options.apiKey&&!this.options.serverUrl)throw new Error(i.getMessage("PARAM_MISSING","apiKey","serverUrl"));this.options.rawResponse&&!this.options.onSuccess&&(this.options.onSuccess=function(t){console.log("onSuccess - la réponse brute du service est la suivante : ",t)});var n=null!==this.options.onSuccess&&"function"==typeof this.options.onSuccess;if(!n)throw new Error(i.getMessage("PARAM_MISSING","onSuccess()"));if(!this.options.serverUrl){var o=s[this.CLASSNAME].url(this.options.apiKey);"string"==typeof o&&(this.options.serverUrl=o)}if(this.options.serverUrl){var a=this.options.serverUrl,l=a.split("?");this.options.serverUrl=l[0]}switch(this.options.httpMethod="string"==typeof t.httpMethod?t.httpMethod.toUpperCase():"GET",this.options.httpMethod){case"POST":case"GET":break;case"PUT":case"DELETE":case"HEAD":case"OPTIONS":throw new Error(i.getMessage("PARAM_NOT_SUPPORT","httpMethod"));default:throw new Error(i.getMessage("PARAM_UNKNOWN","httpMethod"))}switch(this.options.protocol="string"==typeof t.protocol?t.protocol.toUpperCase():"JSONP",this.options.protocol){case"JSONP":case"XHR":break;default:throw new Error(i.getMessage("PARAM_UNKNOWN","protocol"))}"JSONP"===this.options.protocol&&(this.options.httpMethod="GET"),this.options.nocache=t.nocache||!1,this.options.outputFormat=null,this.request=null,this.response=null}return r.prototype={constructor:r,call:function(){function t(){this.buildRequest.call(this,s,e)}function e(t){this.callService.call(this,s,i)}function i(t){this.analyzeResponse.call(this,s,n)}function n(t){return t?void this.options.onSuccess.call(this,t):s.call(this,new o("Analyse de la reponse en échec !?"))}function s(t){var e=t;e instanceof o||(e=new o(t.message)),this.options.onFailure.call(this,e)}t.call(this)},buildRequest:function(t,e){},callService:function(t,i){var s=null,r=this.request,a=!(!this.options.proxyURL||"XHR"!==this.options.protocol);this.options.serverUrl=e.normalyzeUrl(this.options.serverUrl,{"gp-access-lib":"1.0.0-beta3"},!1),a&&("GET"===this.options.httpMethod&&(s=this.options.proxyURL+e.normalyzeUrl(this.options.serverUrl,this.request,!0),r=null),"POST"===this.options.httpMethod&&(s=this.options.proxyURL+e.normalyzeUrl(this.options.serverUrl,null,!0),r=this.request));var l=this,c={url:s||this.options.serverUrl,method:this.options.httpMethod,protocol:this.options.protocol,timeOut:this.options.timeOut||0,format:this.options.outputFormat,nocache:this.options.nocache||!1,wrap:"XHR"!==this.options.protocol,callbackSuffix:this.options.callbackSuffix,data:r,headers:null,content:this.options.contentType||"application/xml",scope:this.options.scope||this,onResponse:function(e){var n=null;if("XHR"==l.options.protocol&&(n=e),"JSONP"==l.options.protocol){if(!e)return void t.call(l,new o("Le contenu de la reponse est vide !?"));if(e.http){if(200!==e.http.status)return void t.call(l,new o({status:e.http.status,message:e.http.error,type:o.TYPE_SRVERR}));n=e.xml}else n=e}l.response=n,i.call(l,n)},onFailure:function(e){e.type=o.TYPE_SRVERR,t.call(l,new o(e))},onTimeOut:function(){t.call(l,new o("TimeOut!"))}};n.send(c)},analyzeResponse:function(t,e){}},r}(i,n,r,c,a,h),d=function(t){function e(t){if(!(this instanceof e))throw new TypeError("AltiRequest constructor cannot be called as a function.");this.options=t||{},this.positions=this.options.positions||[],this.delimiter=this.options.delimiter||"|",this.indent=this.options.indent||!1,this.crs=this.options.crs||"CRS:84",this.format=this.options.format||"json"}return e.CLASSNAME="AltiRequest",e.prototype={constructor:e,setPositions:function(t){for(var e=[],i=0;i<t.length;i++){var n=t[i];n.lon&&n.lat&&e.push(n)}this.positions=e},getPositions:function(t){if(!t)return this.positions;var e=this.positions.length-1;return t>e||t<e?this.positions:this.positions[t]},addPositions:function(t){for(var e=0;e<t.length;e++){var i=t[e];i.lon&&i.lat&&this.positions.push(t[e])}},getLon:function(){for(var t=[],e=0;e<this.positions.length;e++)t.push(this.positions[e].lon);return t.join(this.delimiter)},getLat:function(){for(var t=[],e=0;e<this.positions.length;e++)t.push(this.positions[e].lat);return t.join(this.delimiter)}},e.prototype.getData=function(){var t=[];return t.push({k:"lon",v:this.getLon()}),t.push({k:"lat",v:this.getLat()}),t.push({k:"delimiter",v:this.delimiter}),t.push({k:"indent",v:this.indent}),t.push({k:"crs",v:this.crs}),t.push({k:"format",v:this.format}),t},e}(i),p=function(t,e){function i(t){if(!(this instanceof i))throw new TypeError("AltiElevationRequest constructor cannot be called as a function.");this.CLASSNAME="AltiElevationRequest",e.apply(this,arguments),this.zonly=this.options.zonly||!1}return i.prototype=Object.create(e.prototype,{zonly:{get:function(){return this._zonly},set:function(t){this._zonly=t}}}),i.prototype.constructor=i,i.prototype.getData=function(){var t=[];return t.push({k:"lon",v:this.getLon()}),t.push({k:"lat",v:this.getLat()}),t.push({k:"indent",v:this.indent}),t.push({k:"crs",v:this.crs}),t.push({k:"zonly",v:this.zonly}),t.push({k:"format",v:this.format}),t},i}(i,d),m=function(t,e){function i(t){if(!(this instanceof i))throw new TypeError("AltiProfilRequest constructor cannot be called as a function.");this.CLASSNAME="AltiProfilRequest",e.apply(this,arguments),this.sampling=this.options.sampling||3}return i.prototype=Object.create(e.prototype,{sampling:{get:function(){return this._sampling},set:function(t){this._sampling=t}}}),i.prototype.constructor=i,i.prototype.getData=function(){var t=[];return t.push({k:"lon",v:this.getLon()}),t.push({k:"lat",v:this.getLat()}),t.push({k:"indent",v:this.indent}),t.push({k:"crs",v:this.crs}),t.push({k:"sampling",v:this.sampling}),t.push({k:"format",v:this.format}),t},i}(i,d),f=function(t,e,i,n){function o(t){if(!(this instanceof o))throw new TypeError("AltiRequestREST constructor cannot be called as a function.");if(this.options=t||{},!this.options)throw new Error(e.getMessage("PARAM_EMPTY","options"));if(!this.options.type)throw new Error(e.getMessage("PARAM_EMPTY","type (Elevation or Profil)"));switch(this.DataObject=null,this.options.type){case"Elevation":this.DataObject=new i(this.options.param);break;case"Profil":this.DataObject=new n(this.options.param);break;default:throw new Error(e.getMessage("PARAM_TYPE","type (Elevation or Profil)"))}this.method=this.options.method||"GET"}return o.prototype={requestString:null,constructor:o,template:{get:{value:"lon=__LON__&lat=__LAT__&indent=__INDENT__&crs='__CRS__'",input:{point:"&zonly=__ZONLY__",profil:"&sampling=__SAMPLING__"}},post:{value:"lon=__LON__\nlat=__LAT__\nindent=__INDENT__\ncrs='__CRS__'\n",input:{point:"zonly=__ZONLY__",profil:"sampling=__SAMPLING__"}}},processRequestString:function(){var t="";return"POST"==this.method?t=this.template.post.value:"GET"==this.method&&(t=this.template.get.value),t=t.replace(/__LON__/g,this.DataObject.getLon()),t=t.replace(/__LAT__/g,this.DataObject.getLat()),t=t.replace(/__INDENT__/g,this.DataObject.indent),t=t.replace(/__CRS__/g,this.DataObject.crs),t+=this.__addDataInputs(),this.requestString=t,this.requestString},__addDataInputs:function(){var t;if("POST"==this.method)t=this.template.post;else{if("GET"!=this.method)throw new Error("No other HTTP method supported by the service !");t=this.template.get}var e=null;if("AltiElevationRequest"==this.DataObject.CLASSNAME)return e=t.input.point,e.replace(/__ZONLY__/g,this.DataObject.zonly);if("AltiProfilRequest"==this.DataObject.CLASSNAME)return e=t.input.profil,e.replace(/__SAMPLING__/g,this.DataObject.sampling);throw new Error("No other object supported than elevation or profil !?")}},o}(i,r,p,m),_=function(t){function e(t){if(!(this instanceof e))throw new TypeError("WPS constructor cannot be called as a function.");if(this.options=t||{},this.DataObject=this.options.data,!this.DataObject)throw new TypeError("This data object is not defined !");this.paramservice=this.options.param.service||"WPS",this.paramversion=this.options.param.version||"1.0.0",this.paramidentifier=this.options.param.identifier||"gs:WPS",this.paramrawdataoutput=this.options.param.rawdataoutput||"result",this.paramrequest=this.options.param.request||"Execute",this.method=this.options.method||"GET"}return e.prototype={requestString:null,constructor:e,template:{get:{value:"service=__SERVICE__&version=__VERSION__&rawdataoutput=__RAWDATAOUTPUT__&identifier=__IDENTIFIER__&request=__REQUEST__&datainputs=<!-- __DATAINPUTS__ -->",input:"__KEY__=__DATA__"},post:{value:'<?xml version="1.0" encoding="UTF-8"?><wps:__REQUEST__ version="__VERSION__" service="__SERVICE__" __NAMESPACE__ __SCHEMALOCATION__><ows:Identifier>__IDENTIFIER__</ows:Identifier><wps:DataInputs><!-- __DATAINPUTS__ --></wps:DataInputs><wps:ResponseForm><wps:RawDataOutput><ows:Identifier>__RAWDATAOUTPUT__</ows:Identifier></wps:RawDataOutput></wps:ResponseForm></wps:__REQUEST__>',input:"<wps:Input><ows:Identifier>__KEY__</ows:Identifier><wps:Data><wps:LiteralData>__DATA__</wps:LiteralData></wps:Data></wps:Input>"}},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(/<!-- __DATAINPUTS__ -->/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;s<o.length;s++)!function(s){e&&(e=s==o.length-1?"":";"),i=i.concat(n.__addDataInput(t,o[s].k,o[s].v),e)}(s);return i},__addDataInput:function(t,e,i){var n=t;return n=n.replace(/__KEY__/g,e),n=n.replace(/__DATA__/g,i)},setMethod:function(t){"GET"!=t&&"POST"!=t||(this.method=t)},getMethod:function(){return this.method}},e}(i),g=function(t,e,i,n,o){var s={build:function(t){if(!t)throw new Error(e.getMessage("PARAM_EMPTY","options"));if(!t.type)throw new Error(e.getMessage("PARAM_EMPTY","type (Elevation or Profil)"));var s=null;switch(t.type){case"Elevation":t.wps.identifier="gs:WPSElevation",s=new n(t.param);break;case"Profil":t.wps.identifier="gs:WPSLineElevation",s=new o(t.param);break;default:throw new Error(e.getMessage("PARAM_TYPE","type (Elevation or Profil)"))}var r={data:s,method:t.method,param:t.wps},a=new i(r);if(!a.processRequestString())throw new Error("Enable to process request !");return a.requestString}};return s}(i,r,_,p,m),v=function(t,e,i,n){var o={build:function(t){var o=null,s={type:t.sampling?"Profil":"Elevation",method:t.httpMethod,param:{positions:null,delimiter:null,indent:null,crs:null,format:null,sampling:null,zonly:null}};s.param.positions=t.positions,s.param.format=t.outputFormat,s.param.sampling=t.sampling,s.param.zonly=t.zonly;var r=null!==t.onError&&"function"==typeof t.onError,a=null!==t.onSuccess&&"function"==typeof t.onSuccess,l=null;switch(t.api){case"REST":var c=new i(s);if(!c.processRequestString()){if(l="Error in process request (rest) !",r)return void t.onError.call(t.scope,new e(l));throw new Error(l)}o=c.requestString;break;case"WPS":if(s.wps={service:null,version:null,identifier:null,rawdataoutput:null,request:null},o=n.build(s),!o){if(l="Error in process request (wps) !",r)return void t.onError.call(t.scope,new e(l));throw new Error(l)}break;default:if(l="Type of API is not supported by service (REST or WPS) !",r)return void t.onError.call(t.scope,new e(l));throw new Error(l)}return a&&t.onSuccess.call(t.scope,o),o}};return o}(i,a,f,g),y=function(t){function e(t){if(!(this instanceof e))throw new TypeError("XML constructor cannot be called as a function.");this.xmlString=null,this.xmlDoc=null,this.reader=null,t&&(t.xmlString&&"string"==typeof t.xmlString&&(this.xmlString=t.xmlString,this.xmlDoc=i(t.xmlString)),t.reader&&this.setReader(t.reader))}function i(t){if("object"==typeof exports){var e=xmldom.DOMParser;return(new e).parseFromString(t,"text/xml")}var i,n,o="Erreur lors du parsing de la réponse du service : XML non conforme";if(window.ActiveXObject){n=new window.ActiveXObject("Microsoft.XMLDOM"),n.async=!1,n.loadXML(t);var s=n.parseError;if(s.errorCode)throw s.line&&s.linepos&&(o+="( ligne "+s.line+", colonne "+s.linepos),s.reason&&(o+=":  "+s.reason+")"),new Error(o);return n}if(window.DOMParser){i=new window.DOMParser;try{n=i.parseFromString(t,"text/xml")}catch(t){throw"SyntaxError"===t.message?new Error(o):new Error("Erreur lors du parsing de la réponse du service : "+t.message)}if(n.getElementsByTagName("parsererror").length>0)for(var r=n.getElementsByTagName("parsererror"),a=0;a<r.length;a++){var l=r[a].innerHTML;if(l.indexOf("Huge input lookup")==-1)throw o+="("+l+")",new Error(o)}else if(!n.documentElement)throw new Error(o);return n}throw new Error("Incompatible DOM Parser pour ce navigateur !")}function n(t){var e;return 9===t.nodeType?e=t.documentElement:1===t.nodeType&&(e=t),e}function o(t){var e={};if(t.attributes.length>0){
       
   139 var i=s(t);e.attributes=i}if(t.hasChildNodes())for(var n,r={},a=t.childNodes,l=0;l<a.length;l++)if(n=a[l],3===n.nodeType)e.textContent=n.nodeValue;else if(1===n.nodeType)if(r=o(n),e[n.nodeName]){if(!Array.isArray(e[n.nodeName])){var c=e[n.nodeName];e[n.nodeName]=[],e[n.nodeName].push(c)}e[n.nodeName].push(r)}else e[n.nodeName]=r;return e}function s(t){if(t.attributes.length>0){for(var e={},i=t.attributes,n=0;n<i.length;n++){var o=i[n];e[o.nodeName]=o.nodeValue}return e}}return e.prototype={constructor:e,getXMLString:function(){return this.xmlString},setXMLString:function(t){t&&"string"==typeof t&&(this.xmlString=t,this.xmlDoc=i(t))},getReader:function(){return this.reader},setReader:function(t){t&&t.read&&"function"==typeof t.read&&(this.reader=t)},getXMLDoc:function(){return this.xmlDoc},setXMLDoc:function(t){this.xmlDoc=t},parse:function(){if(!this.xmlDoc&&this.xmlString&&(this.xmlDoc=i(this.xmlString)),this.xmlDoc){var t=n(this.xmlDoc);if(t){var e;return this.reader&&this.reader.read?e=this.reader.read(t):(e={},e[t.nodeName]=o(t)),e}return{}}}},e}(i),E=function(){function t(){if(!(this instanceof t))throw new TypeError("AltiResponse constructor cannot be called as a function.");this.elevations=[]}return t.prototype={constructor:t},t}(),P=function(){function t(){if(!(this instanceof t))throw new TypeError("Elevation constructor cannot be called as a function.");this.z=null}return t.prototype={constructor:t},t}(),C=function(t,e,i){var n={};return n.READERS={elevations:function(t){var i=new e;if(t.hasChildNodes())for(var o,s,r=t.childNodes,a=0;a<r.length;a++)o=r[a],n.READERS[o.nodeName]&&(s=n.READERS[o.nodeName](o),i.elevations.push(s));return i},elevation:function(t){var e=new i;if(t.hasChildNodes())for(var o,s=t.childNodes,r=0;r<s.length;r++)o=s[r],n.READERS[o.nodeName]&&n.READERS[o.nodeName](o,e);return e},lat:function(t,e){var i=t.firstChild;if(!i||3!==i.nodeType)throw new Error("Erreur dans la lecture de la réponse du service: latitude attendue mais absente");e.lat=parseFloat(i.nodeValue)},lon:function(t,e){var i=t.firstChild;if(!i||3!==i.nodeType)throw new Error("Erreur dans la lecture de la réponse du service: longitude attendue mais absente");e.lon=parseFloat(i.nodeValue)},z:function(t,e){var n=t.firstChild;if(!n||3!==n.nodeType)throw new Error("Erreur dans la lecture de la réponse du service: altitude attendue mais absente");return e?void(e.z=parseFloat(n.nodeValue)):(e=new i,e.z=parseFloat(n.nodeValue),e)},acc:function(t,e){var i=t.firstChild;if(!i||3!==i.nodeType)throw new Error("Erreur dans la lecture de la réponse du service: précision (acc) attendue mais absente");e.acc=parseFloat(i.nodeValue)},exceptionreport:function(t){var e={};if(t.hasChildNodes())for(var i,o=t.childNodes,s=0;s<o.length;s++)i=o[s],"Exception"===i.nodeName&&(e.exceptionReport=n.READERS.exception(i));return e},exception:function(t){var e={},i=t.getAttribute("exceptionCode");i&&(e.exceptionCode=i);var n=t.firstChild;return n&&3===n.nodeType&&(e.exception=n.nodeValue),e},error:function(t){var e={error:{}};if(t.hasChildNodes())for(var i,n=t.childNodes,o=0;o<n.length;o++){i=n[o];var s;1===i.nodeType&&"code"===i.nodeName&&(s=i.firstChild,s&&3===s.nodeType&&(e.error.code=s.nodeValue)),1===i.nodeType&&"description"===i.nodeName&&(s=i.firstChild,s&&3===s.nodeType&&(e.error.description=s.nodeValue))}return e}},n.read=function(t){if("elevations"===t.nodeName){var e=n.READERS.elevations(t);return e}if("ExceptionReport"===t.nodeName){var i=n.READERS.exceptionreport(t);return i}if("error"===t.nodeName){var o=n.READERS.error(t);return o}throw new Error("Erreur lors de la lecture de la réponse : elle n'est pas au format attendu.")},n}(i,E,P),S=function(t,e,i,n,o,s,r){var a={build:function(t){var a=null;if(!t.response)return void t.onError.call(t.scope,new e(i.getMessage("SERVICE_RESPONSE_EMPTY")));if(t.rawResponse)a=t.response;else{switch(t.outputFormat){case"xml":try{var l=new n({reader:o});if("string"==typeof t.response?l.setXMLString(t.response):l.setXMLDoc(t.response),a=l.parse(),!a)throw new Error(i.getMessage("SERVICE_RESPONSE_EXCEPTION_2"))}catch(n){var c=n.message;return void t.onError.call(t.scope,new e({message:i.getMessage("SERVICE_RESPONSE_EXCEPTION",c),status:200,type:e.TYPE_SRVERR}))}break;case"json":var h;if(h="string"==typeof t.response?window.JSON.parse(t.response):t.response,h.error)return void t.onError.call(t.scope,new e({message:i.getMessage("SERVICE_RESPONSE_EXCEPTION",h.error.description),status:200,type:e.TYPE_SRVERR}));if(h){var u,d=h.elevations,p=new s;if(Array.isArray(d)&&d.length)for(var m=0;m<d.length;m++)u=new r,"object"==typeof d[m]?(d[m].lon&&(u.lon=d[m].lon),d[m].lat&&(u.lat=d[m].lat),d[m].z&&(u.z=d[m].z),d[m].acc&&(u.acc=d[m].acc)):"number"==typeof d[m]&&(u.z=d[m]),Array.isArray(p.elevations)&&p.elevations.push(u);a=p}if(!a)return void t.onError.call(t.scope,new e({message:i.getMessage("SERVICE_RESPONSE_ANALYSE_2"),type:e.TYPE_UNKERR,status:-1}));break;default:return void t.onError.call(t.scope,new e({message:i.getMessage("SERVICE_RESPONSE_FORMAT_2"),type:e.TYPE_UNKERR,status:-1}))}if(a.exceptionReport)return void t.onError.call(t.scope,new e({message:i.getMessage("SERVICE_RESPONSE_EXCEPTION",a.exceptionReport),type:e.TYPE_SRVERR,status:200}));if(a.error){var f=a.error.description;return void t.onError.call(t.scope,new e({message:i.getMessage("SERVICE_RESPONSE_EXCEPTION",f),type:e.TYPE_SRVERR,status:200}))}}t.onSuccess.call(t.scope,a)}};return a}(i,a,r,y,C,E,P),M=function(t,e,i,n,o,s,r){function a(t){if(!(this instanceof a))throw new TypeError(e.getMessage("CLASS_CONSTRUCTOR","Alti"));if(this.CLASSNAME="Alti",n.apply(this,arguments),!t.positions)throw new Error(e.getMessage("PARAM_MISSING","positions"));if(0===t.positions.length)throw new Error(e.getMessage("PARAM_EMPTY","positions"));if(this.options.positions=t.positions,this.options.outputFormat="string"==typeof t.outputFormat?t.outputFormat.toLowerCase():"xml",this.options.sampling=t.sampling||null,this.options.api="string"==typeof t.api?t.api.toUpperCase():"REST","REST"===this.options.api&&(this.options.httpMethod="GET"),this.options.zonly=t.zonly||!1,!this.options.serverUrl){var i=o.Alti.url(this.options.apiKey),s=null;switch(this.options.api){case"WPS":s=i.wps;break;case"REST":var r=(t.sampling?"profil":"elevation")+"-"+this.options.outputFormat;s=i[r];break;default:throw new Error(e.getMessage("PARAM_UNKNOWN","api"))}if(!s)throw new Error("Url by default not found !");this.options.serverUrl=s}var l=this.options.serverUrl.lastIndexOf(".");if(l!==-1){var c=this.options.serverUrl.substring(l+1);if(c&&c.length<5)switch(c.toLowerCase()){case"json":case"xml":this.options.outputFormat=c.toLowerCase();break;default:throw new Error("type of service : unknown or unsupported (json or xml) !")}}}return a.prototype=Object.create(n.prototype,{}),a.prototype.constructor=a,a.prototype.buildRequest=function(t,e){var i={httpMethod:this.options.httpMethod,onSuccess:function(t){this.request=t,e.call(this,this.request)},onError:t,scope:this,positions:this.options.positions,outputFormat:this.options.outputFormat,sampling:this.options.sampling,api:this.options.api,zonly:this.options.zonly};s.build(i)},a.prototype.analyzeResponse=function(t,n){if(this.response){var o={response:this.response,outputFormat:this.options.outputFormat,rawResponse:this.options.rawResponse,onError:t,onSuccess:n,scope:this};r.build(o)}else t.call(this,new i(e.getMessage("SERVICE_RESPONSE_EMPTY")))},a}(i,r,a,u,h,v,S),w=function(){function t(){if(!(this instanceof t))throw new TypeError("AutoConfResponse constructor cannot be called as a function.");this.generalOptions={apiKeys:{},title:null,defaultGMLGFIStyle:null,theme:null,wgs84Resolutions:[]},this.layers={},this.territories={},this.tileMatrixSets={},this.services={}}return t.prototype={constructor:t,isConfLoaded:function(t){if(t)return!!this.generalOptions.apiKeys[t]},getLayersId:function(t){return this.generalOptions.apiKeys[t]},getLayersConf:function(t){var e={},i=this.getLayersId(t);if(i)for(var n=0;n<i.length;n++){var o=i[n];e[o]=this.layers[o]}return e},getLayerConf:function(t){if(this.layers)return this.layers[t]},getTileMatrixSets:function(){return this.tileMatrixSets},getTMSConf:function(t){if(this.tileMatrixSets)return this.tileMatrixSets[t]},getTerritories:function(){return this.territories},getTerritoryConf:function(t){if(this.territories)return this.territories[t]},getServices:function(){return this.services},getServiceConf:function(t){if(this.services)return this.services[t]}},t}(),L=function(){function t(){if(!(this instanceof t))throw new TypeError("Constraint constructor cannot be called as a function.");this.crs=null,this.bbox={left:null,right:null,top:null,bottom:null},this.minScaleDenominator=null,this.maxScaleDenominator=null,this.temporalExtent=[null,null]}return t.prototype={constructor:t},t}(),R=function(){function t(){if(!(this instanceof t))throw new TypeError("Format constructor cannot be called as a function.");this.current=null,this.name=null}return t.prototype={constructor:t},t}(),b=function(){function t(){if(!(this instanceof t))throw new TypeError("Layer constructor cannot be called as a function.")}return t.prototype={constructor:t,getName:function(){return this.name},getTitle:function(){return this.title},getDescription:function(){return this.description},getLayerId:function(){return this.layerId},getQuicklookUrl:function(){return this.quicklookUrl},getDefaultProjection:function(){return this.defaultProjection},getProjections:function(){var t=[];t.push(this.defaultProjection);var e=t.concat(this.additionalProjections);return e},getBBOX:function(){if(this.globalConstraint)return this.globalConstraint.bbox},getMinScaleDenominator:function(){if(this.globalConstraint)return this.globalConstraint.minScaleDenominator},getMaxScaleDenominator:function(){if(this.globalConstraint)return this.globalConstraint.maxScaleDenominator},getTMSID:function(){if(this.wmtsOptions)return this.wmtsOptions.tileMatrixSetLink},getServiceParams:function(){return this.serviceParams},getServerUrl:function(t){if(t&&this.serviceParams&&this.serviceParams.serverUrl)return this.serviceParams.serverUrl[t]},getLegends:function(){return this.legends},getMetadata:function(){return this.metadata},getStyles:function(){return this.styles},getDefaultStyle:function(){if(this.styles){for(var t,e=this.styles,i=0;i<e.length;i++)if(e[i].current===!0){t=e[i].name;break}return t}},getThematics:function(){return this.thematics},getDefaultFormat:function(){if(this.formats){for(var t,e=this.formats,i=0;i<e.length;i++)if(e[i].current===!0){t=e[i].name;break}return t}},getConstraints:function(){return this.constraints},getOriginators:function(){return this.originators},getDimensions:function(){return this.dimensions},getAggregatedLayers:function(){return this.isAggregate?this.aggregatedLayers:void 0}},t}(),x=function(){function t(){if(!(this instanceof t))throw new TypeError("Legend constructor cannot be called as a function.");this.format=null,this.url=null,this.minScaleDenominator=null}return t.prototype={constructor:t},t}(),G=function(){function t(){if(!(this instanceof t))throw new TypeError("Metadata constructor cannot be called as a function.");this.format=null,this.url=null}return t.prototype={constructor:t},t}(),I=function(){function t(){if(!(this instanceof t))throw new TypeError("Originator constructor cannot be called as a function.");this.name=null,this.attribution=null,this.logo=null,this.url=null,this.constraints=[]}return t.prototype={constructor:t},t}(),A=function(){function t(){if(!(this instanceof t))throw new TypeError("Service constructor cannot be called as a function.");this.title=null,this.serverUrl=null,this.version=null}return t.prototype={constructor:t},t}(),T=function(){function t(){if(!(this instanceof t))throw new TypeError("Style constructor cannot be called as a function.");this.name=null,this.title=null,this.current=null}return t.prototype={constructor:t},t}(),k=function(){function t(){if(!(this instanceof t))throw new TypeError("Territory constructor cannot be called as a function.");this.isDefault=null,this.defaultCRS=null,this.additionalCRS=[],this.geoBBOX={left:null,right:null,top:null,bottom:null},this.geoCenter={lon:null,lat:null},this.defaultOptions={resolution:null,minScaleDenominator:null,maxScaleDenominator:null},this.defaultLayers=[]}return t.prototype={constructor:t},t}(),O=function(){function t(){if(!(this instanceof t))throw new TypeError("Thematic constructor cannot be called as a function.");this.inspire=null,this.name=null}return t.prototype={constructor:t},t}(),D=function(){function t(){if(!(this instanceof t))throw new TypeError("TileMatrixSet constructor cannot be called as a function.");this.projection=null,this.nativeResolutions=[],this.matrixIds=[],this.tileMatrices={}}return t.prototype={constructor:t,getResolutions:function(){return this.nativeResolutions},getMatrixIds:function(){return this.matrixIds},getProjection:function(){return this.projection},getTileMatrices:function(){return this.tileMatrices},getTopLeftCorner:function(){var t,e=this.getTileMatrices();if(e)for(var i in e)if(e.hasOwnProperty(i)){t=e[i].topLeftCorner;break}return t}},t}(),N=function(){function t(){if(!(this instanceof t))throw new TypeError("TileMatrix constructor cannot be called as a function.");this.matrixId=null,this.matrixHeight=null,this.matrixWidth=null,this.scaleDenominator=null,this.tileHeight=null,this.tileWidth=null,this.topLeftCorner=null}return t.prototype={constructor:t,getTopLeftCorner:function(){return this.topLeftCorner},getScaleDenominator:function(){return this.scaleDenominator},getTileHeight:function(){return this.tileHeight},getTileWidth:function(){return this.tileWidth},getMatrixHeight:function(){return this.matrixHeight},getMatrixWidth:function(){return this.matrixWidth}},t}(),U=function(){function t(){if(!(this instanceof t))throw new TypeError("TileMatrixLimit constructor cannot be called as a function.");this.minTileRow=null,this.maxTileRow=null,this.minTileCol=null,this.maxTileCol=null}return t.prototype={constructor:t},t}(),j=function(t,e,i,n,o,s,r,a,l,c,h,u,d,p,m){function f(t){if(t.attributes.length>0){for(var e={},i=t.attributes,n=0;n<i.length;n++){var o=i[n];e[o.nodeName]=o.nodeValue}return e}}function _(t,e){if(t.hasChildNodes())for(var i,n,o,s=t.childNodes,r=0;r<s.length;r++)if(i=s[r],1===i.nodeType)if(n=i.localName||i.baseName||i.nodeName,o=i.prefix||y.DEFAULTPREFIX,y.READERS[o][n]){var a=y.READERS[o][n];a(i,e)}else _(i,e)}function g(t){var e,i="";return t.hasChildNodes()&&(e=t.firstChild,3!==e.nodeType&&4!==e.nodeType||(i=e.nodeValue)),i}function v(t){if(t.attributes.length>0){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;s<o.length;s++){var r=o[s];e.generalOptions.apiKeys&&(e.generalOptions.apiKeys[r]&&Array.isArray(e.generalOptions.apiKeys[r])||(e.generalOptions.apiKeys[r]=[]),e.generalOptions.apiKeys[r].push(i))}var a=n.serviceParams;if(a&&a.id&&!e.services[a.id]){var c=new l;a.serverUrl&&(c.serverUrl=a.serverUrl),a.version&&(c.version=a.version),e.services[a.id]=c}if(n.wmtsOptions&&n.wmtsOptions.tileMatrixSetLink&&e.tileMatrixSets){var h=n.wmtsOptions.tileMatrixSetLink,u=e.tileMatrixSets;for(var d in u)u.hasOwnProperty(d)&&d===h&&(n.defaultProjection=u[d].projection)}}},Layer:function(t,e){if(e&&e.layers){var i={lyr:new o,lyrId:null},n=t.getAttribute("hidden");"1"===n?i.lyr.hidden=!0:i.lyr.hidden=!1;var s=t.getAttribute("queryable");if("1"===s?i.lyr.queryable=!0:i.lyr.queryable=!1,_(t,i),i.lyrId){if(i.lyr.serviceParams&&i.lyr.serviceParams.id){var r=i.lyr.serviceParams.id;if(r.toUpperCase().indexOf("OPENLS")!==-1||r.toUpperCase().indexOf("ELEVATION")!==-1){var a=i.lyrId.split("$")[0];i.lyrId=a+"$"+r}}i.lyr.layerId=i.lyrId,e.layers[i.lyrId]=i.lyr}}},Name:function(t,e){e&&e.lyr&&(e.lyr.name=g(t))},SRS:function(t,e){e&&e.lyr&&(e.lyr.defaultProjection=g(t))},Format:function(t,e){if(e&&e.lyr){var i=new n,o=t.getAttribute("current");"1"===o?i.current=!0:i.current=!1,i.name=g(t),e.lyr.formats&&Array.isArray(e.lyr.formats)||(e.lyr.formats=[]),e.lyr.formats.push(i)}},Style:function(t,e){if(e&&e.lyr){var i=new c,n=t.getAttribute("current");if("1"===n||1===n?i.current=!0:i.current=!1,t.hasChildNodes)for(var o,s,r=t.childNodes,a=0;a<r.length;a++)o=r[a],1===o.nodeType&&(s=o.localName||o.baseName||o.nodeName,"Name"===s?i.name=g(o):"Title"===s&&(i.title=g(o)));e.lyr.styles&&Array.isArray(e.lyr.styles)||(e.lyr.styles=[]),e.lyr.styles.push(i)}},Dimension:function(t,e){var i=t.getAttribute("name"),n=g(t);e&&e.lyr&&(e.lyr.dimensions||(e.lyr.dimensions={}),"Type"===i?e.lyr.dimensions.type=n:"VisibilityRange"===i?e.lyr.dimensions.visibilityRange=n:"VisibilityMode "===i?e.lyr.dimensions.visibilityMode=n:"GeometricType"===i?e.lyr.dimensions.geometricType=n:"NoDataValue"===i&&(e.lyr.dimensions.noDataValue=n))}},gpp:{Theme:function(t,e){e&&e.generalOptions&&e.generalOptions.hasOwnProperty("theme")&&(e.generalOptions.theme=g(t))},defaultGMLGFIStyleUrl:function(t,e){e&&e.generalOptions&&e.generalOptions.hasOwnProperty("defaultGMLGFIStyle")&&(e.generalOptions.defaultGMLGFIStyle=g(t))},Territory:function(t,e){var i=t.getAttribute("id");if(i){var n=new h,o=t.getAttribute("default");"1"===o?n.isDefault=!0:n.isDefault=!1,_(t,n),e&&e.territories&&"object"==typeof e.territories&&(e.territories[i]=n)}},defaultCRS:function(t,e){e&&e.hasOwnProperty("defaultCRS")&&(e.defaultCRS=g(t))},AdditionalCRS:function(t,e){var i=g(t);i&&e&&(Array.isArray(e.additionalCRS)?e.additionalCRS.push(i):(e.additionalProjections&&Array.isArray(e.additionalProjections)||(e.additionalProjections=[]),e.additionalProjections.push(i)))},DefaultLayer:function(t,e){var i=t.getAttribute("layerId");i&&e&&Array.isArray(e.defaultLayers)&&e.defaultLayers.push(i)},BoundingBox:function(t,e){if(e){var n=g(t).split(",");if(4===n.length){var o={left:parseFloat(n[0]),right:parseFloat(n[2]),top:parseFloat(n[3]),bottom:parseFloat(n[1])},s=t.getAttribute("minT"),r=t.getAttribute("maxT");if(e.hasOwnProperty("geoBBOX"))e.geoBBOX=o;else if(e.hasOwnProperty("bbox"))if(e.bbox.left||e.bbox.right||e.bbox.top||e.bbox.bottom){e.multiConstraints||(e.multiConstraints=[]);var a=new i;a.bbox=o,a.temporalExtent=[s,r],e.multiConstraints.push(a)}else e.bbox=o,e.temporalExtent=[s,r];else e.globalConstraint||(e.globalConstraint=new i),e.globalConstraint.bbox=o,e.globalConstraint.temporalExtent=[s,r]}}},Resolution:function(t,e){var i=g(t);i&&e&&e.defaultOptions&&e.defaultOptions.hasOwnProperty("resolution")&&(e.defaultOptions.resolution=parseFloat(i))},x:function(t,e){var i=g(t);i&&e&&e.geoCenter&&e.geoCenter.hasOwnProperty("lon")&&(e.geoCenter.lon=parseFloat(i))},y:function(t,e){var i=g(t);i&&e&&e.geoCenter&&e.geoCenter.hasOwnProperty("lat")&&(e.geoCenter.lat=parseFloat(i))},Resolutions:function(t,e){e&&e.generalOptions&&e.generalOptions.hasOwnProperty("wgs84Resolutions")&&(e.generalOptions.wgs84Resolutions=g(t).split(","))},Layer:function(t,e){if(e&&e.hasOwnProperty("lyrId")&&e.lyr){e.lyrId=t.getAttribute("id");var i=t.getAttribute("aggregate"),n=t.getAttribute("more");(i||n)&&(e.lyr.isAggregate=!0),_(t,e.lyr)}},Constraint:function(t,e){var n=new i;if(_(t,n),e)if(e.constraints&&Array.isArray(e.constraints)||(e.constraints=[]),n.multiConstraints&&Array.isArray(n.multiConstraints)){var o=new i;o.crs=n.crs,o.bbox=n.bbox,o.minScaleDenominator=n.minScaleDenominator,o.maxScaleDenominator=n.maxScaleDenominator,o.temporalExtent=n.temporalExtent,e.constraints.push(o);for(var s=0;s<n.multiConstraints.length;s++)o=new i,o.crs=n.crs,o.minScaleDenominator=n.minScaleDenominator,o.maxScaleDenominator=n.maxScaleDenominator,o.bbox=n.multiConstraints[s].bbox,o.temporalExtent=n.multiConstraints[s].temporalExtent,e.constraints.push(o)}else e.constraints.push(n)},CRS:function(t,e){e&&e.hasOwnProperty("crs")&&(e.crs=g(t))},Thematic:function(t,e){if(e){var i=new u;i.inspire=!1,i.name=g(t),e.thematics&&Array.isArray(e.thematics)||(e.thematics=[]),e.thematics.push(i)}},InspireThematic:function(t,e){if(e){var i=new u;i.inspire=!0,i.name=g(t),e.thematics&&Array.isArray(e.thematics)||(e.thematics=[]),e.thematics.push(i)}},Originator:function(t,e){if(e){var i=new a;i.name=t.getAttribute("name"),_(t,i),e.originators&&Array.isArray(e.originators)||(e.originators=[]),e.originators.push(i)}},Attribution:function(t,e){e&&e.hasOwnProperty("attribution")&&(e.attribution=g(t))},Logo:function(t,e){e&&e.hasOwnProperty("logo")&&(e.logo=g(t))},URL:function(t,e){e&&e.hasOwnProperty("url")&&(e.url=g(t))},Legend:function(t,e){var i=new s;_(t,i),e&&(e.legends&&Array.isArray(e.legends)||(e.legends=[]),e.legends.push(i))},LegendURL:function(t,e){if(e&&e.hasOwnProperty("format")&&(e.format=t.getAttribute("format"),t.hasChildNodes)){var i=t.childNodes[0],n=i.localName||i.baseName||i.nodeName;"OnlineResource"===n&&e.hasOwnProperty("url")&&(e.url=i.getAttribute("xlink:href"))}},QuickLook:function(t,e){if(t.hasChildNodes){var i=t.childNodes[0],n=i.localName||i.baseName||i.nodeName;"OnlineResource"===n&&e&&(e.quicklookUrl=i.getAttribute("xlink:href"))}},MetadataURL:function(t,e){if(e){var i=new r;if(i.format=t.getAttribute("format"),t.hasChildNodes){var n=t.childNodes[0],o=n.localName||n.baseName||n.nodeName;"OnlineResource"===o&&(i.url=n.getAttribute("xlink:href"))}e.metadata||Array.isArray(e.metadata)||(e.metadata=[]),e.metadata.push(i)}},Key:function(t,e){if(e){var i=t.getAttribute("id");e.apiKeys&&Array.isArray(e.apiKeys)||(e.apiKeys=[]),e.apiKeys.push(i);var n=g(t);e.serviceParams||(e.serviceParams={}),e.serviceParams.serverUrl||(e.serviceParams.serverUrl={}),e.serviceParams.serverUrl[i]||(e.serviceParams.serverUrl[i]=n)}}},ows:{Identifier:function(t,e){e&&e.hasOwnProperty("TMS")?e.identifier=g(t):e&&e.hasOwnProperty("matrixId")&&(e.matrixId=g(t))},SupportedCRS:function(t,e){e&&e.TMS&&e.TMS.hasOwnProperty("projection")&&(e.TMS.projection=g(t))}},sld:{MinScaleDenominator:function(t,e){var n=g(t);n&&e&&(e.hasOwnProperty("defaultOptions")?e.defaultOptions.minScaleDenominator=parseFloat(n):e.lyr?(e.lyr.globalConstraint||(e.lyr.globalConstraint=new i),e.lyr.globalConstraint.minScaleDenominator=parseFloat(n)):e.hasOwnProperty("minScaleDenominator")&&(e.minScaleDenominator=parseFloat(n)))},MaxScaleDenominator:function(t,e){var n=g(t);n&&e&&(e.hasOwnProperty("defaultOptions")?e.defaultOptions.maxScaleDenominator=parseFloat(n):e.lyr?(e.lyr.globalConstraint||(e.lyr.globalConstraint=new i),e.lyr.globalConstraint.maxScaleDenominator=parseFloat(n)):e.hasOwnProperty("maxScaleDenominator")&&(e.maxScaleDenominator=parseFloat(n)))}},wmts:{TileMatrixSetLimits:function(t,e){if(e){var i={};_(t,i),e.wmtsOptions||(e.wmtsOptions={}),e.wmtsOptions.tileMatrixSetLimits=i}},TileMatrixLimits:function(t,e){var i,n=new m;if(t.hasChildNodes){for(var o=t.childNodes,s=0;s<o.length;s++){var r=o[s],a=r.localName||r.baseName||r.nodeName;"TileMatrix"===a?i=g(r):"MinTileRow"===a?n.minTileRow=g(r):"MaxTileRow"===a?n.maxTileRow=g(r):"MinTileCol"===a?n.minTileCol=g(r):"MaxTileCol"===a&&(n.maxTileCol=g(r))}i&&e&&!e[i]&&(e[i]=n)}},TileMatrixSet:function(t,e){if(e&&e.tileMatrixSets){var i={};i.TMS=new d,i.resolutions=[],_(t,i);var n=i.TMS.tileMatrices;for(var o in n)n.hasOwnProperty(o)&&i.TMS.matrixIds.push(o);if(("IGNF:WGS84G"===i.TMS.getProjection()||"EPSG:4326"===i.TMS.getProjection())&&e.generalOptions&&Array.isArray(e.generalOptions.wgs84Resolutions))for(var s=e.generalOptions.wgs84Resolutions,r=0;r<s.length;r++)i.resolutions[r]=parseFloat(s[r]);Array.isArray(i.resolutions)&&void 0!==i.resolutions.sort&&i.resolutions.sort(function(t,e){return e-t}),i.TMS.nativeResolutions=i.resolutions,e.tileMatrixSets[i.identifier]=i.TMS}else e&&!e.wmtsOptions&&(e.wmtsOptions={}),e.wmtsOptions.tileMatrixSetLink=g(t)},TileMatrix:function(t,e){if(e){var i=new p;if(_(t,i),e.TMS&&e.TMS.getProjection()){var n=e.TMS.getProjection();if("EPSG:3857"===n||"EPSG:2154"===n){var o=28e-5*i.scaleDenominator;e.resolutions&&Array.isArray(e.resolutions)&&e.resolutions.push(o)}}e.TMS&&e.TMS.tileMatrices&&(e.TMS.tileMatrices[i.matrixId]=i)}},ScaleDenominator:function(t,e){var i=g(t);i&&e&&e.hasOwnProperty("scaleDenominator")&&(e.scaleDenominator=parseFloat(i))},TopLeftCorner:function(t,e){var i=g(t).split(" ");i&&e&&(e.topLeftCorner={},e.topLeftCorner.x=parseFloat(i[0]),e.topLeftCorner.y=parseFloat(i[1]))},TileWidth:function(t,e){var i=g(t);i&&e&&e.hasOwnProperty("tileWidth")&&(e.tileWidth=parseInt(i,10))},TileHeight:function(t,e){var i=g(t);i&&e&&e.hasOwnProperty("tileHeight")&&(e.tileHeight=parseInt(i,10))},MatrixWidth:function(t,e){var i=g(t);i&&e&&e.hasOwnProperty("matrixWidth")&&(e.matrixWidth=parseInt(i,10))},MatrixHeight:function(t,e){var i=g(t);i&&e&&e.hasOwnProperty("matrixHeight")&&(e.matrixHeight=parseInt(i,10))}},serviceException:function(t){var e={};if(t.hasChildNodes())for(var i,n=t.childNodes,o=0;o<n.length;o++)i=n[o],"exception"===i.nodeName&&(e.exceptionReport=y.READERS.exception(i));return e},exception:function(t){var e={},i=t.getAttribute("code");i&&(e.exceptionCode=i);var n=t.firstChild;return n&&3===n.nodeType&&(e.exception=n.nodeValue),e}},y.read=function(t){if("ViewContext"===t.nodeName){var e=t.prefix||y.DEFAULTPREFIX,i=y.READERS[e][t.nodeName](t);return i}if("serviceException"===t.nodeName){var n=y.READERS[t.nodeName](t);return n}throw new Error("Erreur lors de la lecture de la réponse : elle n'est pas au format attendu.")},y}(i,w,L,R,b,x,G,I,A,T,k,O,D,N,U),F=function(t,e,i,n,o){var s={build:function(t){var s=null;if(!t.response)return void t.onError.call(t.scope,new e(i.getMessage("SERVICE_RESPONSE_EMPTY")));if(t.rawResponse)s=t.response;else{try{var r=new n({reader:o});"string"==typeof t.response?r.setXMLString(t.response):r.setXMLDoc(t.response),s=r.parse()}catch(n){var a=n.message;return a+="string"==typeof t.response?"\n(raw response service'"+t.response+"')":"\n(raw response service'"+t.response.documentElement.innerHTML+"')",void t.onError.call(t.scope,new e({message:i.getMessage("SERVICE_RESPONSE_EXCEPTION",a),status:200,type:e.TYPE_SRVERR}))}var l=!0;for(var c in s)s.hasOwnProperty(c)&&(l=!1);if(l)return void t.onError.call(t.scope,new e(i.getMessage("SERVICE_RESPONSE_EMPTY_2")));if(s.exceptionReport)return void t.onError.call(t.scope,new e({message:i.getMessage("SERVICE_RESPONSE_EXCEPTION",s.exceptionReport),type:e.TYPE_SRVERR,status:200}))}var h="undefined"!=typeof window?window:{};h.Gp||(h.Gp={}),h.Gp.Config?this.mergeConfig(h.Gp.Config,s,t.layerId):h.Gp.Config=s,t.onSuccess.call(t.scope,h.Gp.Config)},mergeConfig:function(t,e,i){if(e&&t){for(var n in e)if(e.hasOwnProperty(n))if("generalOptions"==n)for(var o in e[n].apiKeys)e[n].apiKeys.hasOwnProperty(o)&&!t.generalOptions.apiKeys[o]&&(t.generalOptions.apiKeys[o]=e[n].apiKeys[o]);else if(t[n])for(var s in e[n])e[n].hasOwnProperty(s)&&!t[n][s]&&(t[n][s]=e[n][s]);if(i){var r=[];for(var a in e.layers)e.layers.hasOwnProperty(a)&&r.push(a);t.layers[i]&&(t.layers[i].aggregatedLayers=r)}}}};return s}(i,a,r,y,j),z=function(t,e,i,n,o,s,r){function a(t){if(!(this instanceof a))throw new TypeError(e.getMessage("CLASS_CONSTRUCTOR","AutoConf"));if(this.CLASSNAME="AutoConf",s.apply(this,arguments),!this.options.serverUrl&&!this.options.serverUrl){var i=o.AutoConf.url(this.options.apiKey);this.options.layerId?this.options.serverUrl=i.aggregate+this.options.layerId:Array.isArray(this.options.apiKey)&&this.options.apiKey.length>0?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:'<RequestHeader srsName="__SRSNAME__"/>',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:'<Request maximumResponses="__MAXRESPONSES__" methodName="__METHODNAME__" requestID="__UUID__" version="__VERSION__"><!-- __REQUESTSERVICE__ --></Request>',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),
       
   140 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:'<?xml version="1.0" encoding="UTF-8"?>\n<XLS version="__VERSION__"\n__NAMESPACE__ \n__SCHEMALOCATION__>\n__REQUESTHEADER__\n__REQUEST__\n</XLS>\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<o.length;s++){var r=o[s],a=r.split("="),l=a[0];if(l==="xmlns:"+i){n=!0;break}}if(!n)return e;var c,h;return c=/<(\w+[\s>])/g,h="<"+i+":$1",e=e.replace(c,h),c=/<\/(\w+[\s>])/g,h="</"+i+":$1",e=e.replace(c,h)},o.prototype.build=function(){var t=!!this.getService(),n="";n=this.template,n=n.replace(/__VERSION__/g,o.VERSION),n=n.replace(/__NAMESPACE__/g,this.namespaceByDefault),n=n.replace(/__SCHEMALOCATION__/g,this.schemaLocationByDefault);var s=new e({srsName:this.options.srsName});n=n.replace(/__REQUESTHEADER__/g,s.toString());var r=new i({maximumResponses:this.options.maximumResponses,version:o.VERSION,methodName:t?this.getService().CLASSTYPE:null});if(n=n.replace(/__REQUEST__/g,r.toString()),t&&(n=n.replace(/<!-- __REQUESTSERVICE__ -->/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:'<Address countryCode="__COUNTRYCODE__">__LOCATION____PLACE____POSTALCODE____ENVELOPE__</Address>',location:{freeFormAddress:"<freeFormAddress>__FREEFORMADDRESSVALUE__</freeFormAddress>",streetAddress:{container:"<StreetAddress>__STREET____BUILDING__</StreetAddress>",building:'<Building number="__BUILDINGVALUE__"/>',street:"<Street>__STREETVALUE__</Street>"}},place:'<Place type="__PLACETYPE__">__PLACEVALUE__</Place>',postalCode:"<PostalCode>__POSTALCODEVALUE__</PostalCode>",envelope:"<gml:Envelope><gml:lowerCorner>__LEFT__ __BOTTOM__</gml:lowerCorner><gml:upperCorner>__RIGHT__ __TOP__</gml:upperCorner></gml:Envelope>"}},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:'<GeocodeRequest returnFreeForm="__RETURNFREEFORM__">__ADDRESS__</GeocodeRequest>',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<a.length;l++){var c=a[l];if(r[c]){var h=s.serviceAttributes[l];s.placeAttributes[h]=r[c]}}var u=s.placeAttributes;for(var d in u)u.hasOwnProperty(d)&&(i.filter[d]=u[d])}}}if(this.oAddress=new e(i),!this.oAddress)throw new Error("La construction de l'adresse n'est pas correctement definie !?")}return t=t.replace(/__ADDRESS__/g,this.oAddress.toString()),t=t.replace(/__RETURNFREEFORM__/g,this.options.returnFreeForm?"true":"false"),this.strRequest=t,this.strRequest}},n}(i,V,Y),X=function(t){function e(t){if(!(this instanceof e))throw new TypeError("Position constructor cannot be called as a function.");if(this.options=t||{},!t.position)throw new Error("l'option 'position' n'est pas renseignée !");for(var i in t)t.hasOwnProperty(i)&&(this.options[i]=t[i])}return e.prototype={constructor:e,requestString:null,template:{position:"<Position>__GMLPOINT____GMLFILTER__</Position>",gml:{point:'<gml:Point xmlns:gml="http://www.opengis.net/gml"><gml:pos>__X__ __Y__</gml:pos></gml:Point>',pos:null,filter:{bbox:'<gml:Envelope xmlns:gml="http://www.opengis.net/gml"><gml:lowerCorner>__LEFT__ __BOTTOM__</gml:lowerCorner><gml:upperCorner>__RIGHT__ __TOP__</gml:upperCorner></gml:Envelope>',circle:'<gml:CircleByCenterPoint xmlns:gml="http://www.opengis.net/gml"><gml:pos>__X__ __Y__</gml:pos><gml:radius>__RADIUS__</gml:radius></gml:CircleByCenterPoint>',polygon:'<gml:Polygon xmlns:gml="http://www.opengis.net/gml"><gml:exterior><gml:LinearRing><gml:posList>__XY__</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon>',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<r.length;a++){var l=r[a];if(Array.isArray(l))break;(l.x&&l.y||0===l.x||0===l.y)&&(s+=l.x+" "+l.y),r.length!==a+1&&(s+=" ")}i=i.replace(/__XY__/g,s);break;case"multipolygon":}}return t=t.replace(/__GMLPOINT__/g,e),t=t.replace(/__GMLFILTER__/g,i),this.requestString=t,this.requestString},e}(i),Z=function(t){function e(t){if(!(this instanceof e))throw new TypeError("Preference constructor cannot be called as a function.");this.type=t}return e.prototype={constructor:e,requestString:null,template:"<ReverseGeocodePreference>__TYPE__</ReverseGeocodePreference>"},e.prototype.toString=function(){for(var t=[],e="",i=0;i<this.type.length;i++)e=this.template,e=e.replace(/__TYPE__/g,this.type[i]),t.push(e);return this.strRequest=t.join("\n"),this.strRequest},e}(i),Q=function(t,e,i){function n(t){if(!(this instanceof n))throw new TypeError("ReverseGeocodeRequest 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="ReverseGeocodeRequest"}return n.prototype={strRequest:null,oPosition:null,oPreference:null,constructor:n,template:'<ReverseGeocodeRequest returnFreeForm="__RETURNFREEFORM__">__POSITION____PREFERENCE__</ReverseGeocodeRequest>',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;n<i.length;n++){var o=i[n];e[o.nodeName]=o.nodeValue}return e}}function r(t,e){if(t.hasChildNodes())for(var i,n,o,s=t.childNodes,a=0;a<s.length;a++)if(i=s[a],1===i.nodeType)if(n=i.localName||i.baseName||i.nodeName,o=i.prefix||c.DEFAULTPREFIX,c.READERS[o][n]){var l=c.READERS[o][n];l(i,e)}else r(i,e)}function a(t){var e,i="";return t.hasChildNodes()&&(e=t.firstChild,3===e.nodeType&&(i=e.nodeValue)),i}function l(t){if(t.attributes.length>0){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;o<n.length;o++)i=n[o],"Exception"===i.nodeName&&(e.exceptionReport=c.READERS.Exception(i));return e},Exception:function(t){var e={},i=t.getAttribute("exceptionCode");i&&(e.exceptionCode=i);var n=t.firstChild;return n&&3===n.nodeType&&(e.exception=n.nodeValue),e}},c.read=function(t){if("XLS"===t.nodeName){var n=t.prefix;n||(n=c.DEFAULTPREFIX);var o=c.READERS[n][t.nodeName](t);return o}if("ExceptionReport"===t.nodeName){var s=c.READERS[t.nodeName](t);return s}var r=e.getMessage("SERVICE_RESPONSE_ANALYSE",t.nodeName);throw new i({message:r,type:i.TYPE_UNKERR,status:200})},c}(i,r,a,st,at),ct=function(t,e,i,n,o){var s={build:function(t){var s=null;if(!t.response)return void t.onError.call(t.scope,new e({message:i.getMessage("SERVICE_RESPONSE_EMPTY"),type:e.TYPE_SRVERR,status:-1}));if(t.rawResponse)s=t.response;else{try{var r=new n({reader:o});if("string"==typeof t.response?r.setXMLString(t.response):r.setXMLDoc(t.response),s=r.parse(),!s)throw new Error("L'analyse de la réponse du service !?")}catch(n){var a=n.message;return a+="string"==typeof t.response?"('"+t.response+"')":"('"+t.response.documentElement.innerHTML+"')",void t.onError.call(t.scope,new e({message:i.getMessage("SERVICE_RESPONSE_ANALYSE",a),type:e.TYPE_UNKERR,status:-1}))}if(s.exceptionReport)return void t.onError.call(t.scope,new e({message:i.getMessage("SERVICE_RESPONSE_EXCEPTION",s.exceptionReport),type:e.TYPE_SRVERR,status:200}))}t.onSuccess.call(t.scope,s)}};return s}(i,a,r,y,lt),ht=function(t,e,i,n,o,s){function r(t){if(!(this instanceof r))throw new TypeError(e.getMessage("CLASS_CONSTRUCTOR","Geocode"));if(this.CLASSNAME="Geocode",n.apply(this,arguments),!t.location)throw new Error(e.getMessage("PARAM_MISSING","location"));if("object"==typeof t.location&&0===Object.keys(t.location).length)throw new Error(e.getMessage("PARAM_EMPTY","location"));if("string"==typeof t.location&&0===t.location.length)throw new Error(e.getMessage("PARAM_EMPTY","location"));this.options.location=t.location,t.filterOptions&&"object"==typeof t.filterOptions||(this.options.filterOptions=t.filterOptions={type:["StreetAddress"]}),0===Object.keys(t.filterOptions).length&&(this.options.filterOptions={type:["StreetAddress"]});for(var i=Object.keys(t.filterOptions),o=0;o<i.length;o++){var s=i[o],a=["department","number","postalCode","insee","importance","ID","IDTR","absorbedCity","sheet","section","inseeRegion","inseeDepartment"];a.indexOf(s)!==-1&&"string"!=typeof t.filterOptions[s]&&(t.filterOptions[s]=t.filterOptions[s].toString()),t.filterOptions[s]||delete this.options.filterOptions[s]}this.options.filterOptions.type=t.filterOptions.type||["StreetAddress"],this.options.maximumResponses=t.maximumResponses||25,this.options.returnFreeForm=t.returnFreeForm||!1,this.options.srs=t.srs||"EPSG:4326",this.options.outputFormat="xml"}return r.prototype=Object.create(n.prototype,{}),r.prototype.constructor=r,r.prototype.buildRequest=function(t,n){var s={httpMethod:this.options.httpMethod,location:this.options.location,returnFreeForm:this.options.returnFreeForm,filterOptions:this.options.filterOptions,srs:this.options.srs,maximumResponses:this.options.maximumResponses};this.request=o.build(s),this.request?n.call(this,this.request):t.call(this,new i(e.getMessage("SERVICE_REQUEST_BUILD")))},r.prototype.analyzeResponse=function(t,n){if(this.response){var o={response:this.response,rawResponse:this.options.rawResponse,onError:t,onSuccess:n,scope:this};s.build(o)}else t.call(this,new i(e.getMessage("SERVICE_RESPONSE_EMPTY")))},r}(i,r,a,u,ot,ct),ut=function(t,e,i){var n={build:function(t){var n=t||{},o=null,s=new i({position:n.position,returnFreeForm:n.returnFreeForm,filterOptions:n.filterOptions}),r=new e({srsName:n.srs,maximumResponses:n.maximumResponses});if(r.namespace=!0,r.setService(s),o=r.build(),"GET"==n.httpMethod){var a="qxml="+encodeURIComponent(o).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");o=a}return o}};return n}(i,H,J),dt=function(t){function e(){if(!(this instanceof e))throw new TypeError("ReverseGeocodedLocation constructor cannot be called as a function.");t.apply(this,arguments),this.CLASSNAME="ReverseGeocodedLocation",this.searchCenterDistance=null}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}(rt),pt=function(t,e,i,n,o){function s(t){if(t.attributes.length>0){for(var e={},i=t.attributes,n=0;n<i.length;n++){var o=i[n];e[o.nodeName]=o.nodeValue}return e}}function r(t,e){if(t.hasChildNodes())for(var i,n,o,s=t.childNodes,a=0;a<s.length;a++)if(i=s[a],1===i.nodeType)if(n=i.localName||i.baseName||i.nodeName,o=i.prefix||c.DEFAULTPREFIX,c.READERS[o][n]){var l=c.READERS[o][n];l(i,e)}else r(i,e)}function a(t){var e,i="";return t.hasChildNodes()&&(e=t.firstChild,3===e.nodeType&&(i=e.nodeValue)),i}function l(t){if(t.attributes.length>0){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<n.length;o++)i=n[o],"Exception"===i.nodeName&&(e.exceptionReport=c.READERS.Exception(i));return e},Exception:function(t){var e={},i=t.getAttribute("exceptionCode");i&&(e.exceptionCode=i);var n=t.firstChild;return n&&3===n.nodeType&&(e.exception=n.nodeValue),e}},c.read=function(t){if("XLS"===t.nodeName){var e=t.prefix;e||(e=c.DEFAULTPREFIX);var i=c.READERS[e][t.nodeName](t);return i}if("ExceptionReport"===t.nodeName){var n=c.READERS[t.nodeName](t);return n}throw new Error("Erreur lors de la lecture de la réponse : elle n'est pas au format attendu.")},c}(i,r,a,st,dt),mt=function(t,e,i,n,o){var s={build:function(t){var s=null;if(!t.response)return void t.onError.call(t.scope,new i({message:e.getMessage("SERVICE_RESPONSE_EMPTY"),type:i.TYPE_SRVERR,status:-1}));if(t.rawResponse)s=t.response;else{try{var r=new n({reader:o});if("string"==typeof t.response?r.setXMLString(t.response):r.setXMLDoc(t.response),s=r.parse(),!s)throw new Error("L'analyse de la réponse du service !?")}catch(e){return e.status=200,void t.onError.call(t.scope,e)}if(s.exceptionReport)return void t.onError.call(t.scope,new i({message:e.getMessage("SERVICE_RESPONSE_EXCEPTION",s.exceptionReport),type:i.TYPE_SRVERR,status:200}));if(t.scope&&t.scope.options&&t.scope.options.srs&&"EPSG:4326"!==t.scope.options.srs){var a,l;if(s||s.locations||s.locations.length)for(var c=0;c<s.locations.length;c++)a=s.locations[c],a&&(l=a.position,l&&(a.position={x:l.y,y:l.x}))}}t.onSuccess.call(t.scope,s)}};return s}(i,r,a,y,pt),ft=function(t,e,i,n,o,s){function r(t){if(!(this instanceof r))throw new TypeError(e.getMessage("CLASS_CONSTRUCTOR","ReverseGeocode"));if(this.CLASSNAME="ReverseGeocode",n.apply(this,arguments),!t.position)throw new Error(e.getMessage("PARAM_MISSING","position"));if(null==t.position.x)throw new Error(e.getMessage("PARAM_MISSING","position.x"));if(null==t.position.y)throw new Error(e.getMessage("PARAM_MISSING","position.y"));this.options.position=t.position,t.filterOptions&&"object"==typeof t.filterOptions||(this.options.filterOptions=t.filterOptions={type:["StreetAddress"]}),0===Object.keys(t.filterOptions).length&&(this.options.filterOptions={type:["StreetAddress"]});for(var i=Object.keys(t.filterOptions),o=0;o<i.length;o++){var s=i[o];t.filterOptions[s]&&0!==Object.keys(t.filterOptions[s]).length||delete this.options.filterOptions[s]}if(this.options.filterOptions.type=t.filterOptions.type||["StreetAddress"],!Array.isArray(this.options.filterOptions.type))throw new Error(e.getMessage("PARAM_TYPE","filterOptions.type"));if(this.options.maximumResponses=t.maximumResponses||25,this.options.returnFreeForm=t.returnFreeForm||!1,this.options.srs=t.srs||"CRS:84",r.geoEPSG.indexOf(this.options.srs)===-1){
       
   141 if(this.options.position={x:this.options.position.y,y:this.options.position.x},this.options.filterOptions&&this.options.filterOptions.circle){var a=this.options.filterOptions.circle;this.options.filterOptions.circle={x:a.y,y:a.x,radius:a.radius}}if(this.options.filterOptions&&this.options.filterOptions.polygon){var l=this.options.filterOptions.polygon;for(o=0;o<l.length;o++){var c=l[o];this.options.filterOptions.polygon[o]={x:c.y,y:c.x}}}}this.options.outputFormat="xml"}return r.prototype=Object.create(n.prototype,{}),r.prototype.constructor=r,r.prototype.buildRequest=function(t,n){var s={httpMethod:this.options.httpMethod,position:this.options.position,returnFreeForm:this.options.returnFreeForm,filterOptions:this.options.filterOptions,srs:"EPSG:4326",maximumResponses:this.options.maximumResponses};this.request=o.build(s),this.request?n.call(this,this.request):t.call(this,new i(e.getMessage("SERVICE_REQUEST_BUILD")))},r.prototype.analyzeResponse=function(t,n){if(this.response){var o={response:this.response,rawResponse:this.options.rawResponse,onError:t,onSuccess:n,scope:this};s.build(o)}else t.call(this,new i(e.getMessage("SERVICE_RESPONSE_EMPTY")))},r.geoEPSG=["EPSG:4326"],r}(i,r,a,u,ut,mt),_t=function(){function t(){if(!(this instanceof t))throw new TypeError("AutoCompleteResponse constructor cannot be called as a function.");this.suggestedLocations=[]}return t.prototype={constructor:t},t}(),gt=function(){function t(){if(!(this instanceof t))throw new TypeError("SuggestedLocation constructor cannot be called as a function.");this.type=null,this.position={x:null,y:null},this.commune=null,this.fullText=null,this.postalCode=null,this.classification=null,this.street=null,this.poi=null,this.kind=null}return t.prototype={constructor:t},t}(),vt=function(t,e,i,n,o,s){var r={build:function(t){var n=null;if(!t.response)return void t.onError.call(t.scope,new e(i.getMessage("SERVICE_RESPONSE_EMPTY")));if(t.rawResponse)n=t.response;else{var r;if(r="string"==typeof t.response?window.JSON.parse(t.response):t.response){if(r.error)return void t.onError.call(t.scope,new e({message:i.getMessage("SERVICE_RESPONSE_EXCEPTION",r.error.description),status:r.error.code,type:e.TYPE_SRVERR}));if(n=new o,!r.results||!Array.isArray(r.results))return void t.onError.call(t.scope,new e(i.getMessage("SERVICE_RESPONSE_FORMAT_3")));for(var a,l=0;l<r.results.length;l++){var c=r.results[l];a=new s,a&&(c&&"StreetAddress"===c.country?(a.street=c.street,a.type="StreetAddress"):c&&"PositionOfInterest"===c.country&&(a.poi=c.street,a.kind=c.kind,a.type="PositionOfInterest"),a.position&&(a.position.x=c.x,a.position.y=c.y),a.commune=c.city,a.fullText=c.fulltext,a.postalCode=c.zipcode,a.classification=c.classification),n.suggestedLocations.push(a)}if(!n.suggestedLocations.length)return void t.onError.call(t.scope,new e(i.getMessage("SERVICE_RESPONSE_FORMAT_3")))}if(!n)return void t.onError.call(t.scope,new e({message:i.getMessage("SERVICE_RESPONSE_ANALYSE_2"),type:e.TYPE_UNKERR,status:-1}));if(n.exceptionReport)return void t.onError.call(t.scope,new e({message:i.getMessage("SERVICE_RESPONSE_EXCEPTION",n.exceptionReport),type:e.TYPE_SRVERR,status:200}))}t.onSuccess.call(t.scope,n)}};return r}(i,a,r,y,_t,gt),yt=function(t,e,i,n,o,s){function r(e){if(!(this instanceof r))throw new TypeError(n.getMessage("CLASS_CONSTRUCTOR","AutoComplete"));if(this.CLASSNAME="AutoComplete",t.apply(this,arguments),!e.text)throw new Error(n.getMessage("PARAM_MISSING","text"));this.options.text=e.text,e.filterOptions&&"object"==typeof e.filterOptions||(this.options.filterOptions=e.filterOptions={territory:[],type:["StreetAddress"]}),0===Object.keys(e.filterOptions).length&&(this.options.filterOptions={territory:[],type:["StreetAddress"]}),this.options.filterOptions.type=e.filterOptions.type||["StreetAddress"],this.options.filterOptions.territory=e.filterOptions.territory||[],this.options.maximumResponses=e.maximumResponses||10,"XHR"===this.options.protocol&&"POST"===this.options.httpMethod&&(this.options.httpMethod="GET"),this.options.outputFormat="json"}return r.prototype=Object.create(t.prototype,{}),r.prototype.constructor=r,r.prototype.buildRequest=function(t,e){var i="";this.options.filterOptions.territory&&(i=this.options.filterOptions.territory.join(";"));var n="";this.options.filterOptions.type&&(n=this.options.filterOptions.type.join(",")),this.request=s.normalyzeParameters({text:encodeURIComponent(this.options.text),type:n,terr:i,maximumResponses:this.options.maximumResponses}),e.call(this,this.request)},r.prototype.analyzeResponse=function(t,i){if(this.response){var s={response:this.response,rawResponse:this.options.rawResponse,onSuccess:i,onError:t,scope:this};e.build(s)}else t.call(this,new o(n.getMessage("SERVICE_RESPONSE_EMPTY")))},r}(u,vt,i,r,a,n),Et=function(t){function e(t){if(!(this instanceof e))throw new TypeError("RoutePlan constructor cannot be called as a function.");if(this.options=t||{},!t.startPoint)throw new Error("l'option 'startPoint' n'est pas renseignée !");if(!t.endPoint)throw new Error("l'option 'endPoint' n'est pas renseignée !");for(var i in t)t.hasOwnProperty(i)&&(this.options[i]=t[i])}return e.prototype={constructor:e,requestString:null,template:{routePlan:"<RoutePlan>__ROUTEPREFERENCE____GRAPH____WAYPOINTLIST____AVOIDLIST__</RoutePlan>",routePreference:"<RoutePreference>__VALUEROUTEPREFERENCE__</RoutePreference>",graph:'<xlsext:graphName xmlns:xlsext="http://www.opengis.net/xlsext" name="__VALUEGRAPH__"/>',wayPointList:{container:"<WayPointList>__STARTPOINT____VIAPOINT____ENDPOINT__</WayPointList>",point:'<Position><gml:Point xmlns:gml="http://www.opengis.net/gml"><gml:pos>__X__ __Y__</gml:pos></gml:Point></Position>',startPoint:"<StartPoint>__POINT__</StartPoint>",endPoint:"<EndPoint>__POINT__</EndPoint>",viaPoint:"<ViaPoint>__POINT__</ViaPoint>"},avoidList:{container:"<AvoidList>__AVOIDFEATURE__</AvoidList>",avoidFeature:"<AvoidFeature>__VALUEAVOIDFEATURE__</AvoidFeature>"}},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<this.options.avoidFeature.length;o++){var s=this.template.avoidList.avoidFeature;s=s.replace(/__VALUEAVOIDFEATURE__/,this.options.avoidFeature[o]),n.push(s)}i=i.replace(/__AVOIDFEATURE__/,n.join("\n")),t=t.replace(/__AVOIDLIST__/g,i)}if(t=t.replace(/__AVOIDLIST__/g,""),this.options.graph){var r=this.template.graph;r=r.replace(/__VALUEGRAPH__/,this.options.graph),t=t.replace(/__GRAPH__/g,r)}t=t.replace(/__GRAPH__/g,"");var a=this.template.wayPointList.container,l="";if(l=this.template.wayPointList.point,l=l.replace(/__X__/,this.options.startPoint.x),l=l.replace(/__Y__/,this.options.startPoint.y),a=a.replace(/__STARTPOINT__/,this.template.wayPointList.startPoint.replace(/__POINT__/,l)),l=this.template.wayPointList.point,l=l.replace(/__X__/,this.options.endPoint.x),l=l.replace(/__Y__/,this.options.endPoint.y),a=a.replace(/__ENDPOINT__/,this.template.wayPointList.endPoint.replace(/__POINT__/,l)),this.options.viaPoint){for(var c=[],h=0;h<this.options.viaPoint.length;h++){var u=this.options.viaPoint[h];l=this.template.wayPointList.point,l=l.replace(/__X__/,u.x),l=l.replace(/__Y__/,u.y),c.push(l)}a=a.replace(/__VIAPOINT__/,this.template.wayPointList.viaPoint.replace(/__POINT__/,c.join("\n")))}else a=a.replace(/__VIAPOINT__/,"");return t=t.replace(/__WAYPOINTLIST__/g,a),this.requestString=t,this.requestString}},e}(i),Pt=function(t,e){function i(t){if(!(this instanceof i))throw new TypeError("DetermineRouteRequest 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="DetermineRouteRequest"}return i.prototype={strRequest:null,oRoutePlan:null,template:{determineRouteRequest:'<DetermineRouteRequest distanceUnit="__DISTANCEUNIT__">__ROUTEPLAN____ROUTEINSTRUCTIONREQUEST____ROUTEGEOMETRYREQUEST____ROUTEMAPREQUEST__</DetermineRouteRequest>',routeInstructionRequest:'<RouteInstructionsRequest provideGeometry="__PROVIDEGEOMETRY__" provideBoundingBox="__PROVIDEBBOX__" />',routeGeometryRequest:"<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<this.waypoints.length;e++){var i=this.waypoints[e];t.push(i.x+","+i.y)}return t.join(";")}},getExclusions:function(){return this.exclusions.join(";")}},e.prototype.getParams=function(){var t=[];return t.push({k:"origin",v:this.origin}),t.push({k:"destination",v:this.destination}),t.push({k:"method",v:this.method}),this.waypoints&&t.push({k:"waypoints",v:this.getWaypoints()}),this.startDateTime&&t.push({k:"startDateTime",v:this.startDateTime}),this.graphName&&t.push({k:"graphName",v:this.graphName}),this.exclusions&&t.push({k:"exclusions",v:this.getExclusions()}),this.srs&&t.push({k:"srs",v:this.srs}),this.format&&t.push({k:"format",v:this.format}),t},e}(i),Lt=function(t,e,i){function n(t){if(!(this instanceof n))throw new TypeError("RouteRequestREST constructor cannot be called as a function.");if(!t)throw new Error(e.getMessage("PARAM_EMPTY","options"));this.settings=t}return n.prototype={requestString:null,constructor:n,processRequestString:function(){for(var t=new i(this.settings),e=t.getParams(),n="",o=0;o<e.length;o++){var s=e[o];n&&(n+="&"),n+=s.k+"="+s.v}return this.requestString=n,this.requestString}},n}(i,r,wt),Rt=function(t,e,i,n){var o={build:function(t){var o=null,s=t||{},r=null!==t.onError&&"function"==typeof t.onError,a=null;switch(t.api){case"REST":var l=new n(s);if(!l.processRequestString()){if(a="Error process request (rest) !",r)return void t.onError.call(t.scope,new e(a));throw new Error(a)}o=l.requestString;break;case"OLS":if(o=i.build(s),!o){if(a="Error process request (ols) !",r)return void t.onError.call(t.scope,new e(a));throw new Error(a)}break;default:if(a="Type of API is not supported by service (REST or OLS) !",r)return void t.onError.call(t.scope,new e(a));throw new Error(a)}return o}};return o}(i,a,Mt,Lt),bt=function(t){var e={toJson:function(t,e,i){var n=null;try{if(!t)throw new Error("La chaine WKT n'est pas renseignée !");e||(e=function(t){console.log(t)}),i||(i=function(t){console.log(t)});var o,s,r;if(o=/(-?\d+\.?[0-9]*)\s(-?\d+\.?[0-9]+)/g,s="[$1,$2]",t=t.replace(o,s),o=/^(\w+)/,r=o.exec(t),"POLYGON"===RegExp.$1?(s='{"type" : "Polygon",',t=t.replace(RegExp.$1,s),o=/(\({2}?)/,s='"coordinates" : [[',t=t.replace(o,s),o=/(\){2}?)/,s="]]}",t=t.replace(o,s),o=/(\()/g,s="[",t=t.replace(o,s),o=/(\))/g,s="]",t=t.replace(o,s)):"LINESTRING"===RegExp.$1&&(s='{"type" : "LineString",',t=t.replace(RegExp.$1,s),o=/(\(\(?)/,s='"coordinates" : [',t=t.replace(o,s),o=/(\)\)?)/,s="]}",t=t.replace(o,s)),n=JSON.parse(t),!n)throw new Error("Le JSON est vide !");if(!n.type)throw new Error("Le type de geometrie n'est pas connu !");if(!n.coordinates)throw new Error("La liste des points est vide !");e.call(this,n)}catch(t){if("SyntaxError"===t.name)return void i.call(this,"Erreur de parsing JSON !");i.call(this,t)}}};return e}(i),xt=function(){function t(){if(!(this instanceof t))throw new TypeError("RouteResponse constructor cannot be called as a function.");this.totalTime=null,this.totalDistance=null,this.bbox={left:null,right:null,top:null,bottom:null},this.routeGeometry=null,this.routeInstructions=[]}return t.prototype={constructor:t},t}(),Gt=function(){function t(){if(!(this instanceof t))throw new TypeError("RouteInstruction constructor cannot be called as a function.");this.duration=null,this.distance=null,this.code=null,this.instruction=null,this.geometry=null}return t.prototype={constructor:t},t}(),It=function(t,e,i,n,o,s){function r(t){var e,i="";return t.hasChildNodes()&&(e=t.firstChild,e&&3===e.nodeType&&(i=e.nodeValue)),i}function a(t,e){if(t.hasChildNodes())for(var i,n,o=t.childNodes,s=0;s<o.length;s++)if(i=o[s],1===i.nodeType)if(n=i.localName||i.baseName||i.nodeName,l.READERS[n]){var r=l.READERS[n];r(i,e)}else a(i,e)}var l={};return l.READERS={routeResult:function(t){var e=new o;if(a(t,e),"error"===e.status){var s=i.getMessage("SERVICE_RESPONSE_EXCEPTION",e.message);throw new n({message:s,type:n.TYPE_SRVERR})}return e},status:function(t,e){var i=r(t);"ERROR"!==i&&"error"!==i||e&&(e.status="error")},message:function(t,e){e&&(e.message=r(t))},distance:function(t,e){e&&(e.totalDistance=r(t))},durationSeconds:function(t,e){e&&(e.totalTime=parseFloat(r(t)))},bounds:function(t,e){if(e&&e.bbox){var i=r(t).split(/[,;]/);e.bbox.left=parseFloat(i[0]),e.bbox.bottom=parseFloat(i[1]),e.bbox.right=parseFloat(i[2]),e.bbox.top=parseFloat(i[3])}},geometryWkt:function(t,n){if(n){var o=t.innerHTML,s=function(t){n.routeGeometry=t},r=function(){var t=i.getMessage("PARAM_FORMAT",["geometryWkt"]);throw new Error(t)};e.toJson(o,s,r)}},step:function(t,e){var i,n=new s;if(t.hasChildNodes)for(var o,a,l=t.childNodes,c=0;c<l.length;c++)o=l[c],1===o.nodeType&&(a=o.localName||o.baseName||o.nodeName,"durationSeconds"===a?n.duration=r(o):"distance"===a?n.distance=r(o):"navInstruction"===a?n.code=r(o):"name"===a&&(i=r(o)));if(n.code)switch(n.code){case"F":"Valeur non renseignée"!=i?n.instruction="Tout droit "+i:n.instruction="Continuer tout droit ";break;case"B":n.instruction="Demi-tour "+i;break;case"L":n.instruction="Tourner à gauche "+i;break;case"R":n.instruction="Tourner à droite "+i;break;case"BL":n.instruction="Tourner très à gauche "+i;break;case"BR":n.instruction="Tourner très à droite "+i;break;case"FL":n.instruction="Tourner légèrement à gauche "+i;break;case"FR":n.instruction="Tourner légèrement à droite "+i;break;case"round_about_entry":n.instruction="Entrée rond-point "+i;break;case"round_about_exit":n.instruction="Sortie rond-point "+i;break;case null:n.instruction="Prendre "+i;break;default:n.instruction="?"+n.code+"? "+i}Array.isArray(e.routeInstructions)&&e.routeInstructions.push(n)}},l.read=function(t){var e;if("routeResult"===t.nodeName)return e=l.READERS.routeResult(t);throw new Error("Erreur lors de la lecture de la réponse : elle n'est pas au format attendu.")},l}(i,bt,r,a,xt,Gt),At=function(t){var e={};return e.READERS={},e.read=function(t){},e}(i),Tt=function(t,e,i,n,o,s,r,a,l){var c={build:function(t){var c=null;if(!t.response)return void t.onError.call(t.scope,new e(o.getMessage("SERVICE_RESPONSE_EMPTY")));if(t.rawResponse)c=t.response;else{switch(t.outputFormat){case"xml":var h="REST"===t.api?s:r;try{var u=new i({reader:h});if("string"==typeof t.response?u.setXMLString(t.response):u.setXMLDoc(t.response),c=u.parse(),!c)throw new e(o.getMessage("SERVICE_RESPONSE_FORMAT","xml"))}catch(i){return void t.onError.call(t.scope,new e(o.getMessage("SERVICE_RESPONSE_ANALYSE",t.response)))}break;case"json":var d;if(d="string"==typeof t.response?window.JSON.parse(t.response):t.response,d.message)return void t.onError.call(t.scope,new e(o.getMessage("SERVICE_RESPONSE_EXCEPTION",d.message)));if(d){var p=[],m=[],f=[];if(c=new a,c.hasOwnProperty("totalTime")&&(c.totalTime=parseFloat(d.durationSeconds)),c.hasOwnProperty("totalDistance")&&(c.totalDistance="m"===t.distanceUnit?d.distanceMeters:d.distance),c.hasOwnProperty("bbox")){var _=d.bounds.split(/[,;]/);c.bbox.left=parseFloat(_[0]),c.bbox.bottom=parseFloat(_[1]),c.bbox.right=parseFloat(_[2]),c.bbox.top=parseFloat(_[3])}var g=function(t){c.routeGeometry=t},v=function(i){console.log(i),t.onError.call(t.scope,new e(o.getMessage("PARAM_FORMAT",["geometryWkt"])))};if(c.hasOwnProperty("routeGeometry")){var y=d.geometryWkt||d.simplifiedWkt;if(y&&(n.toJson(y,g,v),!c.routeGeometry))return}if(c.hasOwnProperty("routeInstructions")){var E,P=d.legs;if(Array.isArray(P)&&P.length)for(E=0;E<P.length;E++)p.push(P[E]);if(Array.isArray(p)&&p.length)for(E=0;E<p.length;E++)m.push(p[E].steps);if(Array.isArray(m)&&m.length)for(E=0;E<m.length;E++)f=f.concat(m[E]);f.forEach(function(e){c.routeInstructions.push(new l),c.routeInstructions[c.routeInstructions.length-1].duration=e.durationSeconds,c.routeInstructions[c.routeInstructions.length-1].distance="m"===t.distanceUnit?e.distanceMeters:e.distance,c.routeInstructions[c.routeInstructions.length-1].code=e.navInstruction;for(var i=[],n=0;n<e.points.length;n++){var o=e.points[n].split(",");o&&i.push(o)}switch(i&&0!==i.length?c.routeInstructions[c.routeInstructions.length-1].geometry={coordinates:i,type:"LineString"}:c.routeInstructions[c.routeInstructions.length-1].geometry=null,"Valeur non renseignée"==e.name&&(e.name=""),e.navInstruction){case"F":e.name?c.routeInstructions[c.routeInstructions.length-1].instruction="Tout droit "+e.name:c.routeInstructions[c.routeInstructions.length-1].instruction="Continuer tout droit ";break;case"B":c.routeInstructions[c.routeInstructions.length-1].instruction="Demi-tour "+e.name;break;case"L":c.routeInstructions[c.routeInstructions.length-1].instruction="Tourner à gauche "+e.name;break;case"R":c.routeInstructions[c.routeInstructions.length-1].instruction="Tourner à droite "+e.name;break;case"BL":c.routeInstructions[c.routeInstructions.length-1].instruction="Tourner très à gauche "+e.name;break;case"BR":c.routeInstructions[c.routeInstructions.length-1].instruction="Tourner très à droite "+e.name;break;case"FL":c.routeInstructions[c.routeInstructions.length-1].instruction="Tourner légèrement à gauche "+e.name;break;case"FR":c.routeInstructions[c.routeInstructions.length-1].instruction="Tourner légèrement à droite "+e.name;break;case"round_about_entry":c.routeInstructions[c.routeInstructions.length-1].instruction="Entrée rond-point "+e.name;break;case"round_about_exit":c.routeInstructions[c.routeInstructions.length-1].instruction="Sortie rond-point "+e.name;break;case null:c.routeInstructions[c.routeInstructions.length-1].instruction="Prendre tout droit "+e.name;break;default:c.routeInstructions[c.routeInstructions.length-1].instruction="?"+e.navInstruction+"? "+e.name}})}}if(!c)return void t.onError.call(t.scope,new e(o.getMessage("SERVICE_RESPONSE_ANALYSE","json")));break;default:return void t.onError.call(t.scope,new e(o.getMessage("SERVICE_RESPONSE_FORMAT","json","xml")))}if(c&&c.exceptionReport)return void t.onError.call(t.scope,new e(o.getMessage("SERVICE_RESPONSE_EXCEPTION_2")))}t.onSuccess.call(t.scope,c)}};return c}(i,a,y,bt,r,It,At,xt,Gt),kt=function(t,e,i,n,o,s,r){function a(t){if(!(this instanceof a))throw new TypeError(e.getMessage("CLASS_CONSTRUCTOR","Route"));if(this.CLASSNAME="Route",n.apply(this,arguments),!t.startPoint)throw new Error(e.getMessage("PARAM_MISSING","startPoint"));if(null==t.startPoint.x)throw new Error(e.getMessage("PARAM_MISSING","startPoint.x"));if(null==t.startPoint.y)throw new Error(e.getMessage("PARAM_MISSING","startPoint.y"));if(!t.endPoint)throw new Error(e.getMessage("PARAM_MISSING","endPoint"));if(null==t.endPoint.x)throw new Error(e.getMessage("PARAM_MISSING","endPoint.x"));if(null==t.endPoint.y)throw new Error(e.getMessage("PARAM_MISSING","endPoint.y"));if(this.options.api="string"==typeof t.api?t.api.toUpperCase():"REST",this.options.outputFormat="string"==typeof t.outputFormat?t.outputFormat.toLowerCase():"json",this.options.startPoint=t.startPoint,this.options.endPoint=t.endPoint,this.options.viaPoints=t.viaPoints||null,this.options.exclusions=t.exclusions||null,this.options.routePreference=t.routePreference||"fastest",this.options.graph=t.graph||"Voiture",this.options.geometryInInstructions=t.geometryInInstructions||!1,this.options.provideBbox=t.provideBbox||!0,this.options.distanceUnit=t.distanceUnit||"km",this.options.expectedStartTime=null,this.options.srs=t.srs||"EPSG:4326",this.options.api="REST","XHR"===this.options.protocol&&(this.options.httpMethod="GET"),!this.options.serverUrl){var i=o.Route.url(this.options.apiKey),s=null;switch(this.options.api){case"OLS":s=i.ols;break;case"REST":var r="route-"+this.options.outputFormat;s=i[r];break;default:throw new Error(e.getMessage("PARAM_UNKNOWN","api"))}if(!s)throw new Error("Url by default not found !");this.options.serverUrl=s}var l=this.options.serverUrl.lastIndexOf(".");if(l!==-1){var c=this.options.serverUrl.substring(l+1);if(c&&c.length<5)switch(c.toLowerCase()){case"json":case"xml":this.options.outputFormat=c.toLowerCase();break;default:throw new Error("type of service : unknown or unsupported (json or xml) !")}}}return a.prototype=Object.create(n.prototype,{}),a.prototype.constructor=a,a.prototype.buildRequest=function(t,n){var o={api:this.options.api,startPoint:this.options.startPoint,endPoint:this.options.endPoint,viaPoints:this.options.viaPoints,provideBbox:this.options.provideBbox,exclusions:this.options.exclusions,distanceUnit:this.options.distanceUnit,graph:this.options.graph,geometryInInstructions:this.options.geometryInInstructions,routePreference:this.options.routePreference,srs:this.options.srs};this.request=s.build(o),this.request?n.call(this,this.request):t.call(this,new i(e.getMessage("SERVICE_REQUEST_BUILD")))},a.prototype.analyzeResponse=function(t,n){if(this.response){var o={distanceUnit:this.options.distanceUnit,response:this.response,outputFormat:this.options.outputFormat,api:this.options.api,rawResponse:this.options.rawResponse,onError:t,onSuccess:n,scope:this};r.build(o)}else t.call(this,new i(e.getMessage("SERVICE_RESPONSE_EMPTY")))},a}(i,r,a,u,h,Rt,Tt),Ot=function(t){function e(t){if(!(this instanceof e))throw new TypeError("ProcessIsoCurveParam constructor cannot be called as a function.");this.options=t||{},this.id=this.options.id,this.location=this.options.position,this.srs=this.options.srs,this.graphName=this.options.graph,this.profileId=this.options.profileId||null,this.profileName=this.options.profileName||null,this.exclusions=this.options.exclusions,this.reverse=this.options.reverse,this.smoothing=this.options.smoothing,this.holes=this.options.holes;var i=this.options.method;switch(i){case"time":this.method="time",this.time=this.options.time;break;case"distance":this.method="distance",this.distance=this.options.distance;break;default:this.method="time"}}return e.CLASSNAME="ProcessIsoCurveParam",e.prototype={constructor:e,getLocation:function(){return this.location.x+","+this.location.y},getExclusions:function(){return this.exclusions.join(";")}},e.prototype.getParams=function(){var t=[];return t.push({k:"location",v:this.getLocation()}),t.push({k:"smoothing",v:this.smoothing}),t.push({k:"holes",v:this.holes}),t.push({k:"reverse",v:this.reverse}),t.push({k:"method",v:this.method}),this.time&&t.push({k:"time",v:this.time}),this.distance&&t.push({k:"distance",v:this.distance}),t.push({k:"graphName",v:this.graphName}),this.exclusions&&t.push({k:"exclusions",v:this.getExclusions()}),this.srs&&t.push({k:"srs",v:this.srs}),t},e}(i),Dt=function(t,e,i){function n(t){if(!(this instanceof n))throw new TypeError("ProcessIsoCurveRequest constructor cannot be called as a function.");if(!t)throw new Error(e.getMessage("PARAM_EMPTY","options"));this.settings=t,this.mode=this.settings.httpMethod||"GET"}return n.prototype={requestString:null,constructor:n,template:{container:'<?xml version="1.0" encoding="UTF-8"?>\n<isochroneRequest>\n__ID__\t<location>\n\t\t<x>__X__</x>\n\t\t<y>__Y__</y>\n\t</location>\n\t<srs>__SRS__</srs>\n\t<graphName>__GRAPHNAME__</graphName>\n__PROFIL____EXCLUSIONS__\t<method>__METHOD__</method>\n__TIME____DISTANCE__\t<reverse>__REVERSE__</reverse>\n\t<smoothing>__SMOOTHING__</smoothing>\n\t<holes>__HOLES__</holes>\n</isochroneRequest>',id:"\t<id>__IDVALUE__</id>\n",profil:"\t<profileId>__PROFILID__</profileId>\n\t<profileName>__PROFILNAME__</profileName>\n",exclusions:{container:"\t<exclusions>\n__EXCLUSIONFEATURE__\n\t</exclusions>\n",feature:"\t\t<exclusion>__EXCLUSIONVALUE__</exclusion>"},time:"\t<time>__TIMEVALUE__</time>\n",distance:"\t<distance>__DISTANCEVALUE__</distance>\n"},processRequestString:function(){var t="",e=0;switch(this.mode){case"GET":var n=new i(this.settings),o=n.getParams();for(e=0;e<o.length;e++){var s=o[e];t&&(t+="&"),t+=s.k+"="+s.v}break;case"POST":if(t=this.template.container,t=t.replace(/__ID__/g,""),t=t.replace(/__PROFIL__/g,""),t=t.replace(/__X__/g,this.settings.position.x),t=t.replace(/__Y__/g,this.settings.position.y),t=t.replace(/__GRAPHNAME__/g,this.settings.graph),t=t.replace(/__SRS__/g,this.settings.srs),t=t.replace(/__SMOOTHING__/g,this.settings.smoothing),t=t.replace(/__HOLES__/g,this.settings.holes),t=t.replace(/__REVERSE__/g,this.settings.reverse),this.settings.exclusions){var r=this.template.exclusions.container,a=[];for(e=0;e<this.settings.exclusions.length;e++){var l=this.template.exclusions.feature;l=l.replace(/__EXCLUSIONVALUE__/,this.settings.exclusions[e]),a.push(l)}r=r.replace(/__EXCLUSIONFEATURE__/,a.join("\n")),t=t.replace(/__EXCLUSIONS__/g,r)}if(t=t.replace(/__EXCLUSIONS__/g,""),this.settings.distance){var c=this.template.distance;c=c.replace(/__DISTANCEVALUE__/g,this.settings.distance),t=t.replace(/__DISTANCE__/g,c),t=t.replace(/__METHOD__/g,"distance")}if(t=t.replace(/__DISTANCE__/g,""),this.settings.time){var h=this.template.time;h=h.replace(/__TIMEVALUE__/g,this.settings.time),t=t.replace(/__TIME__/g,h),t=t.replace(/__METHOD__/g,"time")}t=t.replace(/__TIME__/g,"")}return this.requestString=t,this.requestString}},n}(i,r,Ot),Nt=function(){function t(){if(!(this instanceof t))throw new TypeError("ProcessIsoCurveResponse constructor cannot be called as a function.");this.message=null,this.id=null,this.location={},this.location.x=null,this.location.y=null,this.srs=null,this.geometry=null,this.time=null,this.distance=null}return t.prototype={constructor:t},t}(),Ut=function(t,e,i,n,o){function s(t){var e,i="";return t.hasChildNodes()&&(e=t.firstChild,e&&3===e.nodeType&&(i=e.nodeValue)),i}var r={};return r.READERS={isochronResult:function(t){var e=new o;if(t.hasChildNodes())for(var s,a=t.childNodes,l=0;l<a.length;l++)s=a[l],r.READERS[s.nodeName]&&r.READERS[s.nodeName](s,e);if("error"===e.status){var c=n.getMessage("SERVICE_RESPONSE_EXCEPTION",e.message);throw new i({message:c,type:i.TYPE_SRVERR})}return e},message:function(t,e){e&&(e.message=s(t))},status:function(t,e){var i=s(t);"ERROR"!==i&&"error"!==i||e&&(e.status="error")},id:function(t,e){e&&(e.id=s(t))},location:function(t,e){var i=s(t);e&&e.location&&(e.location.x=parseFloat(i.split(",")[0]),e.location.y=parseFloat(i.split(",")[1]))},srs:function(t,e){e&&(e.srs=s(t))},distance:function(t,e){e&&(e.distance=parseFloat(s(t)))},time:function(t,e){e&&(e.time=parseFloat(s(t)))},wktGeometry:function(t,i){if(i){var o=t.innerHTML,s=function(t){i.geometry=t},r=function(){var t=n.getMessage("PARAM_FORMAT",["wktGeometry"]);throw new Error(t)};i.hasOwnProperty("geometry")&&e.toJson(o,s,r)}},serviceResult:function(t){var e={};if(t.hasChildNodes())for(var i,n=t.childNodes,o=0;o<n.length;o++)i=n[o],r.READERS[i.nodeName]&&r.READERS[i.nodeName](i,e);return e},ExceptionReport:function(t){var e={};if(t.hasChildNodes())for(var i,n=t.childNodes,o=0;o<n.length;o++)i=n[o],"Exception"===i.nodeName&&(e.exceptionReport=r.READERS.Exception(i));return e},Exception:function(t){var e={},i=t.getAttribute("exceptionCode");i&&(e.exceptionCode=i);var n=t.firstChild;return n&&3===n.nodeType&&(e.exception=n.nodeValue),e}},r.read=function(t){var e;if("isochronResult"===t.nodeName||"isochroneResult"===t.nodeName||"IsochroneResult"===t.nodeName)return e=r.READERS.isochronResult(t);if("ExceptionReport"===t.nodeName)return e=r.READERS[t.nodeName](t);if(r.READERS[t.nodeName]){if(e=r.READERS[t.nodeName](t),"error"===e.status){var o=n.getMessage("SERVICE_RESPONSE_EXCEPTION",e.message);throw new i({message:o,type:i.TYPE_SRVERR})}return e}throw new i({message:n.getMessage("SERVICE_RESPONSE_ANALYSE",t.nodeName),type:i.TYPE_UNKERR})},r}(i,bt,a,r,Nt),jt=function(t,e,i,n,o,s,r){var a={build:function(t){var a=null;if(!t.response)return void t.onError.call(t.scope,new e(i.getMessage("SERVICE_RESPONSE_EMPTY")));if(t.rawResponse)a=t.response;else{switch(t.outputFormat){case"xml":try{var l=new n({reader:s});if("string"==typeof t.response?l.setXMLString(t.response):l.setXMLDoc(t.response),
       
   142 a=l.parse(),!a)throw new Error(i.getMessage("SERVICE_RESPONSE_EXCEPTION_2"))}catch(n){var c=n.message;return c+="\n(raw response service : '"+t.response+"')",void t.onError.call(t.scope,new e({message:i.getMessage("SERVICE_RESPONSE_EXCEPTION",c),status:200,type:e.TYPE_SRVERR}))}break;case"json":var h;if(h="string"==typeof t.response?window.JSON.parse(t.response):t.response,"OK"===h.status||"ok"===h.status){if(a=new r,!a)return void t.onError.call(t.scope,new e(i.getMessage("SERVICE_RESPONSE_ANALYSE",t.response)));a.time=h.time,a.distance=h.distance,a.message=h.message,a.id=h.id,a.srs=h.srs;var u=function(t){a.geometry=t},d=function(){t.onError.call(t.scope,new e({message:i.getMessage("PARAM_FORMAT","wktGeometry")}))};if(a.hasOwnProperty("geometry")&&(o.toJson(h.wktGeometry,u,d),!a.geometry))return;var p=h.location.split(",");a.location&&(a.location.x=p[0],a.location.y=p[1])}else if("ERROR"===h.status||"error"===h.status){var m=h.message;return m+="\n(raw response service : '"+h+"')",void t.onError.call(t.scope,new e(i.getMessage("SERVICE_RESPONSE_EXCEPTION",m)))}break;default:return void t.onError.call(t.scope,new e(i.getMessage("SERVICE_RESPONSE_FORMAT","json","xml")))}if(a&&a.exceptionReport)return void t.onError.call(t.scope,new e({message:i.getMessage("SERVICE_RESPONSE_EXCEPTION",a.exceptionReport),type:e.TYPE_SRVERR,status:200}))}t.onSuccess.call(t.scope,a)}};return a}(i,a,r,y,bt,Ut,Nt),Ft=function(t,e,i,n,o,s,r){function a(t){if(!(this instanceof a))throw new TypeError(e.getMessage("CLASS_CONSTRUCTOR","ProcessIsoCurve"));if(this.CLASSNAME="ProcessIsoCurve",n.apply(this,arguments),!t.position)throw new Error(e.getMessage("PARAM_MISSING","position"));if(null==t.position.x)throw new Error(e.getMessage("PARAM_MISSING","position.x"));if(null==t.position.y)throw new Error(e.getMessage("PARAM_MISSING","position.y"));if(!t.time&&!t.distance)throw new Error("Parameter(s) 'distance' missing. Parameter time to calculate an isochrone, parameter distance for an isodistance");if(!t.time&&t.distance&&(this.options.method="distance",this.options.time&&delete this.options.time),t.time&&!t.distance&&(this.options.method="time",this.options.distance&&delete this.options.distance),this.options.method=this.options.method||"time",this.options.exclusions=t.exclusions||null,this.options.graph=t.graph||"Voiture",this.options.reverse=t.reverse||!1,this.options.smoothing=t.smoothing||!1,this.options.holes=t.holes||!1,this.options.srs=t.srs||"EPSG:4326",this.options.outputFormat="string"==typeof t.outputFormat?t.outputFormat.toLowerCase():"json",!this.options.serverUrl){var i=o.ProcessIsoCurve.url(this.options.apiKey),s=i["iso-"+this.options.outputFormat];if(!s)throw new Error("Url by default not found !");this.options.serverUrl=s}var r=this.options.serverUrl.lastIndexOf(".");if(r!==-1){var l=this.options.serverUrl.substring(r+1);if(l&&l.length<5)switch(l.toLowerCase()){case"json":case"xml":this.options.outputFormat=l.toLowerCase();break;default:throw new Error("type of service : unknown or unsupported (json or xml) !")}}}return a.prototype=Object.create(n.prototype,{}),a.prototype.constructor=a,a.prototype.buildRequest=function(t,n){try{var o=new s(this.options);if(!o.processRequestString())throw new Error(e.getMessage("SERVICE_REQUEST_BUILD"));this.request=o.requestString}catch(e){return void t.call(this,new i(e.message))}n.call(this,this.request)},a.prototype.analyzeResponse=function(t,n){if(this.response){var o={response:this.response,outputFormat:this.options.outputFormat,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,u,h,Dt,jt),zt=function(t,e,i,n,o,s,r){var a={getConfig:function(t){var i=new e(t);i.call()},getAltitude:function(e){var i=new t(e);i.call()},geocode:function(t){var e=new i(t);e.call()},reverseGeocode:function(t){var e=new n(t);e.call()},autoComplete:function(t){var e=new o(t);e.call()},route:function(t){var e=new s(t);e.call()},isoCurve:function(t){var e=new r(t);e.call()}};return a}(M,z,ht,ft,yt,kt,Ft),Bt=function(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){var x="undefined"!=typeof window?window:{},G=x.Gp||{servicesVersion:"1.0.0-beta3",servicesDate:"2016-12-01",extend:function(t,e){var i,n=t.split("."),o=this;i=n.length;for(var s=0;s<i;s++){"undefined"==typeof o[n[s]]&&(o[n[s]]={});var r=i-1;s===r&&(o[n[s]]=e),o=o[n[s]]}return this}};return G.extend("Protocols",{}),G.extend("Protocols.XHR",t),G.extend("Services",e),G.extend("Services.AltiResponse",i),G.extend("Services.Alti.Elevation",n),G.extend("Services.AutoCompleteResponse",o),G.extend("Services.AutoComplete.SuggestedLocation",s),G.extend("Services.GetConfigResponse",r),G.extend("Services.Config.Constraint",a),G.extend("Services.Config.Format",l),G.extend("Services.Config.Layer",c),G.extend("Services.Config.Legend",h),G.extend("Services.Config.Metadata",u),G.extend("Services.Config.Originator",d),G.extend("Services.Config.Service",p),G.extend("Services.Config.Style",m),G.extend("Services.Config.Territory",f),G.extend("Services.Config.Thematic",s),G.extend("Services.Config.TileMatrix",g),G.extend("Services.Config.TileMatrixLimit",v),G.extend("Services.Config.TileMatrixSet",y),G.extend("Services.GeocodeResponse",E),G.extend("Services.Geocode.GeocodedLocation",P),G.extend("Services.Geocode.DirectGeocodedLocation",C),G.extend("Services.Geocode.ReverseGeocodedLocation",S),G.extend("Services.IsoCurveResponse",M),G.extend("Services.RouteResponse",w),G.extend("Services.Route.RouteInstruction",L),G.extend("Error",R),G.extend("Helper",b),x.Gp=G,x.Gp}(s,zt,E,P,_t,gt,w,L,R,b,x,G,I,A,T,k,O,N,U,D,st,rt,at,dt,Nt,xt,Gt,a,n)}),CommonUtilsAutoLoadConfig=function(t){!function(){var e=document.getElementsByTagName("script"),i=e[e.length-1].getAttribute("data-key");if(i){var n=i.split(/;|,|\|/);if(i&&n.length>1){for(var o=[],s=0;s<n.length;s++)o.push(n[s]);i=o}}var r=e[e.length-1].getAttribute("data-url"),a=e[e.length-1].getAttribute("data-timeout"),l=function(){},c=function(t){throw new Error("Configuration load failed : "+t.message)};if(i||r){var h={apiKey:i,onSuccess:l,onFailure:c};r&&(h.serverUrl=r,h.callbackSuffix=""),a&&(h.timeOut=a),t.Config||t.Services.getConfig(h)}}()}(gp),!function(t,e,i){L.drawVersion="0.3.0-dev",L.drawLocal={draw:{toolbar:{actions:{title:"Cancel drawing",text:"Cancel"},finish:{title:"Finish drawing",text:"Finish"},undo:{title:"Delete last point drawn",text:"Delete last point"},buttons:{polyline:"Draw a polyline",polygon:"Draw a polygon",rectangle:"Draw a rectangle",circle:"Draw a circle",marker:"Draw a marker"}},handlers:{circle:{tooltip:{start:"Click and drag to draw circle."},radius:"Radius"},marker:{tooltip:{start:"Click map to place marker."}},polygon:{tooltip:{start:"Click to start drawing shape.",cont:"Click to continue drawing shape.",end:"Click first point to close this shape."}},polyline:{error:"<strong>Error:</strong> 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;i<this.latlngs.length;i++)this._verticesHandlers.push(new L.Edit.PolyVerticesEdit(t,this.latlngs[i],e));this._poly=t,L.setOptions(this,e)},_eachVertexHandler:function(t){for(var e=0;e<this._verticesHandlers.length;e++)t(this._verticesHandlers[e])},addHooks:function(){this._eachVertexHandler(function(t){t.addHooks()})},removeHooks:function(){this._eachVertexHandler(function(t){t.removeHooks()})},updateMarkers:function(){this._eachVertexHandler(function(t){t.updateMarkers()})}}),L.Edit.PolyVerticesEdit=L.Handler.extend({options:{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"})},initialize:function(t,e,i){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this._poly=t,this._latlngs=e,L.setOptions(this,i)},addHooks:function(){var t=this._poly;t instanceof L.Polygon||(t.options.editing.fill=!1),t.setStyle(t.options.editing),this._poly._map&&(this._map=this._poly._map,this._markerGroup||this._initMarkers(),this._poly._map.addLayer(this._markerGroup))},removeHooks:function(){var t=this._poly;t.setStyle(t.options.original),t._map&&(t._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers)},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._markers=[];var t,e,i,n,o=this._latlngs;for(t=0,i=o.length;i>t;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.length<e||(this._removeMarker(i),this._updatePrevNext(i._prev,i._next),i._middleLeft&&this._markerGroup.removeLayer(i._middleLeft),i._middleRight&&this._markerGroup.removeLayer(i._middleRight),i._prev&&i._next?this._createMiddleMarker(i._prev,i._next):i._prev?i._next||(i._prev._middleRight=null):i._next._middleLeft=null,this._fireEdit())},_onTouchMove:function(t){var e=this._map.mouseEventToLayerPoint(t.originalEvent.touches[0]),i=this._map.layerPointToLatLng(e),n=t.target;L.extend(n._origLatLng,i),n._middleLeft&&n._middleLeft.setLatLng(this._getMiddleLatLng(n._prev,n)),n._middleRight&&n._middleRight.setLatLng(this._getMiddleLatLng(n,n._next)),this._poly.redraw(),this.updateMarkers()},_updateIndexes:function(t,e){this._markerGroup.eachLayer(function(i){i._index>t&&(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){
       
   143 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;i<e.length;i++)L.DomEvent.on(t,e[i],this._fireMouseEvent,this);L.Handler.MarkerDrag&&(this.dragging=new L.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())}},_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.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&sup2;":(t/=.836127,i=t>=3097600?(t/3097600).toFixed(2)+" mi&sup2;":t>=4840?(t/4840).toFixed(2)+" acres":Math.ceil(t)+" yd&sup2;"),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;e<s.length;e++)s[e].enabled&&this._initModeHandler(s[e].handler,this._toolbarContainer,n++,o,s[e].title);return n?(this._lastButtonIndex=--n,this._actionsContainer=L.DomUtil.create("ul","leaflet-draw-actions"),i.appendChild(this._toolbarContainer),i.appendChild(this._actionsContainer),i):void 0},removeToolbar:function(){for(var t in this._modes)this._modes.hasOwnProperty(t)&&(this._disposeButton(this._modes[t].button,this._modes[t].handler.enable,this._modes[t].handler),this._modes[t].handler.disable(),this._modes[t].handler.off("enabled",this._handlerActivated,this).off("disabled",this._handlerDeactivated,this));this._modes={};for(var e=0,i=this._actionButtons.length;i>e;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?'<span class="leaflet-draw-tooltip-subtext">'+t.subtext+"</span><br />":"")+"<span>"+t.text+"</span>",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(;o<s;o++)i(n[o],o);return n}return[]}function c(t,e,i,n,o,s,r){var a=F.createEvent("Event"),l=(t||e[U]).options,c="on"+i.charAt(0).toUpperCase()+i.substr(1);a.initEvent(i,!0,!0),a.to=e,a.from=o||e,a.item=n||e,a.clone=C,a.oldIndex=s,a.newIndex=r,e.dispatchEvent(a),
       
   144 l[c]&&l[c].call(t,a)}function h(t,e,i,n,o,s){var r,a,l=t[U],c=l.options.onMove;return r=F.createEvent("Event"),r.initEvent("move",!0,!0),r.to=e,r.from=t,r.dragged=i,r.draggedRect=n,r.related=o||e,r.relatedRect=s||e.getBoundingClientRect(),t.dispatchEvent(r),c&&(a=c.call(l,r)),a}function u(t){t.draggable=!1}function d(){W=!1}function p(t,e){var i=t.lastElementChild,n=i.getBoundingClientRect();return(e.clientY-(n.top+n.height)>5||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<w.scrollWidth||w.offsetHeight<w.scrollHeight)break;while(w=w.parentNode)}w&&(n=w,o=w.getBoundingClientRect(),s=(H(o.right-c)<=a)-(H(o.left-c)<=a),r=(H(o.bottom-h)<=a)-(H(o.top-h)<=a)),s||r||(s=(u-c<=a)-(c<=a),r=(d-h<=a)-(h<=a),(s||r)&&(n=j)),D.vx===s&&D.vy===r&&D.el===n||(D.el=n,D.vx=s,D.vy=r,clearInterval(D.pid),n&&(D.pid=setInterval(function(){n===j?j.scrollTo(j.pageXOffset+s*l,j.pageYOffset+r*l):(r&&(n.scrollTop+=r*l),s&&(n.scrollLeft+=s*l))},24)))}},30),K=function(t){var e=t.group;e&&"object"==typeof e||(e=t.group={name:e}),["pull","put"].forEach(function(t){t in e||(e[t]=!0)}),t.groups=" "+e.name+(e.put.join?" "+e.put.join(" "):"")+" "};return t.prototype={constructor:t,_onTapStart:function(t){var e=this,n=this.el,o=this.options,s=t.type,r=t.touches&&t.touches[0],a=(r||t).target,l=a,h=o.filter;if(!("mousedown"===s&&0!==t.button||o.disabled)&&(a=i(a,o.draggable,n))){if(G=f(a,o.draggable),"function"==typeof h){if(h.call(this,t,a,this))return c(e,l,"filter",a,n,G),void t.preventDefault()}else if(h&&(h=h.split(",").some(function(t){if(t=i(l,t.trim(),n))return c(e,t,"filter",a,n,G),!0})))return void t.preventDefault();o.handle&&!i(l,o.handle,n)||this._prepareDragStart(t,r,a)}},_prepareDragStart:function(t,e,i){var n,s=this,a=s.el,c=s.options,h=a.ownerDocument;i&&!y&&i.parentNode===a&&(T=t,S=a,y=i,E=y.parentNode,M=y.nextSibling,A=c.group,n=function(){s._disableDelayedDrag(),y.draggable=!0,r(y,s.options.chosenClass,!0),s._triggerDragStart(e)},c.ignore.split(",").forEach(function(t){l(y,t.trim(),u)}),o(h,"mouseup",s._onDrop),o(h,"touchend",s._onDrop),o(h,"touchcancel",s._onDrop),c.delay?(o(h,"mouseup",s._disableDelayedDrag),o(h,"touchend",s._disableDelayedDrag),o(h,"touchcancel",s._disableDelayedDrag),o(h,"mousemove",s._disableDelayedDrag),o(h,"touchmove",s._disableDelayedDrag),s._dragStartTimer=setTimeout(n,c.delay)):n())},_disableDelayedDrag:function(){var t=this.el.ownerDocument;clearTimeout(this._dragStartTimer),s(t,"mouseup",this._disableDelayedDrag),s(t,"touchend",this._disableDelayedDrag),s(t,"touchcancel",this._disableDelayedDrag),s(t,"mousemove",this._disableDelayedDrag),s(t,"touchmove",this._disableDelayedDrag)},_triggerDragStart:function(t){t?(T={target:y,clientX:t.clientX,clientY:t.clientY},this._onDragStart(T,"touch")):this.nativeDraggable?(o(y,"dragend",this),o(S,"dragstart",this._onDragStart)):this._onDragStart(T,!0);try{F.selection?F.selection.empty():window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(){S&&y&&(r(y,this.options.ghostClass,!0),t.active=this,c(this,S,"start",y,S,G))},_emulateDragOver:function(){if(k){if(this._lastX===k.clientX&&this._lastY===k.clientY)return;this._lastX=k.clientX,this._lastY=k.clientY,q||a(P,"display","none");var t=F.elementFromPoint(k.clientX,k.clientY),e=t,i=" "+this.options.group.name,n=V.length;if(e)do{if(e[U]&&e[U].options.groups.indexOf(i)>-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;o<s;o++)t=n[o],i(t,r.draggable,this.el)&&e.push(t.getAttribute(r.dataIdAttr)||m(t));return e},sort:function(t){var e={},n=this.el;this.toArray().forEach(function(t,o){var s=n.children[o];i(s,this.options.draggable,n)&&(e[t]=s)},this),t.forEach(function(t){e[t]&&(n.removeChild(e[t]),n.appendChild(e[t]))})},save:function(){var t=this.options.store;t&&t.set(this)},closest:function(t,e){return i(t,e||this.options.draggable,this.el)},option:function(t,e){var i=this.options;return void 0===e?i[t]:(i[t]=e,void("group"===t&&K(i)))},destroy:function(){var t=this.el;t[U]=null,s(t,"mousedown",this._onTapStart),s(t,"touchstart",this._onTapStart),this.nativeDraggable&&(s(t,"dragover",this),s(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),V.splice(V.indexOf(this._onDragOver),1),this._onDrop(),this.el=t=null}},t.utils={on:o,off:s,css:a,find:l,is:function(t,e){return!!i(t,e,t)},extend:v,throttle:g,closest:i,toggleClass:r,index:f},t.create=function(e,i){return new t(e,i)},t.version="1.4.2",t}),CommonControlsLayerSwitcherDOM=function(t){var e={_createDraggableElement:function(e,i){t.create(e,{handle:".GPlayerName",draggable:".draggable-layer",ghostClass:"GPghostLayer",animation:200,onEnd:function(t){i._onDragAndDropLayerClick(t)}})},_addUID:function(t){var e=this._uid?t+"-"+this._uid:t;return e},_createMainContainerElement:function(){var t=document.createElement("div");return t.id=this._addUID("GPlayerSwitcher"),t.className="GPwidget",t},_createMainLayersShowElement:function(){var t=document.createElement("input");return t.id=this._addUID("GPshowLayersList"),t.type="checkbox",t},_createMainLayersElement:function(){var t=document.createElement("div");return t.id=this._addUID("GPlayersList"),t.className="GPpanel",t},_createMainPictoElement:function(){var t=this,e=document.createElement("label");e.id=this._addUID("GPshowLayersListPicto"),e.className="GPshowAdvancedToolPicto",e.htmlFor=this._addUID("GPshowLayersList"),e.title="Afficher/masquer le gestionnaire de couches";var i=document.createElement("span");i.id=this._addUID("GPshowLayersListOpen"),i.className="GPshowAdvancedToolOpen",i.addEventListener("click",function(){if(document.getElementById(t._addUID("GPshowLayersList")).checked){for(var e=document.getElementsByClassName("GPlayerInfoOpened"),i=0;i<e.length;i++)e[i].className="GPlayerInfo";document.getElementById(t._addUID("GPlayerInfoPanel")).className="GPlayerInfoPanelClosed"}}),e.appendChild(i);var n=document.createElement("span");return n.addEventListener("click",function(){if(document.getElementById(t._addUID("GPshowLayersList")).checked){for(var e=document.getElementsByClassName("GPlayerInfoOpened"),i=0;i<e.length;i++)e[i].className="GPlayerInfo";document.getElementById(t._addUID("GPlayerInfoPanel")).className="GPlayerInfoPanelClosed"}}),n.id=t._addUID("GPshowLayersListClose"),e.appendChild(n),e},_createMainInfoElement:function(){var t=document.createElement("div");return t.id=this._addUID("GPlayerInfoPanel"),t.className="GPpanel GPlayerInfoPanelClosed",t},_createContainerLayerElement:function(t){var e=document.createElement("div");e.id="GPlayerSwitcher_ID"+t.id,e.className="GPlayerSwitcher_layer draggable-layer",e.appendChild(this._createBasicToolElement(t));for(var i=this._createAdvancedToolShowElement(t),n=0;n<i.length;n++)e.appendChild(i[n]);return e.appendChild(this._createAdvancedToolElement(t)),e},_createBasicToolElement:function(t){var e=document.createElement("div");e.id="GPbasicTools_IDLayer"+t.id,e.className="GPlayerBasicTools",e.appendChild(this._createBasicToolNameElement(t));for(var i=this._createBasicToolVisibilityElement(t),n=0;n<i.length;n++)e.appendChild(i[n]);return e},_createBasicToolNameElement:function(t){var e=document.createElement("span");return e.id="GPname_ID"+t.id,e.className="GPlayerName",e.title=t.description||t.title,e.innerHTML=t.title,e},_createBasicToolVisibilityElement:function(t){var e=[],i=t.visibility,n="GPvisibility_ID"+t.id,o=document.createElement("input");o.id=n,o.type="checkbox",o.checked=i;var s=document.createElement("label");s.htmlFor=n,s.id="GPvisibilityPicto_ID"+t.id,s.className="GPlayerVisibility",s.title="Afficher/masquer la couche";var r=this;return o.addEventListener?o.addEventListener("click",function(t){r._onVisibilityLayerClick.call(r,t)}):o.attachEvent&&o.attachEvent("onclick",function(t){r._onVisibilityLayerClick.call(r,t)}),e.push(o),e.push(s),e},_createAdvancedToolShowElement:function(t){var e=[],i=document.createElement("label");i.id="GPshowAdvancedToolsPicto_ID"+t.id,i.htmlFor="GPshowAdvancedTools_ID"+t.id,i.title="Plus d'outils",i.className="GPshowMoreOptions GPshowLayerAdvancedTools";var n=document.createElement("input");return n.type="checkbox",n.id="GPshowAdvancedTools_ID"+t.id,e.push(n),e.push(i),e},_createAdvancedToolElement:function(t){var e=document.createElement("div");if(e.id="GPadvancedTools_ID"+t.id,e.className="GPlayerAdvancedTools",e.appendChild(this._createAdvancedToolDeleteElement(t)),t.title&&t.description&&e.appendChild(this._createAdvancedToolInformationElement(t)),"feature"!==t.type)for(var i=this._createAdvancedToolOpacityElement(t),n=0;n<i.length;n++)e.appendChild(i[n]);return e},_createAdvancedToolDeleteElement:function(t){var e=document.createElement("div");e.id="GPremove_ID"+t.id,e.className="GPlayerRemove",e.title="Supprimer la couche",e.layerId=t.id;var i=this;return e.addEventListener?e.addEventListener("click",function(t){i._onDropLayerClick.call(i,t)}):e.attachEvent&&e.attachEvent("onclick",function(t){i._onDropLayerClick.call(i,t)}),e},_createAdvancedToolInformationElement:function(t){var e=document.createElement("div");e.id="GPinfo_ID"+t.id,e.className="GPlayerInfo",e.title="Informations/légende",e.layerId=t.id;var i=this;return e.addEventListener?e.addEventListener("click",function(t){i._onOpenLayerInfoClick.call(i,t)}):e.attachEvent&&e.attachEvent("onclick",function(t){i._onOpenLayerInfoClick.call(i,t)}),e},_createAdvancedToolOpacityElement:function(t){var e=[],i=document.createElement("div");i.id="GPopacity_ID"+t.id,i.className="GPlayerOpacity",i.title="Opacité";var n=Math.round(100*t.opacity),o=document.createElement("input");o.id="GPopacityValueDiv_ID"+t.id,o.type="range",o.value=n;var s=this;o.addEventListener?o.addEventListener("change",function(t){s._onChangeLayerOpacity.call(s,t)}):o.attachEvent&&o.attachEvent("onchange",function(t){s._onChangeLayerOpacity.call(s,t)}),o.addEventListener?o.addEventListener("input",function(t){s._onChangeLayerOpacity.call(s,t)}):o.attachEvent&&o.attachEvent("oninput",function(t){s._onChangeLayerOpacity.call(s,t)}),i.appendChild(o);var r=document.createElement("div");r.id="GPopacityValueDiv_ID"+t.id,r.className="GPlayerOpacityValue";var a=document.createElement("span");return a.id="GPopacityValue_ID"+t.id,a.innerHTML=n+"%",r.appendChild(a),e.push(i),e.push(r),e},_createContainerLayerInfoElement:function(t){var e=document.createElement("div");e.id="GPlayerInfoContent";var i=document.createElement("div");if(i.id="GPlayerInfoTitle",i.innerHTML=t.title,e.appendChild(i),t.quicklookUrl){var n=document.createElement("div");n.id="GPlayerInfoQuicklook",n.title="Afficher un aperçu de la couche";var o=document.createElement("a");o.href=t.quicklookUrl,o.appendChild(n),e.appendChild(o)}var s=document.createElement("div");s.id="GPlayerInfoClose",s.title="Fermer la fenêtre";var r=function(){document.getElementById("GPlayerInfoPanel").className="GPlayerInfoPanelClosed";for(var t=document.getElementsByClassName("GPlayerInfoOpened"),e=0;e<t.length;e++)t[e].className="GPlayerInfo"};s.addEventListener?s.addEventListener("click",r):s.attachEvent&&s.attachEvent("onclick",r),e.appendChild(s);var a=document.createElement("div");if(a.id="GPlayerInfoDescription",a.innerHTML=t.description,e.appendChild(a),t.metadata){var l=document.createElement("div");l.id="GPlayerInfoMetadata";var c=document.createElement("div");c.className="GPlayerInfoSubtitle",c.innerHTML="Métadonnées",l.appendChild(c);for(var h=0;h<t.metadata.length;h++){var u=t.metadata[h].url,d=document.createElement("div");d.className="GPlayerInfoLink";var p=document.createElement("a");p.href=u,p.innerHTML=u,d.appendChild(p),l.appendChild(d)}0!==t.metadata.length&&e.appendChild(l)}if(t.legends){var m=document.createElement("div");m.id="GPlayerInfoLegend";var f=document.createElement("div");f.className="GPlayerInfoSubtitle",f.innerHTML="Légende",m.appendChild(f);for(var _={},g=t.maxScaleDenominator||56e7,v=0;v<t.legends.length;v++){var y=t.legends[v].minScaleDenominator;if(y){var E=y.toString();y=Math.round(parseInt(E.substring(0,3),10)/10)*Math.pow(10,E.length-2)}else y=270;_[y]=t.legends[v]}for(var P in _)if(_.hasOwnProperty(P)){var C=_[P].url;if("string"==typeof C&&C.toLowerCase().indexOf("nolegend.jpg")==-1){var S=document.createElement("div");S.className="GPlayerInfoLink",g=_[P].maxScaleDenominator||g;var M=document.createElement("a");M.href=C,M.innerHTML="Du 1/"+P+" au 1/"+g,S.appendChild(M),m.appendChild(S)}else delete _[P]}0!==Object.keys(_).length&&e.appendChild(m)}return e}};return e}(sortable),LeafletControlsLayerSwitcher=function(t,e,i){var n=t.Control.Layers.extend({includes:i,options:{collapsed:!0,position:"topright",autoZIndex:!0,layers:[]},initialize:function(e){if(t.Util.setOptions(this,e),this._hasLayersConfig=!(!this.options.layers||0===Object.keys(this.options.layers).length),this._layersConfig=this._hasLayersConfig?this.options.layers:[],this._layers={},this._lastZIndex=0,this._hasLayersConfig)for(var i=0;i<this._layersConfig.length;i++){var n=this._layersConfig[i];this._addLayer(n.layer,null,!0)}},onAdd:function(t){var e=t._layers;if(0!==Object.keys(e).length){var i=Object.keys(e);this._lastZIndex=0;for(var n=0;n<i.length;n++){var o=i[n];this.options.autoZIndex&&e[o].setZIndex&&(this._lastZIndex++,e[o].setZIndex(this._lastZIndex)),this._hasLayersConfig&&this._layers[o]||this.addOverlay(e[o])}}if(0===Object.keys(e).length){var s=this._layersConfig;this._lastZIndex=0;for(var r=0;r<s.length;r++){var a=s[r].layer;t.hasLayer(a)||(t.addLayer(a),this.addOverlay(a,null),this.options.autoZIndex&&a.setZIndex&&(this._lastZIndex++,a.setZIndex(this._lastZIndex)))}}for(var l in this._layers)if(this._layers.hasOwnProperty(l)){var c=this._layers[l];c.visibility||this._visibilityLayer(!c.visibility,c.layer)}return this._initLayout(),this._update(),t.on("layeradd",this._onLayerChange,this),t.on("layerremove",this._onLayerChange,this),this._container},_addLayer:function(e,i,n){var o=e._geoportal_id?e._geoportal_id:e._leaflet_id;if(o){var s={};for(var r in this._layersConfig)if(this._layersConfig.hasOwnProperty(r)&&o===t.stamp(this._layersConfig[r].layer)){s=this._layersConfig[r].config;var a="undefined"==typeof this._layersConfig[r].display||this._layersConfig[r].display;if(!a)return;break}this._layers[o]={layer:e,id:o,overlay:n,title:e._geoportal_id&&e._title?e._title:i?i:o,description:e._geoportal_id&&e._description?e._description:i?i:o,visibility:!e._geoportal_id||e.getVisible(),legends:e._geoportal_id?e._legends:null,metadata:e._geoportal_id?e._metadata:null,quicklookUrl:e._geoportal_id?e._quicklookUrl:null},s&&Object.keys(s)&&t.Util.extend(this._layers[o],s),e._geoportal_id?e.setVisible(this._layers[o].visibility):null}},_initLayout:function(){var e=this._container=this._createMainContainerElement(),i=this._createMainLayersShowElement();e.appendChild(i),this.options.collapsed||(i.checked="checked");var n=this._overlaysList=this._createMainLayersElement();e.appendChild(n);var o=this._createMainPictoElement();e.appendChild(o);var s=this._createMainInfoElement();switch(e.appendChild(s),this._createDraggableElement(this._overlaysList,this),t.DomEvent.disableClickPropagation(e).disableScrollPropagation(e),this._map.on("moveend",this._onOutOfRangeLayerZoom,this),this.getPosition()){case"topright":e.style.position="relative",e.style.top="0",e.style.right="0";break;case"topleft":e.style.position="relative",e.style.top="0",e.style.right="initial",o.style.float="left",n.style.borderBottomRightRadius="5px",n.style.borderBottomLeftRadius="0",s.style.right="initial",s.style.left="190px";break;case"bottomleft":e.style.position="relative",e.style.top="0",e.style.right="initial",o.style.float="left",n.style.borderBottomRightRadius="5px",n.style.borderBottomLeftRadius="0",s.style.right="initial",s.style.left="190px";break;case"bottomright":e.style.position="relative",e.style.top="0",e.style.right="0";break;default:e.style.position="relative",e.style.top="0",e.style.right="0"}},_update:function(){if(this._container){this._overlaysList.innerHTML="";var t=[];for(var e in this._layers)this._layers.hasOwnProperty(e)&&t.push(e);for(var i=t.sort(function(t,e){var i=parseInt(t,10),n=parseInt(e,10);return i-n}).reverse(),n=0;n<i.length;n++){var o=i[n],s=this._layers[o];this._addItem(s)}}},_addItem:function(e){e.opacity=e.layer.options.opacity;var i=this._createContainerLayerElement(e);return e.layer.options.minZoom>this._map.getZoom()||e.layer.options.maxZoom<this._map.getZoom()?t.DomUtil.addClass(i,"outOfRange"):t.DomUtil.removeClass(i,"outOfRange"),this._overlaysList.appendChild(i),i},_onLayerChange:function(e){var i=this._layers[t.stamp(e.layer)];if(i){this._handlingClick||this._update();var n="layeradd"===e.type?"overlayadd":"overlayremove";n&&this._map.fire(n,i)}},removeLayer:function(e){var i=t.stamp(e);return delete this._layers[i],this._update(),this},_visibilityLayer:function(t,e){if(this._handlingClick=!0,e._geoportal_id){var i=!e.getVisible();e.setVisible(i)}t&&this._map.hasLayer(e)?this._map.removeLayer(e):t||this._map.hasLayer(e)||this._map.addLayer(e),this._handlingClick=!1,this._refocusOnMap()},_onOutOfRangeLayerZoom:function(){var e=this._map,i=this._layers;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n].layer,s=i[n].id,r=t.DomUtil.get("GPlayerSwitcher_ID"+s);o.options.minZoom>e.getZoom()||o.options.maxZoom<e.getZoom()?t.DomUtil.addClass(r,"outOfRange"):t.DomUtil.removeClass(r,"outOfRange")}},_onVisibilityLayerClick:function(e){var i=e.target.id,n=i.substring(i.indexOf("_")+3),o=t.DomUtil.get(i);this._layers[n].visibility=o.checked,this._visibilityLayer(!o.checked,this._layers[n].layer)},_onDropLayerClick:function(t){var e=t.target.id,i=e.substring(e.indexOf("_")+3),n=this._layers[i].layer;this.removeLayer(n),this._map.hasLayer(n)&&this._map.removeLayer(n)},_onChangeLayerOpacity:function(e){var i=e.target.id,n=i.substring(i.indexOf("_")+3),o=this._layers[n].layer,s=e.target.value,r=t.DomUtil.get("GPopacityValue_ID"+n);r.innerHTML=s+"%",this._map.hasLayer(o)&&o.setOpacity(s/100)},_onOpenLayerInfoClick:function(e){var i=e.target.id,n=i.substring(i.indexOf("_")+3),o=this._layers[n],s=t.DomUtil.get(e.target.id),r=null,a=null;if("GPlayerInfoOpened"===s.className)return t.DomUtil.removeClass(s,"GPlayerInfoOpened"),t.DomUtil.addClass(s,"GPlayerInfo"),r=t.DomUtil.get("GPlayerInfoPanel"),t.DomUtil.removeClass(r,"GPpanel"),t.DomUtil.removeClass(r,"GPlayerInfoPanelOpened"),t.DomUtil.addClass(r,"GPlayerInfoPanelClosed"),a=t.DomUtil.get("GPlayerInfoContent"),void r.removeChild(a);for(var l=document.getElementsByClassName("GPlayerInfoOpened"),c=0;c<l.length;c++)l[c].className="GPlayerInfo";t.DomUtil.removeClass(s,"GPlayerInfo"),t.DomUtil.addClass(s,"GPlayerInfoOpened"),r=t.DomUtil.get("GPlayerInfoPanel"),t.DomUtil.addClass(r,"GPpanel"),t.DomUtil.removeClass(r,"GPlayerInfoPanelClosed"),t.DomUtil.addClass(r,"GPlayerInfoPanelOpened"),a=t.DomUtil.get("GPlayerInfoContent"),a&&r.removeChild(a);var h=this._createContainerLayerInfoElement(o);r.appendChild(h)},_onDragAndDropLayerClick:function(t){var e=t.item.id,i=e.substring(e.indexOf("_")+3),n=(this._layers[i].layer,document.querySelectorAll("div.GPlayerSwitcher_layer"));this._lastZIndex=n.length;for(var o=0;o<n.length;o++){var s=n[o].id,r=s.substring(s.indexOf("_")+3),a=this._layers[r].layer;this.options.autoZIndex&&a.setZIndex&&(this._lastZIndex--,a.setZIndex(this._lastZIndex))}},addLayer:function(e,i){var n=this._map,o=this._layersConfig;if(!e)return void console.log("[ERROR] LayerSwitcher:addLayer - missing layer parameter !");n.hasLayer(e)||console.log("[WARN] LayerSwitcher:addLayer - layer has not been added on map !");var s=t.stamp(e);for(var r in o)if(o.hasOwnProperty(r)&&s===t.stamp(o[r].layer)){delete o[r];break}var a=i||{};t.Util.extend(a,{layer:e}),o.push(a),e.setZIndex(this._lastZIndex++),this.addOverlay(e),this._update()}});return n}(leaflet,{},CommonControlsLayerSwitcherDOM),CommonUtilsConfig=function(){var t={configuration:null,isConfigLoaded:function(){var t="undefined"!=typeof window?window:{};return!(!t.Gp||!t.Gp.Config||0===Object.keys(t.Gp.Config).length)&&(this.configuration=t.Gp.Config,!0)},getLayerId:function(t,e){var i=null;if(this.configuration){var n=this.configuration.layers;for(var o in n)if(n.hasOwnProperty(o)){var s=o.split("$");if(t===s[0]&&s[1]){var r=s[1].split(":"),a=s[1].split(";");if(a[1]===e){i=o;break}if(r[2]===e){i=o;break}}}}return i||console.log("ERROR layer id ("+t+" / "+e+") was not found !?"),i},getLayerParams:function(t,e,i){var n={};if(this.configuration){var o=this.getLayerId(t,e);if(o){var s=this.configuration.layers[o],r=s.apiKeys[0];if(i&&i!==r)return void console.log("ERROR different keys ("+i+" !== "+r+") !?");i=i||r,n.key=i,n.url=s.getServerUrl(i),n.version=s.getServiceParams().version,n.styles=s.getDefaultStyle(),n.format=s.getDefaultFormat(),n.projection=s.getDefaultProjection(),n.minScale=s.getMinScaleDenominator(),n.maxScale=s.getMaxScaleDenominator(),n.extent=s.getBBOX(),n.legends=s.getLegends(),n.metadata=s.getMetadata(),n.originators=s.getOriginators(),n.title=s.getTitle(),n.description=s.getDescription(),n.quicklookUrl=s.getQuicklookUrl(),s.wmtsOptions&&(n.tileMatrixSetLimits=s.wmtsOptions.tileMatrixSetLimits);var a=s.getTMSID();if(a){n.TMSLink=a;var l=this.configuration.getTMSConf(a);n.matrixOrigin=l.getTopLeftCorner(),n.nativeResolutions=l.nativeResolutions,n.matrixIds=l.matrixIds,n.tileMatrices=l.tileMatrices}}}return n},getServiceParams:function(t,e,i){var n={};if(this.configuration){var o=this.getLayerId(t,e);if(o){var s=this.configuration.layers[o],r=s.apiKeys[0];if(i&&i!==r)return;i=i||r,n.key=i,n.url=s.getServerUrl(i),n.version=s.getServiceParams().version,n.extent=s.getBBOX(),n.title=s.getTitle(),n.description=s.getDescription()}}return n},getResolutions:function(){var t=[];return this.configuration&&(t=this.configuration.generalOptions.wgs84Resolutions),t},getTileMatrix:function(t){var e={};return this.configuration&&t&&(e=this.configuration.tileMatrixSets[t.toUpperCase()]),e},getGlobalConstraints:function(t){var e={};if(t){var i=this.configuration.layers[t];e.projection=i.getDefaultProjection(),e.minScale=i.getMinScaleDenominator(),e.maxScale=i.getMaxScaleDenominator(),e.extent=i.getBBOX()}return e}};return t}(),CommonUtilsCheckRightManagement=function(t,e){return{check:function(t){if(t){var i=t.key,n=t.resources||[],o=t.services||[];if(n&&0!==n.length&&o&&0!==o.length){var s={};if(!i){if(!e.isConfigLoaded())return void console.log("WARNING : parameter 'apiKey' has not been parametered, and the contract key configuration has not been loaded, so impossible to check yours rights !");i=Object.keys(e.configuration.generalOptions.apiKeys)[0]}if(i){if(e.isConfigLoaded()){for(var r=0;r<n.length;r++)for(var a=n[r],l=0;l<o.length;l++){var c=o[l],h=e.getServiceParams(a,c,i);h&&0!==Object.keys(h).length?(s[c]||(s[c]=[]),s[c].push(a)):console.log("WARNING : contract key configuration has no rights to load this geoportal resource ("+a+") for this service ("+c+") ")}return s&&0!==Object.keys(s).length?(s.key=i,s):void console.log("WARNING : the contract key configuration has been loaded, and the parameter 'apiKey' has been parametered, but, there is a problem on the mapping between the contract and the key !")}console.log("WARNING : the contract key configuration has not been loaded, so be carefull !");for(var u={},d=0;d<o.length;d++){var p=o[d];u[p]=[];for(var m=0;m<n.length;m++){var f=n[m];u[p].push(f)}}return u.key=i,u}}}}}}({},CommonUtilsConfig),CommonUtilsSelectorID=function(){var t={generate:function(){var t=Math.floor(Date.now());return function(){return t++}}(),name:function(t){var e=null,i=t.indexOf("-");return e=i===-1?t:t.substring(0,i)},index:function(t){var e=null,i=this.name(t);if(i!==t){var n=i.indexOf("_");n!==-1&&(e=i.substring(n+1))}return e},uuid:function(t){var e=null,i=t.indexOf("-");return i!==-1&&(e=parseInt(t.substring(i+1),10)),e}};return t}(),CommonControlsLocationSelectorDOM=function(t){var e={_addUID:function(t){return t+"-"+this._uid},_createMainContainerElement:function(){var t=document.createElement("div");return t.className=this._addUID("GPlocationPoint"),t.className+=" GPwidget",t},_createLocationPointElement:function(t,e){var i=document.createElement("div");return i.id=this._addUID("GPlocationPoint_"+t),i.className=e?"GPflexInput GPlocationStageFlexInput":"GPflexInput GPlocationStageFlexInputHidden",i.style.cssText="",i},_createLocationPointLabelElement:function(e,i){var n=this,o=document.createElement("label");return o.id=this._addUID("GPlocationOriginLabel_"+e),o.htmlFor="GPlocationOrigin_"+e,o.innerHTML=i,o.addEventListener("click",function(e){for(var i=t.index(this.id),o=document.getElementsByClassName(n._addUID("GPlocationPoint")),s=0;s<o.length;s++){var r=o[s].childNodes[0].id,a=t.index(r);document.getElementById(n._addUID("GPlocationPoint_"+a)).style.cssText=""}document.getElementById(n._addUID("GPlocationOriginCoords_"+i)).value="",document.getElementById(n._addUID("GPlocationOrigin_"+i)).value="",document.getElementById(n._addUID("GPlocationPoint_"+i)).style.cssText="",document.getElementById(n._addUID("GPlocationOriginPointer_"+i)).checked=!1,document.getElementById(n._addUID("GPlocationOrigin_"+i)).className="GPlocationOriginVisible",document.getElementById(n._addUID("GPlocationOriginCoords_"+i)).className="GPlocationOriginHidden",document.getElementById(n._addUID("GPlocationStageRemove_"+i))&&(document.getElementById(n._addUID("GPlocationStageRemove_"+i)).className="GPlocationStageRemove"),document.getElementById(n._addUID("GPlocationStageAdd"))&&(document.getElementById(n._addUID("GPlocationStageAdd")).className=""),n.onLocationClearPointClick(e)}),o},_createLocationAutoCompleteteInputElement:function(e){var i=this,n=document.createElement("input");return n.id=this._addUID("GPlocationOrigin_"+e),n.className="GPlocationOriginVisible",n.type="text",n.placeholder="Saisir une adresse",n.autocomplete="off",n.addEventListener("keyup",function(e){var n=e.which||e.keyCode;if(13!==n&&10!==n&&38!==n&&40!==n){
       
   145 var o=t.index(this.id);document.getElementById(i._addUID("GPlocationOrigin_"+o)).value.length>2?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<a.length;n++)o=a[n].childNodes[0].id,s=t.index(o),r!=s&&(document.getElementById(i._addUID("GPlocationOriginPointer_"+s)).checked=!1,"Pointer un lieu sur la carte"==document.getElementById(i._addUID("GPlocationOriginCoords_"+s)).value&&(document.getElementById(i._addUID("GPlocationOriginCoords_"+s)).value="",document.getElementById(i._addUID("GPlocationOrigin_"+s)).className="GPlocationOriginVisible",document.getElementById(i._addUID("GPlocationOriginCoords_"+s)).className="GPlocationOriginHidden"));if(document.getElementById(i._addUID("GPlocationOriginPointer_"+r)).checked){for(document.getElementById(i._addUID("GPlocationOriginCoords_"+r)).value="",n=0;n<a.length;n++)o=a[n].childNodes[0].id,s=t.index(o),document.getElementById(i._addUID("GPlocationPoint_"+s)).style.cssText="";document.getElementById(i._addUID("GPlocationStageRemove_"+r))&&(document.getElementById(i._addUID("GPlocationStageRemove_"+r)).className="GPlocationStageRemove"),document.getElementById(i._addUID("GPlocationStageAdd"))&&(document.getElementById(i._addUID("GPlocationStageAdd")).className=""),document.getElementById(i._addUID("GPlocationOriginPointer_"+r)).checked=!1,document.getElementById(i._addUID("GPlocationOrigin_"+r)).className="GPlocationOriginVisible",document.getElementById(i._addUID("GPlocationOriginCoords_"+r)).className="GPlocationOriginHidden"}else{for(document.getElementById(i._addUID("GPlocationOriginCoords_"+r)).value="Pointer un lieu sur la carte",n=0;n<a.length;n++)o=a[n].childNodes[0].id,s=t.index(o),r==s?document.getElementById(i._addUID("GPlocationPoint_"+s)).style.cssText="":document.getElementById(i._addUID("GPlocationPoint_"+s)).style.display="none";document.getElementById(i._addUID("GPlocationStageRemove_"+r))&&(document.getElementById(i._addUID("GPlocationStageRemove_"+r)).className="GPlocationOriginHidden"),document.getElementById(i._addUID("GPlocationStageAdd"))&&(document.getElementById(i._addUID("GPlocationStageAdd")).className="GPlocationOriginHidden"),document.getElementById(i._addUID("GPlocationOriginPointer_"+r)).checked=!0,document.getElementById(i._addUID("GPlocationOrigin_"+r)).className="GPlocationOriginHidden",document.getElementById(i._addUID("GPlocationOriginCoords_"+r)).className="GPlocationOriginVisible",document.getElementById(i._addUID("GPlocationOriginCoords_"+r)).disabled=!0}i.onActivateMapPointClick(e)}),n},_createLocationRemovePointElement:function(e){var i=this,n=document.createElement("div");return n.id=this._addUID("GPlocationStageRemove_"+e),n.className="GPlocationStageRemove",n.title="Supprimer l'étape",n.addEventListener("click",function(n){var o=document.getElementsByClassName(i._addUID("GPlocationPoint")),s=o.length-1,r=o[0].childNodes[0].id,a=o[s].childNodes[0].id,l=t.index(r),c=t.index(a);if(e!=l&&e!=c){var h=t.index(this.id);document.getElementById(i._addUID("GPlocationPoint_"+h)).className="GPflexInput GPlocationStageFlexInputHidden",document.getElementById(i._addUID("GPlocationOrigin_"+h)).value="",document.getElementById(i._addUID("GPlocationOrigin_"+h)).className="GPlocationOriginVisible",document.getElementById(i._addUID("GPlocationOriginCoords_"+h)).value="",document.getElementById(i._addUID("GPlocationOriginCoords_"+h)).className="GPlocationOriginHidden",document.getElementById(i._addUID("GPlocationStageAdd")).style.display="",i.onLocationRemovePointClick(n)}}),n},_createLocationAddPointElement:function(){var e=this,i=document.createElement("div");return i.id=this._addUID("GPlocationStageAdd"),i.title="Ajouter une étape",i.addEventListener("click",function(i){for(var n=1,o=0,s=document.getElementsByClassName(e._addUID("GPlocationPoint")),r=1;r<s.length-1;r++){var a=s[r].childNodes[0].id,l=t.index(a);document.getElementById(e._addUID("GPlocationPoint_"+l))&&("GPflexInput GPlocationStageFlexInputHidden"==document.getElementById(e._addUID("GPlocationPoint_"+l)).className?1==n&&(n=l):o++)}n<s.length&&(document.getElementById(e._addUID("GPlocationPoint_"+n)).className="GPflexInput GPlocationStageFlexInput"),4==o&&(document.getElementById(e._addUID("GPlocationStageAdd")).style.display="none"),e.onLocationAddPointClick(i)}),i},_createLocationAutoCompleteResultElement:function(t){var e=this,i=document.createElement("div");return i.id=this._addUID("GPlocationAutoCompleteList_"+t),i.className="GPadvancedAutoCompleteList",i.addEventListener?i.addEventListener("click",function(i){e.onAutoCompletedResultsItemClick(i),document.getElementById(e._addUID("GPlocationAutoCompleteList_"+t)).style.display="none"},!1):i.attachEvent&&i.attachEvent("onclick",function(i){e.onAutoCompletedResultsItemClick(i),document.getElementById(e._addUID("GPlocationAutoCompleteList_"+t)).style.display="none"}),i},_createLocationAutoCompletedLocationElement:function(t,e,i){var n=document.getElementById(this._addUID("GPlocationAutoCompleteList_"+t)),o=document.createElement("div");o.id=this._addUID("AutoCompletedLocation_"+i),o.className="GPautoCompleteProposal",o.innerHTML=e.fullText,n.appendChild(o)},GPdisplayCoordinate:function(e){for(var i=document.getElementsByClassName(this._addUID("GPlocationPoint")),n=0;n<i.length;n++){var o=i[n].childNodes[0].id,s=t.index(o);if(document.getElementById(this._addUID("GPlocationOriginPointer_"+s)).checked){document.getElementById(this._addUID("GPlocationOriginCoords_"+s)).value=e,document.getElementById(this._addUID("GPlocationOriginCoords_"+s)).disabled=!1;for(var r=0;r<i.length;r++){o=i[r].childNodes[0].id;var a=t.index(o);document.getElementById(this._addUID("GPlocationPoint_"+a)).style.cssText="",document.getElementById(this._addUID("GPlocationStageRemove_"+a))&&(document.getElementById(this._addUID("GPlocationStageRemove_"+a)).className="GPlocationStageRemove")}return document.getElementById(this._addUID("GPlocationOriginPointer_"+s)).checked=!1,void(document.getElementById(this._addUID("GPlocationStageAdd"))&&(document.getElementById(this._addUID("GPlocationStageAdd")).className=""))}}}};return e}(CommonUtilsSelectorID),LeafletControlsUtilsPositionFormater=function(){var t={NORTH:"N",SOUTH:"S",EAST:"E",WEST:"W",digitSecond:2,digitDecimal:5,digitRadian:8,roundToDecimal:function(t,e){var i=Math.pow(10,e);return Math.round(t*i)/i},decimalToRadian:function(t){var e=.017453292519943295;return this.roundToDecimal(t*e,this.digitRadian)},decimalToGrade:function(t){var e=1.1111111111111112;return this.roundToDecimal(t*e,this.digitRadian)},decimalToDMS:function(t,e){t<0&&(t*=-1);var i=Math.floor(t),n=60*(t-i),o=Math.floor(n),s=60*(n-o),r=this.roundToDecimal(s,this.digitSecond),a=i+"° "+o+"' "+r+'" ';return e&&(a+=e),a},decimalLatToDMS:function(t){var e=t<0?this.SOUTH:this.NORTH;return this.decimalToDMS(t,e)},decimalLongToDMS:function(t){var e=t<0?this.WEST:this.EAST;return this.decimalToDMS(t,e)},DMSToDecimal:function(t,e,i,n){var o=t+e/60+i/3600;o=n==this.SOUTH||n==this.WEST?o*-1:o;var s=this.roundToDecimal(o,this.digitDecimal);return s}};return t}(),LeafletControlsUtilsIconDefault=function(t){var e=t.Icon.Default.extend({images:{shadow:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAYAAACoYAD2AAAC5ElEQVRYw+2YW4/TMBCF45S0S1luXZCABy5CgLQgwf//S4BYBLTdJLax0fFqmB07nnQfEGqkIydpVH85M+NLjPe++dcPc4Q8Qh4hj5D/AaQJx6H/4TMwB0PeBNwU7EGQAmAtsNfAzoZkgIa0ZgLMa4Aj6CxIAsjhjOCoL5z7Glg1JAOkaicgvQBXuncwJAWjksLtBTWZe04CnYRktUGdilALppZBOgHGZcBzL6OClABvMSVIzyBjazOgrvACf1ydC5mguqAVg6RhdkSWQFj2uxfaq/BrIZOLEWgZdALIDvcMcZLD8ZbLC9de4yR1sYMi4G20S4Q/PWeJYxTOZn5zJXANZHIxAd4JWhPIloTJZhzMQduM89WQ3MUVAE/RnhAXpTycqys3NZALOBbB7kFrgLesQl2h45Fcj8L1tTSohUwuxhy8H/Qg6K7gIs+3kkaigQCOcyEXCHN07wyQazhrmIulvKMQAwMcmLNqyCVyMAI+BuxSMeTk3OPikLY2J1uE+VHQk6ANrhds+tNARqBeaGc72cK550FP4WhXmFmcMGhTwAR1ifOe3EvPqIegFmF+C8gVy0OfAaWQPMR7gF1OQKqGoBjq90HPMP01BUjPOqGFksC4emE48tWQAH0YmvOgF3DST6xieJgHAWxPAHMuNhrImIdvoNOKNWIOcE+UXE0pYAnkX6uhWsgVXDxHdTfCmrEEmMB2zMFimLVOtiiajxiGWrbU52EeCdyOwPEQD8LqyPH9Ti2kgYMf4OhSKB7qYILbBv3CuVTJ11Y80oaseiMWOONc/Y7kJYe0xL2f0BaiFTxknHO5HaMGMublKwxFGzYdWsBF174H/QDknhTHmHHN39iWFnkZx8lPyM8WHfYELmlLKtgWNmFNzQcC1b47gJ4hL19i7o65dhH0Negbca8vONZoP7doIeOC9zXm8RjuL0Gf4d4OYaU5ljo3GYiqzrWQHfJxA6ALhDpVKv9qYeZA8eM3EhfPSCmpuD0AAAAASUVORK5CYII=",color:{blue:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAGmklEQVRYw7VXeUyTZxjvNnfELFuyIzOabermMZEeQC/OclkO49CpOHXOLJl/CAURuYbQi3KLgEhbrhZ1aDwmaoGqKII6odATmH/scDFbdC7LvFqOCc+e95s2VG50X/LLm/f4/Z7neY/ne18aANCmAr5E/xZf1uDOkTcGcWR6hl9247tT5U7Y6SNvWsKT63P58qbfeLJG8M5qcgTknrvvrdDbsT7Ml+tv82X6vVxJE33aRmgSyYtcWVMqX97Yv2JvW39UhRE2HuyBL+t+gK1116ly06EeWFNlAmHxlQE0OMiV6mQCScusKRlhS3QLeVJdl1+23h5dY4FNB3thrbYboqptEFlphTC1hSpJnbRvxP4NWgsE5Jyz86QNNi/5qSUTGuFk1gu54tN9wuK2wc3o+Wc13RCmsoBwEqzGcZsxsvCSy/9wJKf7UWf1mEY8JWfewc67UUoDbDjQC+FqK4QqLVMGGR9d2wurKzqBk3nqIT/9zLxRRjgZ9bqQgub+DdoeCC03Q8j+0QhFhBHR/eP3U/zCln7Uu+hihJ1+bBNffLIvmkyP0gpBZWYXhKussK6mBz5HT6M1Nqpcp+mBCPXosYQfrekGvrjewd59/GvKCE7TbK/04/ZV5QZYVWmDwH1mF3xa2Q3ra3DBC5vBT1oP7PTj4C0+CcL8c7C2CtejqhuCnuIQHaKHzvcRfZpnylFfXsYJx3pNLwhKzRAwAhEqG0SpusBHfAKkxw3w4627MPhoCH798z7s0ZnBJ/MEJbZSbXPhER2ih7p2ok/zSj2cEJDd4CAe+5WYnBCgR2uruyEw6zRoW6/DWJ/OeAP8pd/BGtzOZKpG8oke0SX6GMmRk6GFlyAc59K32OTEinILRJRchah8HQwND8N435Z9Z0FY1EqtxUg+0SO6RJ/mmXz4VuS+DpxXC3gXmZwIL7dBSH4zKE50wESf8qwVgrP1EIlTO5JP9Igu0aexdh28F1lmAEGJGfh7jE6ElyM5Rw/FDcYJjWhbeiBYoYNIpc2FT/SILivp0F1ipDWk4BIEo2VuodEJUifhbiltnNBIXPUFCMpthtAyqws/BPlEF/VbaIxErdxPphsU7rcCp8DohC+GvBIPJS/tW2jtvTmmAeuNO8BNOYQeG8G/2OzCJ3q+soYB5i6NhMaKr17FSal7GIHheuV3uSCY8qYVuEm1cOzqdWr7ku/R0BDoTT+DT+ohCM6/CCvKLKO4RI+dXPeAuaMqksaKrZ7L3FE5FIFbkIceeOZ2OcHO6wIhTkNo0ffgjRGxEqogXHYUPHfWAC/lADpwGcLRY3aeK4/oRGCKYcZXPVoeX/kelVYY8dUGf8V5EBRbgJXT5QIPhP9ePJi428JKOiEYhYXFBqou2Guh+p/mEB1/RfMw6rY7cxcjTrneI1FrDyuzUSRm9miwEJx8E/gUmqlyvHGkneiwErR21F3tNOK5Tf0yXaT+O7DgCvALTUBXdM4YhC/IawPU+2PduqMvuaR6eoxSwUk75ggqsYJ7VicsnwGIkZBSXKOUww73WGXyqP+J2/b9c+gi1YAg/xpwck3gJuucNrh5JvDPvQr0WFXf0piyt8f8/WI0hV4pRxxkQZdJDfDJNOAmM0Ag8jyT6hz0WGXWuP94Yh2jcfjmXAGvHCMslRimDHYuHuDsy2QtHuIavznhbYURq5R57KpzBBRZKPJi8eQg48h4j8SDdowifdIrEVdU+gbO6QNvRRt4ZBthUaZhUnjlYObNagV3keoeru3rU7rcuceqU1mJBxy+BWZYlNEBH+0eH4vRiB+OYybU2hnblYlTvkHinM4m54YnxSyaZYSF6R3jwgP7udKLGIX6r/lbNa9N6y5MFynjWDtrHd75ZvTYAPO/6RgF0k76mQla3FGq7dO+cH8sKn0Vo7nDllwAhqwLPkxrHwWmHJOo+AKJ4rab5OgrM7rVu8eWb2Pu0Dh4eDgXoOfvp7Y7QeqknRmvcTBEyq9m/HQQSCSz6LHq3z0yzsNySRfMS253wl2KyRDbcZPcfJKjZmSEOjcxyi+Y8dUOtsIEH6R2wNykdqrkYJ0RV92H0W58pkfQk7cKevsLK10Py8SdMGfXNXATY+pPbyJR/ET6n9nIfztNtZYRV9XniQu9IA2vOVgy4ir7GCLVmmd+zjkH0eAF9Po6K61pmCXHxU5rHMYd1ftc3owjwRSVRzLjKvqZEty6cRUD7jGqiOdu5HG6MdHjNcNYGqfDm5YRzLBBCCDl/2bk8a8gdbqcfwECu62Fg/HrggAAAABJRU5ErkJggg==",orange:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAASAAAAEgARslrPgAABghJREFUWMOdl1uInGcdxn/feWa+mflmJmZbqVqKigewKK5goHgRSEm8EC88F6tBFLfgZbzJnVdRYWExrVBoXazWlAYL0dVisLBYzEUUSbeNjZQmxGZ3NjO7c57v/P69mNnD7MzuzvrCA8PM+/+e93n+h/cb7c9PzXKE9RHAG36+BXRPP3390CDtT3MHklSA7wKngVOWbaOhA5AkEUqpKnAFePHMM9eX9yeZrMQAzgHni14ln826ZLLu2KY0TfD7XXq9NoHffxX48Zmnr6+MkSyNK6kAl4ql8qlisYxpWagoJA16gIxs1E0bI1cAoNNuslFb94Env/jM9csj+0SEXaiIyN+9cuVU5dhxdEmI23XSoAOoIckOVBISt+vE7Q0KRY8H3v+BbM7Nv7w0Nzs3QrLHopdL5crHyqUKSbdB6ndA1BRIiVs1Mo5NySsD/GJpbvbkjpKds50rFL2T5VKZpNdAkmjiAzXDHOye8FvS2cC2LWZmHjAELv1xbrYyIFGCKKmIkvMlr4iK+0gaDe0ZQHcyWIUyVqGMmDZWvoRVKGO63sg+UMSdGq6bo+R5x0XJuYFdGqDxLa9UzJumQRp0R3y3ChU002Zjc5Pbd+6wGem8e/sO6+vrBGGIVagMTdmJScMepZIHGj/4ww8/a5jDevl63s2h4nAgfbhM1yOMQt67V+WjZ87y+VNPYmXzANz7x19YufQzilFIySsTt+vbcSrsYTlZnEymEgTBCV2U5EXJiUzGJg1aI9I1w6DZbPHoE+f5+Jee2iYAeGj2cR479zyNjo+SFN12xqzLZRxEyWld4EOWbRmIApVuJ1E3LaIwRLkzPPzYl8caUURwZz7Iw1/4Cq1WG8POjBSBCvvYtonAJ3URqeiaNlYpuuXg+wHlRz41kQBAKUX5w5+m1/PHKk7SBF0DEfFMgUjJMGnaro7WFGig0nhfAhEhjQI0TRuL1wwNFSkEfF2Ee3GSjp0kDXq4WZv7b19HJeNEWySrN/5G3nUQlezpJ4MkTRHhni4i1ThOuipNByfakhsHmIZGRnV565WLYyoA1t68RuONq3j5DKnfHiXRdKIoRkTuGl/9zIMCfC7rGJ/I5vOocGsQCoiQz7vc/8+/WH37BrnKgzjFY7RWb/Pu8mVWLv2UmUoOxzYGJFtxmobhZFmrd0hS9SPtpbOPApx0s/ZfH3moRNyujU5aO4eRcWl2AjZbPn6YYFsGXt6h4mUxDX0sxioep9kJeG+9ffVrz994fKsZX+v60bVuPzzhFo6RdHY1VtRDEp9S4RilgjPyMBX2iXu90dIbFsFm20fgJwCm7BTEzzda/u/zrjVspl2JVoq4vc40yyrO0OqGdPvxa9/41Y3XYfQ+udLshO8EQYyZK0454idAKTYafUTkwrblu0Z9KjBfb/pouvl/EZhuma4f0e7H//zm4htXt0n23HaL9VZQS5IU3c4emUTTNOoNH9hRsVcJAr7As7VWgJHJDTp4SpiFMv0oodGLbwm8MkoyescjIgtrm4GvlEI37SOo0Kk1AkTkwhOLK+keEtiDmggv1FshRrYwFYGRLRJEKfV2fFeEF/dW3F67tjB/txamIoKm65N37IJu2dRaEQLz3/71m9E4ybhdiMgtEVna7EQY+Qoial/oTo4oTqk2opqIPDepd/QDzjh/vxmDOtgq3cqy3ogQuPidF97qTiaZrAQRWW776bVOkGIW3jfZJidHqoTVRtwVkYX9psCkxO/GwnojRhvMlvGE2zmqzRgRfnn2Nzdb+5McnNbL9a56x48FI+vtSbaDaPDfjSQSmD9onh1kFyKSishCtZmgW/ZY2a5txojI4vd+e7N6CMmBdiHC4lojrcWpoDsuIGimhYhwp5amIlzgkKUf1gMgXZBnq40Ew8kNBmGuxHozAeSl7//u37cPJTmUYoCLdzdVJMNcgLDWFoTDVUxrFyJURVisNhVGzqPWVvQCWRJhZSqS4Qv3NFhYaw10rbUENC4MansaJYO/DtPgZi+QK7W20OrLsih5XZRMSTJdTrZHzWpzkIut76az62hrueXzHPDqUYL+B8XVKUzuUimfAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDEyLTA4LTE4VDE0OjUwOjU2KzAxOjAwFlCkXwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxMi0wOC0xOFQxNDo1MDo1NiswMTowMGcNHOMAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAAAElFTkSuQmCC",red:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAASAAAAEgARslrPgAABe5JREFUWMOdlWuIXGcZx3/nPbe5ZWbO2c0a8VIEpSq0io2QBT8FUlIFEbzfokUUKfgxIuSbn+JtYTEQqFQCQmkxVIiNFhcLwZoVtrFNt40ESrPEJju7s/eZM+f+Pn6Y2XVnZ3Zn0/fwcA7veZ/ze5//87zPMf56fJIHGB8Far3n20D79Nz1kU7GXw6G+MD3gdPAKdtxMJQFQJZEaK0bwBXg2Sfmrl87AHJi2LwJnAXOVf3xSrFcoVAuDyzKs4yw3SLY2iTqBC8BP31ibnZ+AHJ1MBIfeK7qeaeqno9l2+g4IQ86ILpvoXIczCMVAFob66wuLYXAmc/PXb/cB3nxsRN7AdfrY2MPe+Pj6Cjufnyk6Aa2XyfshLQ21glarae+8OrsxZ3N7JHoj3Xff9jzx8jWN8hbbdB6tOU5aXOVguNQ98YAfnv1+OTJHYgAPTt7pFY76Xk+2fo6kiSg8wEzLLMr25B32eoqjm0x8b5jpsBzLx6f9LsQARF8Ec7Vq1V0J0CSuM9ZFVxsr47t1RHHxq7XsL06Vq06AEqby5RLReq12lERzvbkEkC+VatWKpapyNtt6JERwfY9DMdmdW2NOwsLrCmDdxYWWFpaIopjbN/rarLLJw8C6rUqID/682MnTEsQgK9XSiV0nHQ17g2rViWOI95tLPOxJ89w4sx3sCvdarr3txnmf/kbqnFE3auTrqzu+OkgwC4WcAuuH0XRpBKhIsJkwbHJN9f79TcVG5tbPHruZ3z8qR/vAAA+8PgpPvf737Eehug8Rbn2gHQl10WE00rgw7ZtmdtVspMH2yKJY/TEBA996YsDVSsilD/0QR76ypfZ3GphFgp9AN3p4FgmAp9UIuIrQw2UpXJdwijGe+SRoQAArTXepz9FEEbdfOzylyxHddfWLEESLbpblrtPtM4AQafJvgARIY8iDMMY8DcM6a5BQiUY99I8H9hJHgSUHZvluVfRaToA2obc/8c/qbg2kqV9/oapyPIcwbinRKSRZnlb53l3R9vhRjGWAYV2i7cuXByIAmBx9l+sz8xQK7jkW1v9EKVI0hQRuWt+9dj7Bfhs0VSfKFZK6CDoq/lKucTya69x/+Y8pWPHcMd8Nu8s8M7lF5j/xa+ZKBVwTdWFbPsZBmaxwGIrINP6J8bzj34G4GTZcf7+kXqFtNns77SlMma5xEaUsBbGhFmGY5rUXBu/6GIpNeBjHz3KRpTw7lZ75ms3bzxudQXg5XaSzLbjZLI8Nka2srLrYLWRqEPdH6Pu2n0f050OaRD0l54yQIS1MELg5wDbEIBfrYbRCxW3MvDfkEyTLi+NavjdKMYn2Ixi2mn28jdu3nil1yCFnl3ZiNO3ozjtNb5DtPihbV+z2okRkfPDWn0uMLUSxhim9Z4AlufRThK20uzGN9/498wOhN0HUfSllShuZnmOKhXZ826kGYbBSicG0ed3S7g7EgRCgaebYYxZLvW/GWGW79HJM9bT7LbAn/oh/8/Jtk0vRkmotUY5zqGlMpSi2cvFt+dfz/dEYrDHmoLxh5Uwxjxy5FAAs1olynJWUn1XMJ7dW3FKGHpN3Y2yXEQwTDVSKuU6NKMEQaa+++brySBkUC5E5LaIXF2LE0zfR7Te11SpRJLlNJK8KSLPDDs76oA9Ti3H+UipVLHIUpggcOF7b73RHg4ZHgkicm0r17OtLMc6Oj5cpnKJXAv3U90Wken9uoAaUZzTS1GGIQxPeLFEI04RuPjkrfnN9wq5vKJ5OxTBrNb2JNtFFPw3lURg6qB+dpBciEguItONOEO5zkDZLoYpInLpB7fmGwdDRp/nS4sZzVQEVS6DCIZjIyIspOQC5xkx1O6/4D7WRuTpRpRhlkrdRlirsxRnIPL8D//z5p2RkH0O497rwt2cRBBUwQWExVwQZGQUPchAWxlmDcG41Eg0Zq1GM9EEoq4KxvyhIA/QaacXs+5z736+O3+YSEamZMduBaKuNFNhU9Q1EV6RwzEOnZOdxnk/7eZie+aQcj3QuLaJegZ46UGc/gcUeTtzDg/o4wAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxMi0wOC0xOFQxNDo1MDo1NiswMTowMBZQpF8AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTItMDgtMThUMTQ6NTA6NTYrMDE6MDBnDRzjAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAABJRU5ErkJggg==",green:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wJCgoDDgqHD/MAAAZVSURBVFjDpZZtiFxXGcd/c+69M7PzurvdTTZNGvxQTCJqFSok+MmFQPSDUlsQhBaxWNhorQlWPxSKTYqsFLYGA8VCISDESIpCILYQW4xJNtHGGBooZtl16UrKNrMvM7N3Xu6555zHD7OZ7OzsW/Be/nBnznnO/zzP83/OcxKPv/IOW32KXzj2KFBc/nm7cuvl8IOXD21ql3j8lT9vsOjxfuB7wCHgoAoUCV8BYJsWRGaBc8DpvzwxfnF9kl90kxQ+f9wDXgReyg9kc8VkH4Wg2DUvdpqyXqRcKxOH5l3gZ+89OX5rDZLzqwhe7QfOZAcyB4fSO0h6KbSNqNt6F0lSJcn4WQA+bcyycHehATzz3pPjb6+cp0SEe8jvOdYvsRvPDmQOPpLZjRXLYjRPzYSIuC5EtsliNE9ZL7ItvY2dD+/sSRaDs8Nn9o90kLQ92HvcA87mduT27Mw8QiWuUDMhVuymMC5mPpoj42UYyu0A+M3wmf3D90lEQATgxfT29PDDPTup6jKx08gar6+CNf8XhEW9QEqlGNw16AFnhs/s72+FC6Gw79V+4KXtPUPUbZ3IRR07DVSSQlCkEBRRCdX+zvn5Lq/mohKFoEh2KDO4LB4ULUe+mxpI5RSKMA5xIm0Ug16SKsknjTtMfTxFGIdMfTzFzOIMoVmiGPQCdNjUTY3B9HZEeO5rv9/v+YggwncK6QKxxB3qyQU5aibk7iclvv3YUzz91WfJ+wUALsy+w+sf/opGusFgahuLerFt17BN0l4PQc7v10vmgJ/f98sccCDjZ5mP5jpIvITHYljm+QNH+NaupzrGDg59nc/m9/KDC08TD8UEyqdhG+1xh8PP+eglc0jhZLeXUp4V2yFPPxFQNzWymWwXAYAg7M5+hm/s+yZzzRIpL91hXzc1kioAJ59TQH9C3WOXNlJeitCEfLH3S2sSAFgxPNb7ZXQl7rJ3IiRaCxd9caLFgXUGcdJeyDiDiKBdtC6BE6FhGygv0WUvnsOKRZw0FHDHRg6HdCzWtHXyQZ4bn17HrBKEFdNaAMel0l/xcz5WbOd5hcI4A3BHiWPWaReKuNYOjEOMw2hDggQudpyceL3DC9cqXsZLl7g+9Q8KQYEls9S2FePwEgrbsIhjxuvb+2tJDYx/RXJuXzbI0dRR+xBwypDtyXLrvx9yLbzC9vR2HkoO8J9wkrMzp/nt+Bv0DKbwVUCj0VxxeEAQJKneDRErz/siAk5ONueiJzI7MrAirroe4zJC70NFphem+PnkUWzkUH6CZG9A364iXsKjulTprK98nqV6Fde0F/72/Q8+8hGh8u+fvl/Y89rVWn/tQDaXI6wu3e8ZYYzxLflsjlymU2UN2yAO4zUbVXNeIyLHAHzuJ/w1XY7/mN7mWKUBJHZUy9UttehsMUtYD7EN8/6lZ69fBmiFCxDLuWhBT0b90aN+zm9r/0EfEdfywjLaddRXJ45aYCxa0PjKp53FB0CqN0mzGWFC88/Lz12/sKIzrpjn5FRzLioZZ/B6fMTxQFAkiBY04mS0szOuYKlOHG0g8mazFOGlFGJly0jmfXQ9Rpf1bUT+tG6PX87PiWg+aiDgpbyWpLeARKCIyjHA6JWRG3ZVjxdWojJxpAT8rjkX4We9LSU7KATYhiWu6Bng9OpxtVYCxTHWLEX2XmE6tzGUnyAqx4hj7MrIDd1FsjpcIkJl4oXbYuW8rhqSfUkkduvCSymsdkRzUUmsvLWWp2o9OYqTsWhRb6pcP+ujyzHi5OTVH/8rXJNkLU9EhOrUCxdNzVw1NUN6ILlmsv2MhxhHcy4KgRPr5awr8Z3ghC7r5Uru3oif8YgWNMAb135ys7I+yYbx4O24aiZt5Ej2JjsvGSkPBKJ5rRHGNlLfuuESESqTP7IiLW+UrxBLG0E+aFW3cOrakZuzG5JsHC4BOKUrpuRM64ojTlB+AhGhOa8tMLpZHanN1FOZ/GEIvBlXYvweBSIk+wJ0q7r/8PejN6c3JdnSCevkZLSgtdhWLsSBLmtYdRD+H+ESKlOHZ8XJqbgaExQC4iWD0+58Zerwra2RbM7B8qX8hK7EiBN0WSPC6OoOun5O2NpbnT78kdXunKlbbOQuVqcPX5YtsqgH636M6bIGYbTj/rN5Trb+VKdHLtqme6s6PfLug9j9D/FCc1g2qf7VAAAAAElFTkSuQmCC"}},initialize:function(e,i){switch(t.Util.extend(this.options,i),e){case"red":this.options.iconUrl=this.images.color.red;break;case"green":this.options.iconUrl=this.images.color.green;break;case"orange":this.options.iconUrl=this.images.color.orange;break;case"blue":this.options.iconUrl=this.images.color.blue;break;default:this.options.iconUrl=this.images.color.blue}this.options.shadowUrl=this.images.shadow}});return e}(leaflet),LeafletControlsLocationSelector=function(t,e,i,n,o,s,r,a){var l=t.Control.extend({includes:s,options:{position:"topleft",tag:{id:0,unique:null,label:">",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;i<t.length;i++)this._createLocationAutoCompletedLocationElement(this.options.tag.id,t[i],i);this._suggestedLocations=t}},_requestReverseGeocode:function(e){if(e&&0!==Object.keys(e).length&&e.position&&0!==Object.keys(e.position).length){if(this._noRightManagement)return void console.log("no rights for all service !?");if(!this._resources.ReverseGeocode)return void console.log("no rights for this service !?");var n=this._resources.ReverseGeocode.resources;if(n&&0!==Object.keys(n).length){var o=this._resources.ReverseGeocode.key,s={};t.Util.extend(s,this.options.reverseGeocodeOptions),t.Util.extend(s,e),t.Util.extend(s,{returnFreeForm:!0,filterOptions:{type:["StreetAddress"]}}),t.Util.extend(s,{apiKey:s.apiKey||this.options.apiKey||o}),i.Services.reverseGeocode(s)}}},_displayResultOfCoordinate:function(t){this._setCoordinate(t),this._setMarker({x:t.lng,y:t.lat},null,!1),this.onActivateMapPointClick()},_displayResultOfLabel:function(t){var e=t.placeAttributes,i=e.number+" "+e.street+", "+e.postalCode+" "+e.commune;this._setCoordinate({lat:t.position.x,lng:t.position.y}),this._setLabel(i),this._setMarker({x:t.position.y,y:t.position.x},null,!1),this._inputShowPointerContainer.checked=!1,this._inputAutoCompleteContainer.className="GPlocationOriginVisible",this._inputCoordinateContainer.className="GPlocationOriginHidden",this.onActivateMapPointClick()},onAutoCompleteSearchText:function(t){var e=t.target.value;if(e){if(this._noRightManagement)return void console.log("no rights for this service !?");if(this._currentLocation=e,!(e.length<3)){var i=this;this._requestAutoComplete({text:e,maximumResponses:5,onSuccess:function(t){if(t){var e=t.suggestedLocations;i._fillAutoCompletedLocationListContainer(e)}},onFailure:function(t){i._clearSuggestedLocation()}})}}},onAutoCompletedResultsItemClick:function(t){var e=o.index(t.target.id);if(e){var i={x:this._suggestedLocations[e].position.x,y:this._suggestedLocations[e].position.y},n={type:this._suggestedLocations[e].type,fields:this._suggestedLocations[e]},s=this._suggestedLocations[e].fullText;this._setLabel(s),this._setPosition(i),this._setMarker(i,n,this.options.displayInfo),this._coordinate=i}},onActivateMapPointClick:function(t){var e=this._map;this._inputShowPointerContainer.checked?this._activeDragAndDrop||(e.on("click",this.onMouseMapClick,this),this._setCursor("crosshair"),this._setMarker(),this._clearResults()):this._activeDragAndDrop||(e.off("click",this.onMouseMapClick,this),this._setCursor())},onLocationClearPointClick:function(t){this._setCursor(),this._setMarker(),this._clearResults(),this._inputAutoCompleteContainer.focus()},onLocationRemovePointClick:function(t){this._setCursor(),this._setMarker(),this._clearResults()},onLocationAddPointClick:function(t){},onMouseMapClick:function(t){var e=t.latlng;if(this.options.disableReverse||this._noRightManagement)this._displayResultOfCoordinate(e);else{var i=this;this._requestReverseGeocode({position:{x:e.lat,y:e.lng},srs:"EPSG:4326",onSuccess:function(t){if(0!==t.locations.length){var n=t.locations[0];i._displayResultOfLabel(n)}else i._displayResultOfCoordinate(e)},onFailure:function(t){i._displayResultOfCoordinate(e)}})}},onStartDragMarker:function(){this._marker&&(this._activeDragAndDrop=!0,this._inputShowPointerContainer.checked=!0,this._inputAutoCompleteContainer.className="GPlocationOriginHidden",this._inputCoordinateContainer.className="GPlocationOriginVisible",this._marker.unbindPopup(),this._setLabel(),this._clearResults())},onDragMarker:function(){if(this._marker){this._activeDragAndDrop=!1,this._inputShowPointerContainer.checked=!0;var t=this._marker.getLatLng();this._setCoordinate(t)}},onEndDragMarker:function(){if(this._marker){this._inputShowPointerContainer.checked=!0;var t=this._marker.getLatLng();this._pressedKeyOnDragAndDrop?this._setCoordinate(t):this.onMouseMapClick({latlng:t}),this._activeDragAndDrop=!1,this._pressedKeyOnDragAndDrop=!1}},onMouseDownMarker:function(t){this._marker&&(this._pressedKeyOnDragAndDrop=t.originalEvent.ctrlKey)}});return l}(leaflet,{},gp,CommonUtilsCheckRightManagement,CommonUtilsSelectorID,CommonControlsLocationSelectorDOM,LeafletControlsUtilsPositionFormater,LeafletControlsUtilsIconDefault),CommonControlsIsoDOM=function(){var t={_addUID:function(t){return t+"-"+this._uid},_createMainContainerElement:function(){var t=document.createElement("div");return t.id=this._addUID("GPisochron"),t.className="GPwidget",t},_createShowIsoElement:function(){var t=document.createElement("input");return t.id=this._addUID("GPshowIsochron"),t.type="checkbox",t},_createShowIsoPictoElement:function(){var t=this,e=document.createElement("label");e.id=this._addUID("GPshowIsochronPicto"),e.className="GPshowAdvancedToolPicto",e.htmlFor=this._addUID("GPshowIsochron"),e.title="Calculer une isochrone",e.addEventListener?e.addEventListener("click",function(e){t.onShowIsoPanelClick(e)}):e.attachEvent&&e.attachEvent("onclick",function(e){t.onShowIsoPanelClick(e)});var i=document.createElement("span");return i.id=this._addUID("GPshowIsochronOpen"),i.className="GPshowAdvancedToolOpen",e.appendChild(i),e},_createIsoPanelElement:function(){var t=document.createElement("div");return t.id=this._addUID("GPisochronPanel"),t.className="GPpanel",t},_createIsoPanelHeaderElement:function(){var t=this,e=document.createElement("div");e.className="GPpanelHeader";var i=document.createElement("div");i.className="GPpanelTitle",i.innerHTML="Calcul d'isochrone",e.appendChild(i);var n=document.createElement("div");return n.id=this._addUID("GPisochronPanelClose"),n.className="GPpanelClose",n.title="Fermer le panneau",n.addEventListener?n.addEventListener("click",function(){
       
   146 document.getElementById(t._addUID("GPshowIsochronPicto")).click()},!1):n.attachEvent&&n.attachEvent("onclick",function(){document.getElementById(t._addUID("GPshowIsochronPicto")).click()}),e.appendChild(n),e},_createIsoPanelFormElement:function(){var t=this,e=document.createElement("form");return e.id=this._addUID("GPisochronForm"),e.addEventListener("submit",function(e){return e.preventDefault(),t.onIsoComputationSubmit(e),!1}),e},_createIsoWaitingElement:function(){var t=document.createElement("div");t.id=this._addUID("GPisochronCalcWaitingContainer"),t.className="GPisochronCalcWaitingContainerHidden";var e=document.createElement("p");return e.className="GPisochronCalcWaiting",e.innerHTML="Calcul en cours...",t.appendChild(e),t},_createIsoPanelFormTypeChoiceElement:function(){var t=document.createElement("div");return t.id=this._addUID("GPisochronChoice"),t},_createIsoPanelFormTypeChoiceChronElement:function(t){var e=this,i=document.createElement("div");i.className="GPisochronChoiceAlt";var n=document.createElement("input");n.id=this._addUID("GPisochronChoiceAltChron"),n.name="GPisochronChoiceMode",n.type="radio",n.checked=!!t,n.addEventListener?n.addEventListener("change",function(t){document.getElementById(e._addUID("GPisochronValueChron")).className="GPflexInput",document.getElementById(e._addUID("GPisochronValueDist")).className="GPisochronValueHidden",e.onIsoTypeChoiceChange(t)},!1):n.attachEvent&&n.attachEvent("onchange",function(){document.getElementById(e._addUID("GPisochronValueChron")).className="GPflexInput",document.getElementById(e._addUID("GPisochronValueDist")).className="GPisochronValueHidden",e.onIsoTypeChoiceChange()}),n.value="isochron",i.appendChild(n);var o=document.createElement("label");o.className="GPisochronChoiceAltImg",o.htmlFor=this._addUID("GPisochronChoiceAltChron"),i.appendChild(o);var s=document.createElement("span");return s.id=this._addUID("GPisochronChoiceAltChronTxt"),s.innerHTML="isochrone",s.addEventListener?s.addEventListener("click",function(){document.getElementById(e._addUID("GPisochronChoiceAltChron")).click()},!1):s.attachEvent&&s.attachEvent("onclick",function(){document.getElementById(e._addUID("GPisochronChoiceAltChron")).click()}),i.appendChild(s),i},_createIsoPanelFormTypeChoiceDistElement:function(t){var e=this,i=document.createElement("div");i.className="GPisochronChoiceAlt";var n=document.createElement("input");n.id=this._addUID("GPisochronChoiceAltDist"),n.name="GPisochronChoiceMode",n.type="radio",n.checked=!!t,n.addEventListener?n.addEventListener("change",function(t){document.getElementById(e._addUID("GPisochronValueDist")).className="GPflexInput",document.getElementById(e._addUID("GPisochronValueChron")).className="GPisochronValueHidden",e.onIsoTypeChoiceChange(t)},!1):n.attachEvent&&n.attachEvent("onchange",function(){document.getElementById(e._addUID("GPisochronValueDist")).className="GPflexInput",document.getElementById(e._addUID("GPisochronValueChron")).className="GPisochronValueHidden",e.onIsoTypeChoiceChange()}),n.value="isodistance",i.appendChild(n);var o=document.createElement("label");o.className="GPisochronChoiceAltImg",o.htmlFor=this._addUID("GPisochronChoiceAltDist"),i.appendChild(o);var s=document.createElement("span");return s.id=this._addUID("GPisochronChoiceAltDistTxt"),s.innerHTML="isodistance",s.addEventListener?s.addEventListener("click",function(){document.getElementById(e._addUID("GPisochronChoiceAltDist")).click()},!1):s.attachEvent&&s.attachEvent("onclick",function(){document.getElementById(e._addUID("GPisochronChoiceAltDist")).click()}),i.appendChild(s),i},_createIsoPanelFormValueIsochronElement:function(t){var e=this,i=document.createElement("div");i.id=this._addUID("GPisochronValueChron"),i.className=t?"GPflexInput":"GPisochronValueHidden";var n=document.createElement("label");n.id=this._addUID("GPisochronValueChronLabel"),n.htmlFor=this._addUID("GPisochronValueChronInput"),n.innerHTML="Temps",i.appendChild(n);var o=document.createElement("input");o.id=this._addUID("GPisochronValueChronInput1"),o.min="0",o.step="1",o.value="0",o.type="number",o.addEventListener?o.addEventListener("change",function(t){"function"==typeof e.onIsoValueChronTimeMinuteChange&&e.onIsoValueChronTimeHourChange(t)}):o.attachEvent&&o.attachEvent("onchange",function(t){"function"==typeof e.onIsoValueChronTimeMinuteChange&&e.onIsoValueChronTimeHourChange(t)}),i.appendChild(o);var s=document.createElement("label");s.innerHTML="h",i.appendChild(s);var r=document.createElement("input");r.id=this._addUID("GPisochronValueChronInput2"),r.min="0",r.max="59",r.step="1",r.value="0",r.type="number",r.addEventListener?r.addEventListener("change",function(t){"function"==typeof e.onIsoValueChronTimeMinuteChange&&e.onIsoValueChronTimeMinuteChange(t)}):r.attachEvent&&r.attachEvent("onchange",function(t){"function"==typeof e.onIsoValueChronTimeMinuteChange&&e.onIsoValueChronTimeMinuteChange(t)}),i.appendChild(r);var a=document.createElement("label");return a.innerHTML="min",i.appendChild(a),i},_createIsoPanelFormValueIsodistanceElement:function(t){var e=this,i=document.createElement("div");i.id=this._addUID("GPisochronValueDist"),i.className=t?"GPflexInput":"GPisochronValueHidden";var n=document.createElement("label");n.id=this._addUID("GPisochronValueDistLabel"),n.htmlFor=this._addUID("GPisochronValueDistInput"),n.innerHTML="Distance",i.appendChild(n);var o=document.createElement("input");o.id=this._addUID("GPisochronValueDistInput"),o.min="0",o.step="any",o.value="0",o.type="number",o.addEventListener?o.addEventListener("change",function(t){"function"==typeof e.onIsoValueDistChange&&e.onIsoValueDistChange(t)}):o.attachEvent&&o.attachEvent("onchange",function(t){"function"==typeof e.onIsoValueDistChange&&e.onIsoValueDistChange(t)}),i.appendChild(o);var s=document.createElement("label");return s.innerHTML="km",i.appendChild(s),i},_createIsoPanelFormModeChoiceElement:function(){var t=document.createElement("div");return t.id=this._addUID("GPisochronModeChoice"),t},_createIsoPanelFormModeChoiceTransportElement:function(t){var e=this,i=document.createElement("div");i.id=this._addUID("GPisochronTransportChoice");var n=document.createElement("span");n.className="GPisochronModeLabel",n.innerHTML="Mode de transport",i.appendChild(n);for(var o=0;o<t.length;o++){var s=t[o];if("Voiture"===s){var r=document.createElement("input");r.id=this._addUID("GPisochronTransportCar"),r.type="radio",r.name="GPisochronTransport",0===o&&(r.checked=!0),r.addEventListener?r.addEventListener("change",function(t){e.onIsoModeTransportChange(t)}):r.attachEvent&&r.attachEvent("onchange",function(t){e.onIsoModeTransportChange(t)}),r.value="Voiture",i.appendChild(r);var a=document.createElement("label");a.className="GPisochronTransportImg",a.htmlFor=this._addUID("GPisochronTransportCar"),a.title="Voiture",i.appendChild(a)}if("Pieton"===s){var l=document.createElement("input");l.id=this._addUID("GPisochronTransportPedestrian"),l.type="radio",l.name="GPisochronTransport",0===o&&(l.checked=!0),l.addEventListener?l.addEventListener("change",function(t){e.onIsoModeTransportChange(t)}):l.attachEvent&&l.attachEvent("onchange",function(t){e.onIsoModeTransportChange(t)}),l.value="Pieton",i.appendChild(l);var c=document.createElement("label");c.className="GPisochronTransportImg",c.htmlFor=this._addUID("GPisochronTransportPedestrian"),c.title="Piéton",i.appendChild(c)}}return i},_createIsoPanelFormModeChoiceDirectionElement:function(t){var e=this,i=document.createElement("div");i.id=this._addUID("GPisochronDirectionChoice");var n=document.createElement("span");n.className="GPisochronModeLabel",n.innerHTML="Sens de parcours",i.appendChild(n);var o=document.createElement("select");o.id=this._addUID("GPisochronDirectionSelect"),o.className="GPinputSelect",o.addEventListener("change",function(t){e.onIsoModeDirectionChange(t)});for(var s=0;s<t.length;s++){var r=t[s];if("departure"===r.toLowerCase()){var a=document.createElement("option");0===s&&(a.selected="selected"),a.value="departure",a.text="Départ",o.appendChild(a)}if("arrival"===r.toLowerCase()){var l=document.createElement("option");0===s&&(l.selected="selected"),l.value="arrival",l.text="Arrivée",o.appendChild(l)}}return i.appendChild(o),i},_createShowIsoExclusionsElement:function(){var t=document.createElement("input");return t.id=this._addUID("GPshowIsoExclusions"),t.type="checkbox",t},_createShowIsoExclusionsPictoElement:function(){var t=document.createElement("label");return t.id=this._addUID("GPshowIsoExclusionsPicto"),t.className="GPshowMoreOptions GPshowIsoExclusionsPicto",t.htmlFor=this._addUID("GPshowIsoExclusions"),t.title="Exclusions",t.style.top="240px",t},_createIsoPanelFormExclusionsElement:function(){var t=document.createElement("div");t.id=this._addUID("GPisoExclusions");var e=document.createElement("span");return e.className="GPisoExclusionsLabel",e.innerHTML="Passages autorisés",t.appendChild(e),t},_createIsoPanelFormExclusionOptionsElement:function(t){var e=this,i=document.createElement("div");i.className="GPisoExclusionsOptions";for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];switch(n){case"toll":var s=document.createElement("input");s.id=this._addUID("GPisoExclusionsToll"),s.type="checkbox",s.checked=!o,s.addEventListener?s.addEventListener("change",function(t){e.onIsoExclusionsChange(t)}):s.attachEvent&&s.attachEvent("onchange",function(t){e.onIsoExclusionsChange(t)}),s.value="Toll",i.appendChild(s);var r=document.createElement("label");r.className="GPisoExclusionsOption",r.htmlFor=this._addUID("GPisoExclusionsToll"),r.innerHTML="Péages",i.appendChild(r);break;case"tunnel":var a=document.createElement("input");a.id=this._addUID("GPisoExclusionsTunnel"),a.type="checkbox",a.checked=!o,a.addEventListener?a.addEventListener("change",function(t){e.onIsoExclusionsChange(t)}):a.attachEvent&&a.attachEvent("onchange",function(t){e.onIsoExclusionsChange(t)}),a.value="Tunnel",i.appendChild(a);var l=document.createElement("label");l.className="GPisoExclusionsOption",l.htmlFor=this._addUID("GPisoExclusionsTunnel"),l.innerHTML="Tunnels",i.appendChild(l);break;case"bridge":var c=document.createElement("input");c.id=this._addUID("GPisoExclusionsBridge"),c.type="checkbox",c.checked=!o,c.addEventListener?c.addEventListener("change",function(t){e.onIsoExclusionsChange(t)}):c.attachEvent&&c.attachEvent("onchange",function(t){e.onIsoExclusionsChange(t)}),c.value="Bridge",i.appendChild(c);var h=document.createElement("label");h.className="GPisoExclusionsOption",h.htmlFor=this._addUID("GPisoExclusionsBridge"),h.innerHTML="Ponts",i.appendChild(h)}}return i},_createIsoSubmitFormElement:function(){var t=document.createElement("input");return t.id=this._addUID("GPisochronSubmit"),t.className="GPinputSubmit",t.type="submit",t.value="Calculer",t},_createIsoFormResetElement:function(){var t=this,e=document.createElement("div");return e.id=this._addUID("GPisochronReset"),e.title="Réinitialiser les paramètres",e.addEventListener("click",function(e){t.onIsoResetClick(e)}),e}};return t}(),LeafletControlsIsocurve=function(t,e,i,n,o,s,r){var a=t.Control.extend({includes:r,options:{position:"topleft",collapsed:!0,methods:["time","distance"],graphs:["Voiture","Pieton"],exclusions:{toll:!1,tunnel:!1,bridge:!1},directions:["departure","arrival"],disableReverse:!1,isocurveOptions:{},autocompleteOptions:{}},initialize:function(e){t.Util.setOptions(this,e),this._uid=o.generate(),this._isDesktop=this._detectSupport(),this._waitingContainer=null,this._showContainer=null,this._formContainer=null,this._submitContainer=null,this._currentTransport=null,this._currentDirection=null,this._currentComputation=null,this._currentTimeHour=0,this._currentTimeMinute=0,this._currentDistance=0,this._currentExclusions=[],this._initTransport(),this._initComputation(),this._initDirection(),this._initExclusions(),this._currentPoint=null,this._geojsonIso=null,this._waiting=!1,this._timer=null,this._currentIsoResults=null,this._resources={},this._noRightManagement=!1,this._checkRightsManagement()},onAdd:function(e){var i=this._container=this._initLayout(e);return t.DomEvent.disableClickPropagation(i).disableScrollPropagation(i),i},onRemove:function(){},_initTransport:function(){this._currentTransport="Voiture";var e=this.options.graphs;e&&0!==e.length||(this.options.graphs=["Voiture","Pieton"]),t.Util.isArray(e)&&e.length&&("Voiture"!==e[0]&&"Pieton"!==e[0]||(this._currentTransport=e[0]));var i=this.options.isocurveOptions;i.graph&&(this._currentTransport=i.graph)},_initDirection:function(){this._currentDirection="departure";var e=this.options.directions;e&&0!==e.length||(this.options.directions=["departure","arrival"]),t.Util.isArray(e)&&e.length&&("departure"!==e[0]&&"arrival"!==e[0]||(this._currentDirection=e[0]));var i=this.options.isocurveOptions;i.reverse||(this._currentDirection="departure"),i.reverse===!0&&(this._currentDirection="arrival",this.options.directions=["arrival","departure"])},_initComputation:function(){this._currentComputation="time";var e=this.options.methods;e&&0!==e.length||(this.options.methods=["time","distance"]),t.Util.isArray(e)&&e.length&&("time"!==e[0]&&"distance"!==e[0]||(this._currentComputation=e[0]));var i=this.options.isocurveOptions;i.method&&(this._currentComputation=i.method),i.time&&(this._currentComputation="time"),i.distance&&(this._currentComputation="distance")},_initExclusions:function(){this._currentExclusions=[];var t=this.options.exclusions;if((!t||"object"==typeof t&&0===Object.keys(t).length)&&(this.options.exclusions={toll:!1,tunnel:!1,bridge:!1}),t&&"object"==typeof t&&Object.keys(t).length)for(var e in t)t.hasOwnProperty(e)&&t.k&&this._currentExclusions.push(e);var i=this.options.isocurveOptions;Array.isArray(i.exclusions)&&(this._currentExclusions=i.exclusions)},_checkRightsManagement:function(){var t=null,e=[],i=null;i=this.options.isocurveOptions.apiKey,t=this.options.isocurveOptions.filterOptions,e=t?t.type:[],e&&0!==e.length||(e=["Voiture","Pieton"]);var o=n.check({key:i||this.options.apiKey,resources:e,services:["Isochrone"]});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.Isochrone={},this._resources.Isochrone.resources=o.Isochrone,this._resources.Isochrone.key=o.key)},_detectSupport:function(){var t=!0,e=window.navigator.userAgent.toLowerCase();return e.indexOf("iphone")===-1&&e.indexOf("ipod")===-1&&e.indexOf("ipad")===-1&&e.indexOf("android")===-1&&e.indexOf("mobile")===-1&&e.indexOf("blackberry")===-1&&e.indexOf("tablet")===-1&&e.indexOf("phone")===-1&&e.indexOf("touch")===-1||(t=!1),e.indexOf("msie")===-1&&e.indexOf("trident")===-1||(t=!0),t},_initLayout:function(t){var e=this._createMainContainerElement(),i=this._showContainer=this._createShowIsoElement();e.appendChild(i),this.options.collapsed||(i.checked=!0);var n=this._createShowIsoPictoElement();e.appendChild(n);var o=this._createIsoPanelElement(),s=this._createIsoPanelHeaderElement();o.appendChild(s);var r=this._formContainer=this._createIsoPanelFormElement(),a=this._createIsoPanelFormPointElement(t);r.appendChild(a);for(var l=!1,c=!1,h=this._createIsoPanelFormTypeChoiceElement(),u=0;u<this.options.methods.length;u++)"time"===this.options.methods[u]&&(l=0===u,h.appendChild(this._createIsoPanelFormTypeChoiceChronElement(l))),"distance"===this.options.methods[u]&&(c=0===u,h.appendChild(this._createIsoPanelFormTypeChoiceDistElement(c)));r.appendChild(h),r.appendChild(this._createIsoPanelFormValueIsochronElement(l)),r.appendChild(this._createIsoPanelFormValueIsodistanceElement(c));var d=this._createIsoPanelFormModeChoiceElement();if(d.appendChild(this._createIsoPanelFormModeChoiceTransportElement(this.options.graphs)),d.appendChild(this._createIsoPanelFormModeChoiceDirectionElement(this.options.directions)),r.appendChild(d),this.options.exclusions&&"object"==typeof this.options.exclusions&&0!==Object.keys(this.options.exclusions).length){r.appendChild(this._createShowIsoExclusionsElement()),r.appendChild(this._createShowIsoExclusionsPictoElement());var p=this._createIsoPanelFormExclusionsElement();p.appendChild(this._createIsoPanelFormExclusionOptionsElement(this.options.exclusions)),r.appendChild(p)}var m=this._createIsoFormResetElement();r.appendChild(m);var f=this._submitContainer=this._createIsoSubmitFormElement();r.appendChild(f),o.appendChild(r);var _=this._waitingContainer=this._createIsoWaitingElement();return o.appendChild(_),e.appendChild(o),e},_createIsoPanelFormPointElement:function(t){return this._currentPoint=new s({apiKey:this.options.apiKey||null,tag:{id:0,unique:this._uid,label:"Départ",color:"red",display:!0},displayInfo:!0,disableReverse:this.options.disableReverse,autocompleteOptions:this.options.autocompleteOptions||null}),this._currentPoint.setMap(t),this._currentPoint.getContainer()},onShowIsoPanelClick:function(t){},onIsoResetClick:function(t){this._clear()},onIsoTypeChoiceChange:function(t){var e=t.target.value;e&&("isodistance"===e&&(this._currentComputation="distance"),"isochron"===e&&(this._currentComputation="time"))},onIsoModeTransportChange:function(t){var e=t.target.value;e&&(this._currentTransport=e)},onIsoModeDirectionChange:function(t){var e=t.target.value;e&&(this._currentDirection=e)},onIsoValueChronTimeHourChange:function(t){var e=t.target.value;this._timeHourContainer=t.target,e&&(this._currentTimeHour=e)},onIsoValueChronTimeMinuteChange:function(t){var e=t.target.value;this._timeMinuteContainer=t.target,e&&(this._currentTimeMinute=e)},onIsoValueDistChange:function(t){var e=t.target.value;this._distanceContainer=t.target,e&&(this._currentDistance=e)},onIsoExclusionsChange:function(t){var e=t.target.value,i=t.target.checked;if(e){for(var n=!1,o=null,s=0;s<this._currentExclusions.length;s++)this._currentExclusions[s]===e&&(o=s,n=!0);n||i||this._currentExclusions.push(e),n&&i&&this._currentExclusions.splice(o,1)}},onIsoComputationSubmit:function(){if(this._currentPoint&&this._currentPoint.getCoordinate&&this._currentPoint.getCoordinate()){var t;"time"===this._currentComputation.toLowerCase()&&(t=3600*this._currentTimeHour+60*this._currentTimeMinute);var e;if("distance"===this._currentComputation.toLowerCase()&&(e=1e3*this._currentDistance),(t||e)&&!this._noRightManagement){this._displayWaitingContainer();var i=this;this._requestIsoCurve({position:i._currentPoint.getCoordinate(),graph:i._currentTransport,exclusions:i._currentExclusions,method:i._currentComputation,reverse:"arrival"===i._currentDirection.toLowerCase(),time:t,distance:e,smoothing:!0,timeout:7e3,protocol:"XHR",onSuccess:function(t){t&&i._drawIsoResults(t)},onFailure:function(t){i._hideWaitingContainer(),i._clearIsoResultsGeometry()}})}}},_requestIsoCurve:function(e){if(e&&("object"!=typeof e||0!==Object.keys(e).length)&&e.position&&!this._noRightManagement){var n=this._resources.Isochrone;if(n){var o=n.resources;if(o&&("object"!=typeof o||0!==Object.keys(o).length)){var s={};t.Util.extend(s,e),t.Util.extend(s,this.options.isocurveOptions);for(var r=!1,a=0;a<o.length;a++)o[a]===s.graph&&(r=!0);if(!r)return void console.log("no rights for this service !?");var l=this._resources.Isochrone.key;s.apiKey=this.options.isocurveOptions.apiKey||this.options.apiKey||l,i.Services.isoCurve(s)}}}},_drawIsoResults:function(e){if(this._clearIsoResultsGeometry(),this._currentIsoResults=e,!e.geometry)return void this._hideWaitingContainer();var i=this._map,n=e.geometry,o={color:"#ff7800",weight:5,opacity:.65};this._geojsonIso=t.geoJson(n,{style:o}).addTo(i),this._hideWaitingContainer(),this._formContainer.className="GPisochroComponentHidden"},_clear:function(){this._initTransport(),this._initExclusions(),this._initComputation(),this._initDirection(),this._currentIsoResults=null,this._clearIsoResultsGeometry(),this._currentPoint.clear(),this._timeHourContainer&&(this._timeHourContainer.value=0),this._timeMinuteContainer&&(this._timeMinuteContainer.value=0),this._distanceContainer&&(this._distanceContainer.value=0)},_clearIsoResultsGeometry:function(){var t=this._map;null!=this._geojsonIso&&(t.removeLayer(this._geojsonIso),this._geojsonIso=null)},_displayWaitingContainer:function(){this._waitingContainer.className="GPisochronCalcWaitingContainerVisible",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="GPisochronCalcWaitingContainerHidden",this._waiting=!1,clearTimeout(this._timer),this._timer=null)}});return a}(leaflet,{},gp,CommonUtilsCheckRightManagement,CommonUtilsSelectorID,LeafletControlsLocationSelector,CommonControlsIsoDOM),CommonControlsMousePositionDOM=function(){var t={_addUID:function(t){var e=this._uid?t+"-"+this._uid:t;return e},_createMainContainerElement:function(){var t=document.createElement("div");return t.id=this._addUID("GPmousePosition"),t.className="GPwidget",t},_createShowMousePositionElement:function(){var t=document.createElement("input");return t.id=this._addUID("GPshowMousePosition"),t.type="checkbox",t},_createShowMousePositionPictoElement:function(t){var e=this,i=document.createElement("label");i.id=this._addUID("GPshowMousePositionPicto"),i.className="GPshowAdvancedToolPicto",i.htmlFor=this._addUID("GPshowMousePosition"),i.title="Afficher les coordonnées du curseur",i.addEventListener("click",function(i){var n="";document.getElementById(e._addUID("GPshowMousePosition")).checked||t||(n="GPmapCenterVisible"),document.getElementById("GPmapCenter").className=n,e.onShowMousePositionClick(i)});var n=document.createElement("span");return n.id=this._addUID("GPshowMousePositionOpen"),n.className="GPshowAdvancedToolOpen",i.appendChild(n),i},_createMousePositionPanelElement:function(t,e){t=!!t||"undefined"==typeof t,e=!!e||"undefined"==typeof e;var i=document.createElement("div");i.id=this._addUID("GPmousePositionPanel"),i.className="GPpanel",i.appendChild(this._createMousePositionPanelHeaderElement()),i.appendChild(this._createMousePositionPanelBasicElement(t,e));for(var n=this._createShowMousePositionSettingsElement(e),o=0;o<n.length;o++)i.appendChild(n[o]);return i},_createMapCenter:function(){var t=document.createElement("div");return t.id="GPmapCenter",t.className="",t},_createMousePositionPanelHeaderElement:function(){var t=document.createElement("div");t.className="GPpanelHeader";var e=document.createElement("div");e.className="GPpanelTitle",e.innerHTML="Coordonnées",t.appendChild(e);var i=document.createElement("div");i.id="GPmousePositionPanelClose",i.className="GPpanelClose",i.title="Fermer le panneau";var n=this;return i.addEventListener?i.addEventListener("click",function(){document.getElementById(n._addUID("GPshowMousePositionPicto")).click()},!1):i.attachEvent&&i.attachEvent("onclick",function(){document.getElementById(n._addUID("GPshowMousePositionPicto")).click()}),t.appendChild(i),t},_createMousePositionPanelBasicElement:function(t,e){var i=document.createElement("div");return i.id=this._addUID("GPmousePositionBasicPanel"),i.appendChild(this._createMousePositionPanelBasicCoordinateElement(e)),i.appendChild(this._createMousePositionPanelBasicAltitudeElement(t)),i},_createMousePositionPanelBasicCoordinateElement:function(t){var e=document.createElement("div");e.id=this._addUID("GPmousePositionCoordinate"),e.style.display=t?"block":"none";var i=document.createElement("span");i.className="GPmousePositionLabel",i.id=this._addUID("GPmousePositionLatLabel"),i.innerHTML="Latitude : ",e.appendChild(i);var n=document.createElement("span");n.className="GPmousePositionCoords",n.id=this._addUID("GPmousePositionLat"),n.innerHTML="",e.appendChild(n);var o=document.createElement("span");o.className="GPmousePositionLabel",o.id=this._addUID("GPmousePositionLonLabel"),o.innerHTML="Longitude : ",e.appendChild(o);var s=document.createElement("span");return s.className="GPmousePositionCoords",s.id=this._addUID("GPmousePositionLon"),s.innerHTML="",e.appendChild(s),e},_createMousePositionPanelBasicAltitudeElement:function(t){var e=document.createElement("div");e.id=this._addUID("GPmousePositionAltitude"),e.style.display=t?"block":"none";var i=document.createElement("span");i.className="GPmousePositionLabel",i.innerHTML="Altitude : ",e.appendChild(i);var n=document.createElement("span");return n.className="GPmousePositionCoords",n.id=this._addUID("GPmousePositionAlt"),n.innerHTML="",e.appendChild(n),e},_createShowMousePositionSettingsElement:function(t){var e=[],i=document.createElement("input");i.type="checkbox",i.id=this._addUID("GPshowMousePositionSettings");var n=document.createElement("label");return n.id=this._addUID("GPshowMousePositionSettingsPicto"),n.htmlFor=this._addUID("GPshowMousePositionSettings"),n.title="Réglages",n.className="GPshowMoreOptions GPshowMousePositionSettingsPicto",n.style.display=t?"block":"none",e.push(i),e.push(n),e},_createMousePositionSettingsElement:function(){var t=document.createElement("div");t.id=this._addUID("GPmousePositionSettings");var e=document.createElement("span");return e.className="GPmousePositionSettingsLabel",e.innerHTML="Système de référence",t.appendChild(e),t},_createMousePositionSettingsSystemsElement:function(t){var e=this,i=document.createElement("select");i.id=this._addUID("GPmousePositionProjectionSystem"),i.className="GPinputSelect GPmousePositionSettingsSelect",i.addEventListener("change",function(t){e.onMousePositionProjectionSystemChange(t)}),i.addEventListener("mouseover",function(t){e.onMousePositionProjectionSystemMouseOver(t)});for(var n=0;n<t.length;n++){var o=t[n],s=document.createElement("option");s.value=o.code,s.text=o.label||n,i.appendChild(s)}return i},_createMousePositionSettingsUnitsElement:function(t){var e=this,i=document.createElement("select");i.id=this._addUID("GPmousePositionProjectionUnits"),i.className="GPinputSelect GPmousePositionSettingsSelect",i.addEventListener("change",function(t){e.onMousePositionProjectionUnitsChange(t)});for(var n=0;n<t.length;n++){var o=t[n],s=document.createElement("option");s.value=o.code?o.code:n,s.text=o.label||n,i.appendChild(s)}return i},GPdisplayCoords:function(t){if(t&&null!=t){var e=document.getElementById(this._addUID("GPmousePositionLonLabel")),i=document.getElementById(this._addUID("GPmousePositionLatLabel"));t.x||t.y?(i.innerHTML="X : ",e.innerHTML="Y : "):t.e||t.n?(i.innerHTML="E : ",e.innerHTML="N : "):(i.innerHTML="Latitude : ",e.innerHTML="Longitude : ");var n=document.getElementById(this._addUID("GPmousePositionLat")),o=document.getElementById(this._addUID("GPmousePositionLon"));n.innerHTML=t.x||t.lat||t.e||"0",t.unit&&(n.innerHTML+=" ",n.innerHTML+=t.unit),o.innerHTML=t.y||t.lng||t.lon||t.n||"0",t.unit&&(o.innerHTML+=" ",o.innerHTML+=t.unit)}},GPdisplayElevation:function(t,e,i,n){var o,s=this;e||(e=500),clearTimeout(o),document.getElementById(this._addUID("GPmousePositionAlt")).innerHTML="...",null==i&&(i=-99999),null==n&&(n=99980);var r=i+n,a=i-n;t&&null!=t&&document.getElementById(this._addUID("GPmousePositionAltitude"))&&(o=setTimeout(function(){s.onRequestAltitude(t,function(t){a<t&&t<r?document.getElementById(s._addUID("GPmousePositionAlt")).innerHTML="--- m":document.getElementById(s._addUID("GPmousePositionAlt")).innerHTML=t+" m"})},e))}};return t}(),!function(t){if("object"==typeof exports)module.exports=t();else{proj4=function(){return"function"==typeof t?t():t}()}}(function(){return function t(e,i,n){function o(r,a){if(!i[r]){if(!e[r]){var l="function"==typeof require&&require;if(!a&&l)return l(r,!0);if(s)return s(r,!0);throw new Error("Cannot find module '"+r+"'")}var c=i[r]={exports:{}};e[r][0].call(c.exports,function(t){var i=e[r][1][t];return o(i?i:t)},c,c.exports,t,e,i,n)}return i[r].exports}for(var s="function"==typeof require&&require,r=0;r<n.length;r++)o(n[r]);return o}({1:[function(t,e){function i(t,e,n){if(!(this instanceof i))return new i(t,e,n);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&"undefined"==typeof e){var o=t.split(",");this.x=parseFloat(o[0],10),this.y=parseFloat(o[1],10),this.z=parseFloat(o[2],10)||0}else this.x=t,this.y=e,this.z=n||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}var n=t("mgrs");i.fromMGRS=function(t){return new i(n.toPoint(t))},i.prototype.toMGRS=function(t){return n.forward([this.x,this.y],t)},e.exports=i},{mgrs:66}],2:[function(t,e){function i(t,e){if(!(this instanceof i))return new i(t);e=e||function(t){if(t)throw t};var s=n(t);if("object"!=typeof s)return void e(t);var a=r(s),l=i.projections.get(a.projName);l?(o(this,a),o(this,l),this.init(),e(null,this)):e(t)}var n=t("./parseCode"),o=t("./extend"),s=t("./projections"),r=t("./deriveConstants");i.projections=s,i.projections.start(),e.exports=i},{"./deriveConstants":32,"./extend":33,"./parseCode":36,"./projections":38}],3:[function(t,e){e.exports=function(t,e,i){var n,o,s,r=i.x,a=i.y,l=i.z||0;for(s=0;3>s;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)<i?t:t-n(t)*Math.PI}},{"./sign":21}],5:[function(t,e){var i=2*Math.PI,n=t("./sign");e.exports=function(t){return Math.abs(t)<Math.PI?t:t-n(t)*i}},{"./sign":21}],6:[function(t,e){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)<n)return a}return a;
       
   147 }},{"./pj_mlfn":19}],19:[function(t,e){e.exports=function(t,e,i,n){return i*=e,e*=e,n[0]*t-i*(n[1]+e*(n[2]+e*(n[3]+e*n[4])))}},{}],20:[function(t,e){e.exports=function(t,e){var i;return t>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;e<t.datum_params.length;e++)t.datum_params[e]=parseFloat(t.datum_params[e]);(0!==t.datum_params[0]||0!==t.datum_params[1]||0!==t.datum_params[2])&&(this.datum_type=n),t.datum_params.length>3&&(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.a<y){if(m=!0,_=0,n/this.a<y)return g=i,void(v=-this.b)}else _=Math.atan2(S,C);o=M/n,s=e/n,r=1/Math.sqrt(1-this.es*(2-this.es)*s*s),c=s*(1-this.es)*r,h=o*r,f=0;do f++,l=this.a/Math.sqrt(1-this.es*h*h),v=e*c+M*h-l*(1-this.es*h*h),a=this.es*l/(l+v),r=1/Math.sqrt(1-a*(2-a)*s*s),u=s*(1-a)*r,d=o*r,p=d*c-u*h,c=u,h=d;while(p*p>E&&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)<r)&&(t.sphere=!0,t.b=t.a),t.a2=t.a*t.a,t.b2=t.b*t.b,t.es=(t.a2-t.b2)/t.a2,t.e=Math.sqrt(t.es),t.R_A&&(t.a*=1-t.es*(a+t.es*(l+t.es*c)),t.a2=t.a*t.a,t.b2=t.b*t.b,t.es=0),t.ep2=(t.a2-t.b2)/t.b2,t.k0||(t.k0=1),t.axis||(t.axis="enu"),t.datum=s(t),t}},{"./constants/Datum":25,"./constants/Ellipsoid":26,"./datum":29,"./extend":33}],33:[function(t,e){e.exports=function(t,e){t=t||{};var i,n;if(!e)return t;for(n in e)i=e[n],void 0!==i&&(t[n]=i);return t}},{}],34:[function(t,e){e.exports=function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}},{}],35:[function(t,e){var i=t("./core");i.defaultDatum="WGS84",i.Proj=t("./Proj"),i.WGS84=new i.Proj("WGS84"),i.Point=t("./Point"),i.toPoint=t("./common/toPoint"),i.defs=t("./defs"),i.transform=t("./transform"),i.mgrs=t("mgrs"),i.version=t("../package.json").version,t("./includedProjections")(i),e.exports=i},{"../package.json":67,"./Point":1,"./Proj":2,"./common/toPoint":23,"./core":28,"./defs":31,"./includedProjections":"gWUPNW","./transform":64,mgrs:66}],36:[function(t,e){function i(t){return"string"==typeof t}function n(t){return t in a}function o(t){var e=["GEOGCS","GEOCCS","PROJCS","LOCAL_CS"];return e.reduce(function(e,i){return e+1+t.indexOf(i)},0)}function s(t){return"+"===t[0]}function r(t){return i(t)?n(t)?a[t]:o(t)?l(t):s(t)?c(t):void 0:t}var a=t("./defs"),l=t("./wkt"),c=t("./projString");e.exports=r},{"./defs":31,"./projString":37,"./wkt":65}],37:[function(t,e){var i=.017453292519943295,n=t("./constants/PrimeMeridian");e.exports=function(t){var e={},o={};t.split("+").map(function(t){return t.trim()}).filter(function(t){return t}).forEach(function(t){var e=t.split("=");e.push(!0),o[e[0].toLowerCase()]=e[1]});var s,r,a,l={proj:"projName",datum:"datumCode",rf:function(t){e.rf=parseFloat(t,10)},lat_0:function(t){e.lat0=t*i},lat_1:function(t){e.lat1=t*i},lat_2:function(t){e.lat2=t*i},lat_ts:function(t){e.lat_ts=t*i},lon_0:function(t){e.long0=t*i},lon_1:function(t){e.long1=t*i},lon_2:function(t){e.long2=t*i},alpha:function(t){e.alpha=parseFloat(t)*i},lonc:function(t){e.longc=t*i},x_0:function(t){e.x0=parseFloat(t,10)},y_0:function(t){e.y0=parseFloat(t,10)},k_0:function(t){e.k0=parseFloat(t,10)},k:function(t){e.k0=parseFloat(t,10)},r_a:function(){e.R_A=!0},zone:function(t){e.zone=parseInt(t,10)},south:function(){e.utmSouth=!0},towgs84:function(t){e.datum_params=t.split(",").map(function(t){return parseFloat(t,10)})},to_meter:function(t){e.to_meter=parseFloat(t,10)},from_greenwich:function(t){e.from_greenwich=t*i},pm:function(t){e.from_greenwich=(n[t]?n[t]:parseFloat(t,10))*i},nadgrids:function(t){"@null"===t?e.datumCode="none":e.nadgrids=t},axis:function(t){var i="ewnsud";3===t.length&&-1!==i.indexOf(t.substr(0,1))&&-1!==i.indexOf(t.substr(1,1))&&-1!==i.indexOf(t.substr(2,1))&&(e.axis=t)}};for(s in o)r=o[s],s in l?(a=l[s],"function"==typeof a?a(r):e[a]=r):e[s]=r;return"string"==typeof e.datumCode&&"WGS84"!==e.datumCode&&(e.datumCode=e.datumCode.toLowerCase()),e}},{"./constants/PrimeMeridian":27}],38:[function(t,e,i){function n(t,e){var i=r.length;return t.names?(r[i]=t,t.names.forEach(function(t){s[t.toLowerCase()]=i}),this):(console.log(e),!0)}var o=[t("./projections/merc"),t("./projections/longlat")],s={},r=[];i.add=n,i.get=function(t){if(!t)return!1;var e=t.toLowerCase();return"undefined"!=typeof s[e]&&r[s[e]]?r[s[e]]:void 0},i.start=function(){o.forEach(n)}},{"./projections/longlat":50,"./projections/merc":51}],39:[function(t,e,i){var n=1e-10,o=t("../common/msfnz"),s=t("../common/qsfnz"),r=t("../common/adjust_lon"),a=t("../common/asinz");i.init=function(){Math.abs(this.lat1+this.lat2)<n||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=o(this.e3,this.sin_po,this.cos_po),this.qs1=s(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=o(this.e3,this.sin_po,this.cos_po),this.qs2=s(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=s(this.e3,this.sin_po,this.cos_po),this.ns0=Math.abs(this.lat1-this.lat2)>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)<d||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=n(this.es),this.e1=o(this.es),this.e2=s(this.es),this.e3=r(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=a(this.e,this.sinphi,this.cosphi),this.ml1=l(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<d?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=a(this.e,this.sinphi,this.cosphi),this.ml2=l(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=l(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},i.forward=function(t){var e,i=t.x,n=t.y;if(this.sphere)e=this.a*(this.g-n);else{var o=l(this.e0,this.e1,this.e2,this.e3,n);e=this.a*(this.g-o)}var s=this.ns*c(i-this.long0),r=this.x0+e*Math.sin(s),a=this.y0+this.rh-e*Math.cos(s);return t.x=r,t.y=a,t},i.inverse=function(t){t.x-=this.x0,t.y=this.rh-t.y+this.y0;var e,i,n,o;this.ns>=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)<e));--c)t.y=a;return c?(t.x=i,t.y=a,t):null},i.names=["gauss"]},{"../common/srat":22}],46:[function(t,e,i){var n=t("../common/adjust_lon"),o=1e-10,s=t("../common/asinz");i.init=function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},i.forward=function(t){var e,i,s,r,a,l,c,h,u=t.x,d=t.y;return s=n(u-this.long0),e=Math.sin(d),i=Math.cos(d),r=Math.cos(s),l=this.sin_p14*e+this.cos_p14*i*r,a=1,l>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)<s?this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(t)<s?this.EQUIT:this.OBLIQ,this.es>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)<s)return null;i=o-.5*g,i=2*(this.mode===this.S_POLE?Math.cos(i):Math.sin(i)),e=i*Math.sin(_),i*=l}}else{switch(d=0,p=0,m=0,l=Math.cos(_),c=Math.sin(_),h=Math.sin(g),u=r(this.e,h),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(d=u/this.qp,p=Math.sqrt(1-d*d)),this.mode){case this.OBLIQ:m=1+this.sinb1*d+this.cosb1*p*l;break;case this.EQUIT:m=1+p*l;break;case this.N_POLE:m=n+g,u=this.qp-u;break;case this.S_POLE:m=g-n,u=this.qp+u}if(Math.abs(m)<s)return null;
       
   148 switch(this.mode){case this.OBLIQ:case this.EQUIT:m=Math.sqrt(2/m),i=this.mode===this.OBLIQ?this.ymf*m*(this.cosb1*d-this.sinb1*p*l):(m=Math.sqrt(2/(1+p*l)))*d*this.ymf,e=this.xmf*m*p*c;break;case this.N_POLE:case this.S_POLE:u>=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)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),i=Math.cos(this.lat1),r=o(this.e,e,i),a=s(this.e,this.lat1,e),l=Math.sin(this.lat2),c=Math.cos(this.lat2),h=o(this.e,l,c),u=s(this.e,this.lat2,l),d=s(this.e,this.lat0,Math.sin(this.lat0));this.ns=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)<o)break}r/=2,Math.PI/2-Math.abs(i)<o&&(s=0);var h=.900316316158*this.a*s*Math.cos(r)+this.x0,u=1.4142135623731*this.a*Math.sin(r)+this.y0;return t.x=h,t.y=u,t},i.inverse=function(t){var e,i;t.x-=this.x0,t.y-=this.y0,i=t.y/(1.4142135623731*this.a),Math.abs(i)>.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<this.iterations;f++){var _,g,v=p,y=m,E=c,P=h;for(e=2;6>=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)<l?(t.x=this.long0,t.y=r):Math.abs(u+1)<l?(t.x=this.long0,t.y=-1*r):(t.y=s(this.e,d),t.x=o(this.long0-Math.atan2(a*Math.cos(this.gamma0)-h*Math.sin(this.gamma0),Math.cos(this.bl*e/this.al))/this.bl)),t},i.names=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","omerc"]},{"../common/adjust_lon":5,"../common/phi2z":16,"../common/tsfnz":24}],56:[function(t,e,i){var n=t("../common/e0fn"),o=t("../common/e1fn"),s=t("../common/e2fn"),r=t("../common/e3fn"),a=t("../common/adjust_lon"),l=t("../common/adjust_lat"),c=t("../common/mlfn"),h=1e-10,u=t("../common/gN"),d=20;i.init=function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=n(this.es),this.e1=o(this.es),this.e2=s(this.es),this.e3=r(this.es),this.ml0=this.a*c(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=a(o-this.long0);if(n=r*Math.sin(s),this.sphere)Math.abs(s)<=h?(e=this.a*r,i=-1*this.a*this.lat0):(e=this.a*Math.sin(n)/Math.tan(s),i=this.a*(l(s-this.lat0)+(1-Math.cos(n))/Math.tan(s)));else if(Math.abs(s)<=h)e=this.a*r,i=-1*this.ml0;else{var d=u(this.a,this.e,Math.sin(s))/Math.tan(s);e=d*Math.sin(n),i=this.a*c(this.e0,this.e1,this.e2,this.e3,s)-this.ml0+d*(1-Math.cos(n))}return t.x=e+this.x0,t.y=i+this.y0,t},i.inverse=function(t){var e,i,n,o,s,r,l,u,p;if(n=t.x-this.x0,o=t.y-this.y0,this.sphere)if(Math.abs(o+this.a*this.lat0)<=h)e=a(n/this.a+this.long0),i=0;else{r=this.lat0+o/this.a,l=n*n/this.a/this.a+r*r,u=r;var m;for(s=d;s;--s)if(m=Math.tan(u),p=-1*(r*(u*m+1)-u-.5*(u*u+l)*m)/((u-r)/m-1),u+=p,Math.abs(p)<=h){i=u;break}e=a(this.long0+Math.asin(n*Math.tan(u)/this.a)/Math.sin(i))}else if(Math.abs(o+this.ml0)<=h)i=0,e=a(this.long0+n/this.a);else{r=(this.ml0+o)/this.a,l=n*n/this.a/this.a+r*r,u=r;var f,_,g,v,y;for(s=d;s;--s)if(y=this.e*Math.sin(u),f=Math.sqrt(1-y*y)*Math.tan(u),_=this.a*c(this.e0,this.e1,this.e2,this.e3,u),g=this.e0-2*this.e1*Math.cos(2*u)+4*this.e2*Math.cos(4*u)-6*this.e3*Math.cos(6*u),v=_/this.a,p=(r*(f*v+1)-v-.5*f*(v*v+l))/(this.es*Math.sin(2*u)*(v*v+l-2*r*v)/(4*f)+(r-v)*(f*g-2/Math.sin(2*u))-g),u-=p,Math.abs(p)<=h){i=u;break}f=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),e=a(this.long0+Math.asin(n*f/this.a)/Math.sin(i))}return t.x=e,t.y=i,t},i.names=["Polyconic","poly"]},{"../common/adjust_lat":4,"../common/adjust_lon":5,"../common/e0fn":7,"../common/e1fn":8,"../common/e2fn":9,"../common/e3fn":10,"../common/gN":11,"../common/mlfn":14}],57:[function(t,e,i){var n=t("../common/adjust_lon"),o=t("../common/adjust_lat"),s=t("../common/pj_enfn"),r=20,a=t("../common/pj_mlfn"),l=t("../common/pj_inv_mlfn"),c=Math.PI/2,h=1e-10,u=t("../common/asinz");i.init=function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=s(this.es)},i.forward=function(t){var e,i,o=t.x,s=t.y;if(o=n(o-this.long0),this.sphere){if(this.m)for(var l=this.n*Math.sin(s),c=r;c;--c){var u=(this.m*s+Math.sin(s)-l)/(this.m+Math.cos(s));if(s-=u,Math.abs(u)<h)break}else s=1!==this.n?Math.asin(this.n*Math.sin(s)):s;e=this.a*this.C_x*o*(this.m+Math.cos(s)),i=this.a*this.C_y*s}else{var d=Math.sin(s),p=Math.cos(s);i=this.a*a(s,d,p,this.en),e=this.a*o*p/Math.sqrt(1-this.es*d*d)}return t.x=e,t.y=i,t},i.inverse=function(t){var e,i,s,r;return t.x-=this.x0,s=t.x/this.a,t.y-=this.y0,e=t.y/this.a,this.sphere?(e/=this.C_y,s/=this.C_x*(this.m+Math.cos(e)),this.m?e=u((this.m*e+Math.sin(e))/this.n):1!==this.n&&(e=u(Math.sin(e)/this.n)),s=n(s+this.long0),e=o(e)):(e=l(t.y/this.a,this.es,this.en),r=Math.abs(e),c>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)<o?(e=2*this.a*this.k0/(1+r*Math.cos(f)),t.y=e*s):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*s+this.cosX0*r*Math.cos(f))),t.y=e*(this.cosX0*s-this.sinX0*r*Math.cos(f))+this.y0),t.x=e*r*Math.sin(f)+this.x0,t))},i.inverse=function(t){t.x-=this.x0,t.y-=this.y0;var e,i,s,r,a,h=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var u=2*Math.atan(h/(.5*this.a*this.k0));return e=this.long0,i=this.lat0,o>=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)<o?this.lat0>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)<c){var y=Math.sin(i),E=Math.cos(i),P=Math.tan(i),C=this.ep2*Math.pow(E,2),S=Math.pow(C,2),M=Math.pow(P,2),w=Math.pow(M,2);e=1-this.es*Math.pow(y,2);var L=this.a/Math.sqrt(e),R=L*(1-this.es)/e,b=g/(L*this.k0),x=Math.pow(b,2);s=i-L*P*x/R*(.5-x/24*(5+3*M+10*C-4*S-9*this.ep2-x/30*(61+90*M+298*C+45*w-252*this.ep2-3*S))),r=l(this.long0+b*(1-x/6*(1+2*M+C-x/20*(5-2*C+28*M-3*S+8*this.ep2+24*w)))/E)}else s=c*u(v),r=this.long0}return t.x=r,t.y=s,t},i.names=["Transverse_Mercator","Transverse Mercator","tmerc"]},{"../common/adjust_lon":5,"../common/asinz":6,"../common/e0fn":7,"../common/e1fn":8,"../common/e2fn":9,"../common/e3fn":10,"../common/mlfn":14,"../common/sign":21}],62:[function(t,e,i){var n=.017453292519943295,o=t("./tmerc");i.dependsOn="tmerc",i.init=function(){this.zone&&(this.lat0=0,this.long0=(6*Math.abs(this.zone)-183)*n,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,o.init.apply(this),this.forward=o.forward,this.inverse=o.inverse)},i.names=["Universal Transverse Mercator System","utm"]},{"./tmerc":61}],63:[function(t,e,i){var n=t("../common/adjust_lon"),o=Math.PI/2,s=1e-10,r=t("../common/asinz");i.init=function(){this.R=this.a},i.forward=function(t){var e,i,a=t.x,l=t.y,c=n(a-this.long0);Math.abs(l)<=s&&(e=this.x0+this.R*c,i=this.y0);var h=r(2*Math.abs(l/Math.PI));(Math.abs(c)<=s||Math.abs(Math.abs(l)-o)<=s)&&(e=this.x0,i=l>=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)<s?this.long0:n(this.long0+Math.PI*(a-1+Math.sqrt(1+2*(o*o-r*r)+a*a))/2/o),t.x=e,t.y=i,t},i.names=["Van_der_Grinten_I","VanDerGrinten","vandg"]},{"../common/adjust_lon":5,"../common/asinz":6}],64:[function(t,e){var i=.017453292519943295,n=57.29577951308232,o=1,s=2,r=t("./datum_transform"),a=t("./adjust_axis"),l=t("./Proj"),c=t("./common/toPoint");e.exports=function t(e,h,u){function d(t,e){return(t.datum.datum_type===o||t.datum.datum_type===s)&&"WGS84"!==e.datumCode}var p;return Array.isArray(u)&&(u=c(u)),e.datum&&h.datum&&(d(e,h)||d(h,e))&&(p=new l("WGS84"),t(e,p,u),e=p),"enu"!==e.axis&&a(e,!1,u),"longlat"===e.projName?(u.x*=i,u.y*=i):(e.to_meter&&(u.x*=e.to_meter,u.y*=e.to_meter),e.inverse(u)),e.from_greenwich&&(u.x+=e.from_greenwich),u=r(e.datum,h.datum,u),h.from_greenwich&&(u.x-=h.from_greenwich),"longlat"===h.projName?(u.x*=n,u.y*=n):(h.forward(u),h.to_meter&&(u.x/=h.to_meter,u.y/=h.to_meter)),"enu"!==h.axis&&a(h,!0,u),u}},{"./Proj":2,"./adjust_axis":3,"./common/toPoint":23,"./datum_transform":30}],65:[function(t,e){function i(t,e,i){t[e]=i.map(function(t){var e={};return n(t,e),e}).reduce(function(t,e){return l(t,e)},{})}function n(t,e){var o;return Array.isArray(t)?(o=t.shift(),"PARAMETER"===o&&(o=t.shift()),void(1===t.length?Array.isArray(t[0])?(e[o]={},n(t[0],e[o])):e[o]=t[0]:t.length?"TOWGS84"===o?e[o]=t:(e[o]={},["UNIT","PRIMEM","VERT_DATUM"].indexOf(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,
       
   149 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);u<f(a);)u+=2e6;var d=i-s;if(d%2!==0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t;var _,g,v,y,E,P=d/2,C=0,S=0;return P>0&&(_=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<this.options.maxZoom&&l;a++){var c=(r[3]-r[1])/this._projectedTileSize(a);l=Math.abs(c-Math.round(c))>.001}if(!l){for(o={},a=this.options.minZoom;a<this.options.maxZoom;a++)s=r[1]+Math.ceil((r[3]-r[1])/this._projectedTileSize(a))*this._projectedTileSize(a),o[this.crs.scale(a)]=new t.Transformation(1,-r[0],-1,s);this.crs=new t.Proj.CRS.TMS(this.crs.projection._proj,r,this.crs.options),this.crs.transformation=new t.Proj.ScaleDependantTransformation(o)}},getTileUrl:function(e){var i=this._map.getZoom(),n=Math.ceil((this.crs.projectedBounds[3]-this.crs.projectedBounds[1])/this._projectedTileSize(i));return t.Util.template(this._url,t.Util.extend({s:this._getSubdomain(e),z:this._getZoomForUrl(),x:e.x,y:n-e.y-1},this.options))},_projectedTileSize:function(t){return this.options.tileSize/this.crs.scale(t)}}),t.Proj.GeoJSON=t.GeoJSON.extend({initialize:function(e,i){this._callLevel=0,t.GeoJSON.prototype.initialize.call(this,null,i),e&&this.addData(e)},addData:function(e){var i;e&&(e.crs&&"name"===e.crs.type?i=new t.Proj.CRS(e.crs.properties.name):e.crs&&e.crs.type&&(i=new t.Proj.CRS(e.crs.type+":"+e.crs.properties.code)),void 0!==i&&(this.options.coordsToLatLng=function(e){var n=t.point(e[0],e[1]);return i.projection.unproject(n)})),this._callLevel++;try{t.GeoJSON.prototype.addData.call(this,e)}finally{this._callLevel--,0===this._callLevel&&delete this.options.coordsToLatLng}}}),t.Proj.geoJson=function(e,i){return new t.Proj.GeoJSON(e,i)},t.Proj.ImageOverlay=t.ImageOverlay.extend({initialize:function(e,i,n){t.ImageOverlay.prototype.initialize.call(this,e,null,n),this._projBounds=i},_animateZoom:function(e){var i=t.point(this._projBounds.min.x,this._projBounds.max.y),n=t.point(this._projBounds.max.x,this._projBounds.min.y),o=this._projectedToNewLayerPoint(i,e.zoom,e.center),s=this._projectedToNewLayerPoint(n,e.zoom,e.center).subtract(o),r=o.add(s._multiplyBy((1-1/e.scale)/2));this._image.style[t.DomUtil.TRANSFORM]=t.DomUtil.getTranslateString(r)+" scale("+this._map.getZoomScale(e.zoom)+") "},_reset:function(){var e=this._map.getZoom(),i=this._map.getPixelOrigin(),n=t.bounds(this._transform(this._projBounds.min,e)._subtract(i),this._transform(this._projBounds.max,e)._subtract(i)),o=n.getSize(),s=this._image;t.DomUtil.setPosition(s,n.min),s.style.width=o.x+"px",s.style.height=o.y+"px"},_projectedToNewLayerPoint:function(t,e,i){var n=this._map._getNewTopLeftPoint(i,e).add(this._map._getMapPanePos());return this._transform(t,e)._subtract(n)},_transform:function(t,e){var i=this._map.options.crs,n=i.transformation,o=i.scale(e);return n.transform(t,o)}}),t.Proj.imageOverlay=function(e,i,n){return new t.Proj.ImageOverlay(e,i,n)},"undefined"!=typeof t.CRS&&(t.CRS.proj4js=function(){return function(e,i,n,o){return o=o||{},n&&(o.transformation=n),new t.Proj.CRS(e,i,o)}}()),t.Proj}),!function(t,e){proj4leaflet10x=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.Projection=t.Class.extend({initialize:function(e,i,n){var o=t.Proj._isProj4Obj(e);this._proj=o?e:this._projFromCodeDef(e,i),this.bounds=o?i:n},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)},_projFromCodeDef:function(t,i){if(i)e.defs(t,i);else if(void 0===e.defs[t]){var n=t.split(":");if(n.length>3&&(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||i<t[n])&&(i=t[n]);return i}}),t.Proj.GeoJSON=t.GeoJSON.extend({initialize:function(e,i){if(e.crs&&"name"===e.crs.type){var n=new t.Proj.CRS(e.crs.properties.name);i=i||{},i.coordsToLatLng=function(e){var i=t.point(e[0],e[1]);return n.projection.unproject(i)}}t.GeoJSON.prototype.initialize.call(this,e,i)}}),t.Proj.geoJson=function(e,i){return new t.Proj.GeoJSON(e,i)},t.Proj}),LeafletCRSProj4Leaflet=function(t,e,i){return{load:function(){console.log("loading lib proj4leaflet ...");var t=null;if(0===e.version.lastIndexOf("0.7",0))t=proj4leaflet07x,console.log("loaded version for leaflet 0.7.7 ...");else{if(0!==e.version.lastIndexOf("1.0",0))return void console.log("version leaflet incompatible !");t=proj4leaflet10x,console.log("loaded version for leaflet 1.0.0 ...")}return e.Proj=t,e.Proj}}}({},leaflet,proj4),CommonUtilsRegister=function(t){var e={isLoaded:!1,get:function(t){if(""!==t&&null!==t&&"undefined"!=typeof t){var e=t.split(":");if(2===e.length){var i=e[0],n=e[1];if(this.hasOwnProperty(i)&&this[i].hasOwnProperty(n))return this[i][n]}}},load:function(){if(!this.isLoaded){for(var e=["IGNF","EPSG","CRS"],i=0;i<e.length;i++){var n=e[i],o=this[n];for(var s in o)if(o.hasOwnProperty(s)){var r=n+":"+s;t.defs(r,this.get(r))}}this.isLoaded=!0}},EPSG:{4149:"+title=CH1903 +proj=longlat +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +no_defs ",4150:"+title=CH1903plus +proj=longlat +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +no_defs ",4151:"+title=CHTRF95 +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs ",4171:"+title=RGF93 +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs ",4230:"+title=ED50 +proj=longlat +ellps=intl +no_defs ",4235:"+title=Guyane Francaise +proj=longlat +ellps=intl +no_defs ",4258:"+title=ETRS89 +proj=longlat +ellps=GRS80 +no_defs ",4275:"+title=NTF +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +no_defs ",4322:"+title=WGS 72 +proj=longlat +ellps=WGS72 +no_defs ",4326:"+title=WGS 84 +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ",4467:"+proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",4470:"+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs ",4471:"+proj=utm +zone=38 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",4474:"+proj=utm +zone=38 +south +ellps=intl +towgs84=-382,-59,-262,0,0,0,0 +units=m +no_defs ",4558:"+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs ",4559:"+proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",4621:"+title=Fort Marigot +proj=longlat +ellps=intl +towgs84=137,248,-430,0,0,0,0 +no_defs ",4622:"+title=Guadeloupe 1948 +proj=longlat +ellps=intl +no_defs ",4623:"+title=CSG67 +proj=longlat +ellps=intl +towgs84=-186,230,110,0,0,0,0 +no_defs ",4624:"+title=RGFG95 +proj=longlat +ellps=GRS80 +towgs84=2,2,-2,0,0,0,0 +no_defs ",4625:"+title=Martinique 1938 +proj=longlat +ellps=intl +no_defs ",4626:"+title=Reunion 1947 +proj=longlat +ellps=intl +no_defs ",4627:"+title=RGR92 +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs ",4628:"+title=Tahiti 52 +proj=longlat +ellps=intl +towgs84=162,117,154,0,0,0,0 +no_defs ",4629:"+title=Tahaa 54 +proj=longlat +ellps=intl +no_defs ",4630:"+title=IGN72 Nuku Hiva +proj=longlat +ellps=intl +no_defs ",4632:"+title=Combani 1950 +proj=longlat +ellps=intl +towgs84=-382,-59,-262,0,0,0,0 +no_defs ",4633:"+title=IGN56 Lifou +proj=longlat +ellps=intl +no_defs ",4634:"+title=IGN72 Grand Terre +proj=longlat +ellps=intl +no_defs ",4637:"+title=Perroud 1950 +proj=longlat +ellps=intl +towgs84=325,154,172,0,0,0,0 +no_defs ",4638:"+title=Saint Pierre et Miquelon 1950 +proj=longlat +ellps=clrk66 +towgs84=30,430,368,0,0,0,0 +no_defs ",4640:"+title=RRAF 1991 +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs ",4641:"+title=IGN53 Mare +proj=longlat +ellps=intl +no_defs ",4645:"+title=RGNC 1991 +proj=longlat +ellps=intl +towgs84=0,0,0,0,0,0,0 +no_defs ",4687:"+proj=longlat +ellps=GRS80 +no_defs ",4662:"+title=IGN72 Grande Terre +proj=longlat +ellps=intl +no_defs ",4689:"+title=IGN63 Hiva Oa +proj=longlat +ellps=intl +no_defs ",4690:"+title=Tahiti 79 +proj=longlat +ellps=intl +no_defs ",4691:"+title=Moorea 87 +proj=longlat +ellps=intl +towgs84=215.525,149.593,176.229,-3.2624,-1.692,-1.1571,10.4773 +no_defs ",4692:"+title=Maupiti 83 +proj=longlat +ellps=intl +towgs84=217.037,86.959,23.956,0,0,0,0 +no_defs ",4698:"+title=IGN 1962 Kerguelen +proj=longlat +ellps=intl +towgs84=145,-187,103,0,0,0,0 +no_defs ",4749:"+title=RGNC91-93 +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs ",4750:"+title=ST87 Ouvea +proj=longlat +ellps=WGS84 +towgs84=-56.263,16.136,-22.856,0,0,0,0 +no_defs ",4807:"+title=NTF (Paris) +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +no_defs ",2056:"+title=CH1903+ / LV95 +proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs ",2154:"+title=RGF93 / Lambert-93 +proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",2213:"+title=ETRS89 / TM 30 NE +proj=tmerc +lat_0=0 +lon_0=30 +k=0.9996 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",2969:"+title=Fort Marigot / UTM zone 20N +proj=utm +zone=20 +ellps=intl +towgs84=137,248,-430,0,0,0,0 +units=m +no_defs ",2970:"+title=Guadeloupe 1948 / UTM zone 20N +proj=utm +zone=20 +ellps=intl +units=m +no_defs ",2971:"+title=CSG67 / UTM zone 22N +proj=utm +zone=22 +ellps=intl +towgs84=-186,230,110,0,0,0,0 +units=m +no_defs ",2972:"+title=RGFG95 / UTM zone 22N +proj=utm +zone=22 +ellps=GRS80 +towgs84=2,2,-2,0,0,0,0 +units=m +no_defs ",2973:"+title=Martinique 1938 / UTM zone 20N +proj=utm +zone=20 +ellps=intl +units=m +no_defs ",2975:"+title=RGR92 / UTM zone 40S +proj=utm +zone=40 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",2976:"+title=Tahiti 52 / UTM zone 6S +proj=utm +zone=6 +south +ellps=intl +towgs84=162,117,154,0,0,0,0 +units=m +no_defs ",2977:"+title=Tahaa 54 / UTM zone 5S +proj=utm +zone=5 +south +ellps=intl +units=m +no_defs ",2978:"+title=IGN72 Nuku Hiva / UTM zone 7S +proj=utm +zone=7 +south +ellps=intl +units=m +no_defs ",2980:"+title=Combani 1950 / UTM zone 38S +proj=utm +zone=38 +south +ellps=intl +towgs84=-382,-59,-262,0,0,0,0 +units=m +no_defs ",2981:"+title=IGN56 Lifou / UTM zone 58S +proj=utm +zone=58 +south +ellps=intl +units=m +no_defs ",2982:"+title=IGN72 Grand Terre / UTM zone 58S (deprecated) +proj=utm +zone=58 +south +ellps=intl +units=m +no_defs ",2984:"+title=RGNC 1991 / Lambert New Caledonia (deprecated) +proj=lcc +lat_1=-20.66666666666667 +lat_2=-22.33333333333333 +lat_0=-21.5 +lon_0=166 +x_0=400000 +y_0=300000 +ellps=intl +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",2986:"+title=Terre Adelie 1950 +proj=stere +towgs84=324.9120,153.2820,172.0260 +a=6378388.0000 +rf=297.0000000000000 +lat_0=-90.000000000 +lon_0=140.000000000 +lat_ts=-67.000000000 +k=0.96027295 +x_0=300000.000 +y_0=-2299363.482 +units=m +no_defs",2987:"+title=Saint Pierre et Miquelon 1950 / UTM zone 21N +proj=utm +zone=21 +ellps=clrk66 +towgs84=30,430,368,0,0,0,0 +units=m +no_defs ",2989:"+title=RRAF 1991 / UTM zone 20N +proj=utm +zone=20 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",2990:"+title=Reunion 1947 / TM Reunion (deprecated) +proj=tmerc +lat_0=-21.11666666666667 +lon_0=55.53333333333333 +k=1 +x_0=50000 +y_0=160000 +ellps=intl +units=m +no_defs ",2995:"+title=IGN53 Mare / UTM zone 58S +proj=utm +zone=58 +south +ellps=intl +units=m +no_defs ",3038:"+proj=utm +zone=26 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",3039:"+proj=utm +zone=27 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",3040:"+proj=utm +zone=28 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",3041:"+proj=utm +zone=29 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",3045:"+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",3046:"+proj=utm +zone=34 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",3047:"+proj=utm +zone=35 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",3048:"+proj=utm +zone=36 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",3049:"+proj=utm +zone=37 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",3050:"+proj=utm +zone=38 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",3051:"+proj=utm +zone=39 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",3034:"+title=ETRS89 / ETRS-LCC +proj=lcc +lat_1=35 +lat_2=65 +lat_0=52 +lon_0=10 +x_0=4000000 +y_0=2800000 +ellps=GRS80 +units=m +no_defs ",3035:"+title=ETRS89 / ETRS-LAEA +proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs ",3042:"+title=ETRS89 / ETRS-TM30 +proj=utm +zone=30 +ellps=GRS80 +units=m +no_defs ",3043:"+title=ETRS89 / ETRS-TM31 +proj=utm +zone=31 +ellps=GRS80 +units=m +no_defs ",3044:"+title=ETRS89 / ETRS-TM32 +proj=utm +zone=32 +ellps=GRS80 +units=m +no_defs ",25828:"+proj=utm +zone=28 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",25829:"+proj=utm +zone=29 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",25833:"+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",25834:"+proj=utm +zone=34 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",25835:"+proj=utm +zone=35 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",25836:"+proj=utm +zone=36 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",25837:"+proj=utm +zone=37 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",25838:"+proj=utm +zone=38 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",3060:"+title=IGN72 Grande Terre / UTM zone 58S +proj=utm +zone=58 +south +ellps=intl +units=m +no_defs ",3163:"+title=RGNC91-93 / Lambert New Caledonia +proj=lcc +lat_1=-20.66666666666667 +lat_2=-22.33333333333333 +lat_0=-21.5 +lon_0=166 +x_0=400000 +y_0=300000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",3164:"+title=ST87 Ouvea / UTM zone 58S +proj=utm +zone=58 +south +ellps=WGS84 +towgs84=-56.263,16.136,-22.856,0,0,0,0 +units=m +no_defs ",3165:"+title=NEA74 Noumea / Noumea Lambert +proj=lcc +lat_1=-22.24469175 +lat_2=-22.29469175 +lat_0=-22.26969175 +lon_0=166.44242575 +x_0=0.66 +y_0=1.02 +ellps=intl +units=m +no_defs ",3166:"+title=NEA74 Noumea / Noumea Lambert 2 +proj=lcc +lat_1=-22.24472222222222 +lat_2=-22.29472222222222 +lat_0=-22.26972222222222 +lon_0=166.4425 +x_0=8.313000000000001 +y_0=-2.354 +ellps=intl +units=m +no_defs ",3169:"+title=RGNC91-93 / UTM zone 57S +proj=utm +zone=57 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",3170:"+title=RGNC91-93 / UTM zone 58S +proj=utm +zone=58 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",3171:"+title=RGNC91-93 / UTM zone 59S +proj=utm +zone=59 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",3172:"+title=IGN53 Mare / UTM zone 59S +proj=utm +zone=59 +south +ellps=intl +units=m +no_defs ",3296:"+title=RGPF / UTM zone 5S +proj=utm +zone=5 +south +ellps=GRS80 +units=m +no_defs ",3297:"+title=RGPF / UTM zone 6S +proj=utm +zone=6 +south +ellps=GRS80 +units=m +no_defs ",3298:"+title=RGPF / UTM zone 7S +proj=utm +zone=7 +south +ellps=GRS80 +units=m +no_defs ",3299:"+title=RGPF / UTM zone 8S +proj=utm +zone=8 +south +ellps=GRS80 +units=m +no_defs ",3302:"+title=IGN63 Hiva Oa / UTM zone 7S +proj=utm +zone=7 +south +ellps=intl +units=m +no_defs ",3303:"+title=Fatu Iva 72 / UTM zone 7S +proj=utm +zone=7 +south +ellps=intl +towgs84=347.103,1078.12,2623.92,-33.8875,70.6773,-9.3943,186.074 +units=m +no_defs ",3304:"+title=Tahiti 79 / UTM zone 6S +proj=utm +zone=6 +south +ellps=intl +units=m +no_defs ",3305:"+title=Moorea 87 / UTM zone 6S +proj=utm +zone=6 +south +ellps=intl +towgs84=215.525,149.593,176.229,-3.2624,-1.692,-1.1571,10.4773 +units=m +no_defs ",3306:"+title=Maupiti 83 / UTM zone 5S +proj=utm +zone=5 +south +ellps=intl +towgs84=217.037,86.959,23.956,0,0,0,0 +units=m +no_defs ",3312:"+title=CSG67 / UTM zone 21N +proj=utm +zone=21 +ellps=intl +towgs84=-186,230,110,0,0,0,0 +units=m +no_defs ",3313:"+title=RGFG95 / UTM zone 21N +proj=utm +zone=21 +ellps=GRS80 +towgs84=2,2,-2,0,0,0,0 +units=m +no_defs ",3336:"+title=IGN 1962 Kerguelen / UTM zone 42S +proj=utm +zone=42 +south +ellps=intl +towgs84=145,-187,103,0,0,0,0 +units=m +no_defs ",3395:"+title=WGS 84 / World Mercator +proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",3727:"+title=Reunion 1947 / TM Reunion +proj=tmerc +lat_0=-21.11666666666667 +lon_0=55.53333333333333 +k=1 +x_0=160000 +y_0=50000 +ellps=intl +units=m +no_defs ",21781:"+title=CH1903 / LV03 +proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +x_0=600000 +y_0=200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs ",25830:"+title=ETRS89 / UTM zone 30N +proj=utm +zone=30 +ellps=GRS80 +units=m +no_defs ",25831:"+title=ETRS89 / UTM zone 31N +proj=utm +zone=31 +ellps=GRS80 +units=m +no_defs ",25832:"+title=ETRS89 / UTM zone 32N +proj=utm +zone=32 +ellps=GRS80 +units=m +no_defs ",27561:"+title=NTF (Paris) / Lambert Nord France +proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000001 +lon_0=0 +k_0=0.999877341 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs ",27562:"+title=NTF (Paris) / Lambert Centre France +proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs ",27563:"+title=NTF (Paris) / Lambert Sud France +proj=lcc +lat_1=44.10000000000001 +lat_0=44.10000000000001 +lon_0=0 +k_0=0.9998774990000001 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs ",27564:"+title=NTF (Paris) / Lambert Corse +proj=lcc +lat_1=42.16500000000001 +lat_0=42.16500000000001 +lon_0=0 +k_0=0.9999447100000001 +x_0=234.358 +y_0=185861.369 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs ",27571:"+title=NTF (Paris) / Lambert zone I +proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000001 +lon_0=0 +k_0=0.999877341 +x_0=600000 +y_0=1200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs ",27572:"+title=NTF (Paris) / Lambert zone II +proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs ",27573:"+title=NTF (Paris) / Lambert zone III +proj=lcc +lat_1=44.10000000000001 +lat_0=44.10000000000001 +lon_0=0 +k_0=0.9998774990000001 +x_0=600000 +y_0=3200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs ",27574:"+title=NTF (Paris) / Lambert zone IV +proj=lcc +lat_1=42.16500000000001 +lat_0=42.16500000000001 +lon_0=0 +k_0=0.9999447100000001 +x_0=234.358 +y_0=4185861.369 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs ",27581:"+title=NTF (Paris) / France I (deprecated) +proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000001 +lon_0=0 +k_0=0.999877341 +x_0=600000 +y_0=1200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs ",27582:"+title=NTF (Paris) / France II (deprecated) +proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs ",27583:"+title=NTF (Paris) / France III (deprecated) +proj=lcc +lat_1=44.10000000000001 +lat_0=44.10000000000001 +lon_0=0 +k_0=0.9998774990000001 +x_0=600000 +y_0=3200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs ",27584:"+title=NTF (Paris) / France IV (deprecated) +proj=lcc +lat_1=42.16500000000001 +lat_0=42.16500000000001 +lon_0=0 +k_0=0.9999447100000001 +x_0=234.358 +y_0=4185861.369 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs ",27591:"+title=NTF (Paris) / Nord France (deprecated) +proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000001 +lon_0=0 +k_0=0.999877341 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs ",27592:"+title=NTF (Paris) / Centre France (deprecated) +proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs ",27593:"+title=NTF (Paris) / Sud France (deprecated) +proj=lcc +lat_1=44.10000000000001 +lat_0=44.10000000000001 +lon_0=0 +k_0=0.9998774990000001 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs ",27594:"+title=NTF (Paris) / Corse (deprecated) +proj=lcc +lat_1=42.16500000000001 +lat_0=42.16500000000001 +lon_0=0 +k_0=0.9999447100000001 +x_0=234.358 +y_0=185861.369 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs ",32601:"+proj=utm +zone=1 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32602:"+proj=utm +zone=2 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32603:"+proj=utm +zone=3 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32604:"+proj=utm +zone=4 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32605:"+proj=utm +zone=5 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32606:"+proj=utm +zone=6 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32607:"+proj=utm +zone=7 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32608:"+proj=utm +zone=8 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32609:"+proj=utm +zone=9 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32610:"+proj=utm +zone=10 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32611:"+proj=utm +zone=11 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32612:"+proj=utm +zone=12 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32613:"+proj=utm +zone=13 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32614:"+proj=utm +zone=14 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32615:"+proj=utm +zone=15 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32616:"+proj=utm +zone=16 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32617:"+proj=utm +zone=17 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32618:"+proj=utm +zone=18 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32619:"+proj=utm +zone=19 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32620:"+proj=utm +zone=20 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32621:"+proj=utm +zone=21 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32622:"+proj=utm +zone=22 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32623:"+proj=utm +zone=23 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32624:"+proj=utm +zone=24 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32625:"+proj=utm +zone=25 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32626:"+proj=utm +zone=26 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32627:"+proj=utm +zone=27 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32628:"+proj=utm +zone=28 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32629:"+proj=utm +zone=29 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32630:"+proj=utm +zone=30 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32631:"+proj=utm +zone=31 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32632:"+proj=utm +zone=32 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32633:"+proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32634:"+proj=utm +zone=34 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32635:"+proj=utm +zone=35 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32636:"+proj=utm +zone=36 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",
       
   150 32637:"+proj=utm +zone=37 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32638:"+proj=utm +zone=38 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32639:"+proj=utm +zone=39 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32640:"+proj=utm +zone=40 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32641:"+proj=utm +zone=41 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32642:"+proj=utm +zone=42 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32643:"+proj=utm +zone=43 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32644:"+proj=utm +zone=44 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32645:"+proj=utm +zone=45 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32646:"+proj=utm +zone=46 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32647:"+proj=utm +zone=47 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32648:"+proj=utm +zone=48 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32649:"+proj=utm +zone=49 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32650:"+proj=utm +zone=50 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32651:"+proj=utm +zone=51 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32652:"+proj=utm +zone=52 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32653:"+proj=utm +zone=53 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32654:"+proj=utm +zone=54 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32655:"+proj=utm +zone=55 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32656:"+proj=utm +zone=56 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32657:"+proj=utm +zone=57 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32658:"+proj=utm +zone=58 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32659:"+proj=utm +zone=59 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32660:"+proj=utm +zone=60 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32661:"+proj=stere +lat_0=90 +lat_ts=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32662:"+title=WGS 84 / Plate Carree +proj=eqc +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32701:"+proj=utm +zone=1 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32702:"+proj=utm +zone=2 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32703:"+proj=utm +zone=3 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32704:"+proj=utm +zone=4 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32705:"+proj=utm +zone=5 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32706:"+proj=utm +zone=6 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32707:"+proj=utm +zone=7 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32708:"+proj=utm +zone=8 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32709:"+proj=utm +zone=9 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32710:"+proj=utm +zone=10 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32711:"+proj=utm +zone=11 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32712:"+proj=utm +zone=12 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32713:"+proj=utm +zone=13 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32714:"+proj=utm +zone=14 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32715:"+proj=utm +zone=15 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32716:"+proj=utm +zone=16 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32717:"+proj=utm +zone=17 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32718:"+proj=utm +zone=18 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32719:"+proj=utm +zone=19 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32720:"+proj=utm +zone=20 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32721:"+proj=utm +zone=21 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32722:"+proj=utm +zone=22 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32723:"+proj=utm +zone=23 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32724:"+proj=utm +zone=24 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32725:"+proj=utm +zone=25 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32726:"+proj=utm +zone=26 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32727:"+proj=utm +zone=27 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32728:"+proj=utm +zone=28 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32729:"+proj=utm +zone=29 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32730:"+proj=utm +zone=30 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32731:"+proj=utm +zone=31 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32732:"+proj=utm +zone=32 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32733:"+proj=utm +zone=33 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32734:"+proj=utm +zone=34 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32735:"+proj=utm +zone=35 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32736:"+proj=utm +zone=36 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32737:"+proj=utm +zone=37 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32738:"+proj=utm +zone=38 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32739:"+proj=utm +zone=39 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32740:"+proj=utm +zone=40 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32741:"+proj=utm +zone=41 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32742:"+proj=utm +zone=42 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32743:"+proj=utm +zone=43 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32744:"+proj=utm +zone=44 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32745:"+proj=utm +zone=45 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32746:"+proj=utm +zone=46 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32747:"+proj=utm +zone=47 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32748:"+proj=utm +zone=48 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32749:"+proj=utm +zone=49 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32750:"+proj=utm +zone=50 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32751:"+proj=utm +zone=51 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32752:"+proj=utm +zone=52 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32753:"+proj=utm +zone=53 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32754:"+proj=utm +zone=54 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32755:"+proj=utm +zone=55 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32756:"+proj=utm +zone=56 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32757:"+proj=utm +zone=57 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32758:"+proj=utm +zone=58 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32759:"+proj=utm +zone=59 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32760:"+proj=utm +zone=60 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",32761:"+proj=stere +lat_0=-90 +lat_ts=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ",310024802:"+title=Geoportail - France metropolitaine +proj=eqc +nadgrids=null +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=46.500000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",310915814:"+title=Geoportail - Antilles francaises +proj=eqc +nadgrids=null +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=15.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",310486805:"+title=Geoportail - Guyane +proj=eqc +nadgrids=null +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=4.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",310700806:"+title=Geoportail - Reunion et dependances +proj=eqc +nadgrids=null +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=-21.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",310702807:"+title=Geoportail - Mayotte +proj=eqc +nadgrids=null +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=-12.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",310706808:"+title=Geoportail - Saint-Pierre et Miquelon +proj=eqc +nadgrids=null +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=47.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",310547809:"+title=Geoportail - Nouvelle-Caledonie +proj=eqc +nadgrids=null +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=-22.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",310642810:"+title=Geoportail - Wallis et Futuna +proj=eqc +nadgrids=null +towgs84=0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.000000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=-14.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",310032811:"+title=Geoportail - Polynesie francaise +proj=eqc +nadgrids=null +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=-15.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",310642812:"+title=Geoportail - Kerguelen +proj=eqc +nadgrids=null +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=-49.500000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",310642801:"+title=Geoportail - Crozet +proj=eqc +nadgrids=null +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=-46.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",310642813:"+title=Geoportail - Amsterdam et Saint-Paul +proj=eqc +nadgrids=null +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=-38.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",310642901:"+title=Geoportail - Monde +proj=mill +towgs84=0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.000000 +a=6378137.0000 +rf=298.2572221010000 +lon_0=0.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",5489:"+title=RGAF09 geographiques (dms) +proj=longlat +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137 +rf=298.257222101 +units=m +no_defs",5490:"+title=RGAF09 UTM Nord Fuseau 20 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137 +rf=298.257222101 +lat_0=0.000000000 +lon_0=-63.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs"},CRS:{84:"+title=WGS 84 longitude-latitude +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs "},IGNF:{AMST63:"+title=Amsterdam 1963 +proj=geocent +towgs84=109.753,-528.133,-362.244,0,0,0,0 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",CROZ63:"+title=Crozet 1963 +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",CSG67:"+title=Guyane CSG67 +proj=geocent +towgs84=-193.0660,236.9930,105.4470,0.4814,-0.8074,0.1276,1.564900 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",ED50:"+title=ED50 +proj=geocent +towgs84=-84.0000,-97.0000,-117.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",ETRS89:"+title=Systeme de reference terrestre Europeen (1989) +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs",GUAD48:"+title=Guadeloupe Ste Anne +proj=geocent +towgs84=-472.2900,-5.6300,-304.1200,0.4362,-0.8374,0.2563,1.898400 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",GUADFM49:"+title=Guadeloupe Fort Marigot +proj=geocent +towgs84=136.5960,248.1480,-429.7890 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",IGN63:"+title=IGN 1963 (Hiva Oa, Tahuata, Mohotani) +proj=geocent +towgs84=410.7210,55.0490,80.7460,-2.5779,-2.3514,-0.6664,17.331100 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",IGN72:"+title=IGN 1972 Grande-Terre / Ile des Pins +proj=geocent +towgs84=-11.6400,-348.6000,291.6800 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",KERG62CAR:"+title=Kerguelen - K0 +proj=geocent +towgs84=144.8990,-186.7700,100.9230 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",MART38:"+title=Martinique Fort-Desaix +proj=geocent +towgs84=126.9260,547.9390,130.4090,-2.7867,5.1612,-0.8584,13.822650 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",MAYO50:"+title=Mayotte Combani +proj=geocent +towgs84=-599.9280,-275.5520,-195.6650,-0.0835,-0.4715,0.0602,49.281400 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",MOOREA87:"+title=Moorea 1987 +proj=geocent +towgs84=215.9820,149.5930,176.2290,3.2624,1.6920,1.1571,10.477300 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",NTF:"+title=Nouvelle Triangulation Francaise +proj=geocent +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +units=m +no_defs",NUKU72:"+title=IGN 1972 Nuku Hiva +proj=geocent +towgs84=165.7320,216.7200,180.5050,-0.6434,-0.4512,-0.0791,7.420400 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",REUN47:"+title=Reunion 1947 +proj=geocent +towgs84=789.5240,-626.4860,-89.9040,0.6006,76.7946,-10.5788,-32.324100 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",RGF93:"+title=Reseau geodesique francais 1993 +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs",RGFG95:"+title=Reseau geodesique francais de Guyane 1995 +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs",RGM04:"+title=RGM04 (Reseau Geodesique de Mayotte 2004) +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs",RGNC:"+title=Reseau Geodesique de Nouvelle-Caledonie +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs",RGPF:"+title=RGPF (Reseau Geodesique de Polynesie Francaise) +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs",RGR92:"+title=Reseau geodesique Reunion 1992 +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs",RGSPM06:"+title=Reseau Geodesique Saint-Pierre-et-Miquelon (2006) +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs",RGTAAF07:"+title=Reseau Geodesique des TAAF (2007) +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs",RRAF91:"+title=RRAF 1991 (Reseau de Reference des Antilles Francaises) +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs",STPL69:"+title=Saint-Paul 1969 +proj=geocent +towgs84=225.571,-346.608,-46.567,0,0,0,0 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",STPM50:"+title=St Pierre et Miquelon 1950 +proj=geocent +towgs84=-95.5930,573.7630,173.4420,-0.9602,1.2510,-1.3918,42.626500 +a=6378206.4000 +rf=294.9786982000000 +units=m +no_defs",TAHAA:"+title=Raiatea - Tahaa 51-54 (Tahaa, Base Terme Est) +proj=geocent +towgs84=72.4380,345.9180,79.4860,-1.6045,-0.8823,-0.5565,1.374600 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",TAHI79:"+title=IGN79 (Tahiti) Iles de la Societe +proj=geocent +towgs84=221.5250,152.9480,176.7680,2.3847,1.3896,0.8770,11.474100 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",TERA50:"+title=Pointe Geologie - Perroud 1950 +proj=geocent +towgs84=324.9120,153.2820,172.0260 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",WALL78:"+title=Wallis-Uvea 1978 (MOP78) +proj=geocent +towgs84=253.0000,-133.0000,-127.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",WGS72:"+title=World Geodetic System 1972 +proj=geocent +towgs84=0.0000,12.0000,6.0000 +a=6378135.0000 +rf=298.2600000000000 +units=m +no_defs",WGS84:"+title=World Geodetic System 1984 +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs",AMST63GEO:"+title=Amsterdam 1963 +proj=longlat +towgs84=109.753,-528.133,-362.244,0,0,0,0 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",CROZ63GEO:"+title=Crozet 1963 +proj=longlat +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",CSG67GEO:"+title=Guyane CSG67 +proj=longlat +towgs84=-193.0660,236.9930,105.4470,0.4814,-0.8074,0.1276,1.564900 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",ED50G:"+title=ED50 +proj=longlat +towgs84=-84.0000,-97.0000,-117.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",GUAD48GEO:"+title=Guadeloupe Ste Anne +proj=longlat +towgs84=-472.2900,-5.6300,-304.1200,0.4362,-0.8374,0.2563,1.898400 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",GUADFM49GEO:"+title=Guadeloupe Fort Marigot +proj=longlat +towgs84=136.5960,248.1480,-429.7890 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",IGN63GEO:"+title=IGN 1963 (Hiva Oa, Tahuata, Mohotani) +proj=longlat +towgs84=410.7210,55.0490,80.7460,-2.5779,-2.3514,-0.6664,17.331100 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",IGN72GEO:"+title=IGN 1972 Grande-Terre / Ile des Pins +proj=longlat +towgs84=-11.6400,-348.6000,291.6800 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",KERG62GEO:"+title=Kerguelen - K0 +proj=longlat +towgs84=144.8990,-186.7700,100.9230 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",MART38GEO:"+title=Martinique Fort-Desaix +proj=longlat +towgs84=126.9260,547.9390,130.4090,-2.7867,5.1612,-0.8584,13.822650 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",MAYO50GEO:"+title=Mayotte Combani +proj=longlat +towgs84=-599.9280,-275.5520,-195.6650,-0.0835,-0.4715,0.0602,49.281400 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",MOOREA87GEO:"+title=Moorea 1987 +proj=longlat +towgs84=215.9820,149.5930,176.2290,3.2624,1.6920,1.1571,10.477300 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",NTFG:"+title=Nouvelle Triangulation Francaise Greenwich degres sexagesimaux +proj=longlat +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +units=m +no_defs",NTFP:"+title=Nouvelle Triangulation Francaise Paris grades +proj=longlat +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +pm=2.337229167 +units=m +no_defs",NUKU72GEO:"+title=IGN 1972 Nuku Hiva +proj=longlat +towgs84=165.7320,216.7200,180.5050,-0.6434,-0.4512,-0.0791,7.420400 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",REUN47GEO:"+title=Reunion 1947 +proj=longlat +towgs84=789.5240,-626.4860,-89.9040,0.6006,76.7946,-10.5788,-32.324100 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",RGF93G:"+title=Reseau geodesique francais 1993 +proj=longlat +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs",RGFG95GEO:"+title=Reseau geodesique francais de Guyane 1995 +proj=longlat +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs",RGM04GEO:"+title=RGM04 (Reseau Geodesique de Mayotte 2004) +proj=longlat +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs",RGNCGEO:"+title=Reseau Geodesique de Nouvelle-Caledonie +proj=longlat +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs",RGPFGEO:"+title=RGPF (Reseau Geodesique de Polynesie Francaise) +proj=longlat +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs",RGR92GEO:"+title=Reseau geodesique de la Reunion 1992 +proj=longlat +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs",RGSPM06GEO:"+title=Saint-Pierre-et-Miquelon (2006) +proj=longlat +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs",RGTAAF07G:"+title=Reseau Geodesique des TAAF (2007) (dms) +proj=longlat +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs",STPL69GEO:"+title=Saint-Paul 1969 +proj=longlat +towgs84=225.571,-346.608,-46.567,0,0,0,0 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",STPM50GEO:"+title=St Pierre et Miquelon 1950  +proj=longlat +towgs84=-95.5930,573.7630,173.4420,-0.9602,1.2510,-1.3918,42.626500 +a=6378206.4000 +rf=294.9786982000000 +units=m +no_defs",TAHAAGEO:"+title=Raiatea - Tahaa 51-54 (Tahaa, Base Terme Est) +proj=longlat +towgs84=72.4380,345.9180,79.4860,-1.6045,-0.8823,-0.5565,1.374600 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",TAHI79GEO:"+title=IGN79 (Tahiti) Iles de la Societe +proj=longlat +towgs84=221.5250,152.9480,176.7680,2.3847,1.3896,0.8770,11.474100 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",TERA50G:"+title=Pointe Geologie - Perroud 1950 +proj=longlat +towgs84=324.9120,153.2820,172.0260 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",WALL78GEO:"+title=Wallis - Uvea 1978 (MOP78) +proj=longlat +towgs84=253.0000,-133.0000,-127.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs",WGS72G:"+title=WGS72 +proj=longlat +towgs84=0.0000,12.0000,6.0000 +a=6378135.0000 +rf=298.2600000000000 +units=m +no_defs",WGS84G:"+title=World Geodetic System 1984 +proj=longlat +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs",WGS84RRAFGEO:"+title=Reseau de reference des Antilles francaises (1988-1991) +proj=longlat +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs",XGEO:"+title=Systeme CIO-BIH +proj=longlat +towgs84=0.0000,0.0000,0.5000,0.0000,0.0000,0.0140,-0.100000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs",AMST63UTM43S:"+title=Amsterdam 1963 UTM fuseau 43 Sud +proj=tmerc +towgs84=109.753,-528.133,-362.244,0,0,0,0 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=75.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",CROZ63UTM39S:"+title=Crozet 1963 +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=51.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",CSG67UTM21:"+title=Guyane CSG67 UTM fuseau 21 +proj=tmerc +towgs84=-193.0660,236.9930,105.4470,0.4814,-0.8074,0.1276,1.564900 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-57.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs",CSG67UTM22:"+title=Guyane CSG67 UTM fuseau 22 +proj=tmerc +towgs84=-193.0660,236.9930,105.4470,0.4814,-0.8074,0.1276,1.564900 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-51.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs",GEOPORTALANF:"+title=Geoportail - Antilles francaises +proj=eqc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=15.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",GEOPORTALASP:"+title=Geoportail - Amsterdam et Saint-Paul +proj=eqc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=-38.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",GEOPORTALCRZ:"+title=Geoportail - Crozet +proj=eqc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=-46.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",GEOPORTALFXX:"+title=Geoportail - France metropolitaine +proj=eqc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=46.500000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",GEOPORTALGUF:"+title=Geoportail - Guyane +proj=eqc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=4.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",GEOPORTALKER:"+title=Geoportail - Kerguelen +proj=eqc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=-49.500000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",GEOPORTALMYT:"+title=Geoportail - Mayotte +proj=eqc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=-12.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",GEOPORTALNCL:"+title=Geoportail - Nouvelle-Caledonie +proj=eqc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=-22.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",GEOPORTALPYF:"+title=Geoportail - Polynesie francaise +proj=eqc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=-15.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",GEOPORTALREU:"+title=Geoportail - Reunion et dependances +proj=eqc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=-21.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",GEOPORTALSPM:"+title=Geoportail - Saint-Pierre et Miquelon +proj=eqc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=47.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",GEOPORTALWLF:"+title=Geoportail - Wallis et Futuna +proj=eqc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=-14.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",GUAD48UTM20:"+title=Guadeloupe Ste Anne +proj=tmerc +towgs84=-472.2900,-5.6300,-304.1200,0.4362,-0.8374,0.2563,1.898400 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-63.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs",GUADFM49U20:"+title=Guadeloupe Fort Marigot  +proj=tmerc +towgs84=136.5960,248.1480,-429.7890 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-63.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs",IGN63UTM7S:"+title=IGN 1963 - Hiva Oa, Tahuata, Mohotani - UTM fuseau 7 Sud +proj=tmerc +towgs84=410.7210,55.0490,80.7460,-2.5779,-2.3514,-0.6664,17.331100 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-141.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",IGN72UTM58S:"+title=IGN 1972 - UTM fuseau 58 Sud +proj=tmerc +towgs84=-11.6400,-348.6000,291.6800 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=165.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",KERG62UTM42S:"+title=Kerguelen 1962 +proj=tmerc +towgs84=144.8990,-186.7700,100.9230 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=69.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",LAMB1:"+title=Lambert I +proj=lcc +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +pm=2.337229167 +lat_0=49.500000000 +lon_0=0.000000000 +k_0=0.99987734 +lat_1=49.500000000 +x_0=600000.000 +y_0=200000.000 +units=m +no_defs",LAMB1C:"+title=Lambert I Carto +proj=lcc +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +pm=2.337229167 +lat_0=49.500000000 +lon_0=0.000000000 +k_0=0.99987734 +lat_1=49.500000000 +x_0=600000.000 +y_0=1200000.000 +units=m +no_defs",LAMB2:"+title=Lambert II +proj=lcc +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +pm=2.337229167 +lat_0=46.800000000 +lon_0=0.000000000 +k_0=0.99987742 +lat_1=46.800000000 +x_0=600000.000 +y_0=200000.000 +units=m +no_defs",LAMB2C:"+title=Lambert II Carto +proj=lcc +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +pm=2.337229167 +lat_0=46.800000000 +lon_0=0.000000000 +k_0=0.99987742 +lat_1=46.800000000 +x_0=600000.000 +y_0=2200000.000 +units=m +no_defs",LAMB3:"+title=Lambert III +proj=lcc +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +pm=2.337229167 +lat_0=44.100000000 +lon_0=0.000000000 +k_0=0.99987750 +lat_1=44.100000000 +x_0=600000.000 +y_0=200000.000 +units=m +no_defs",LAMB3C:"+title=Lambert III Carto +proj=lcc +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +pm=2.337229167 +lat_0=44.100000000 +lon_0=0.000000000 +k_0=0.99987750 +lat_1=44.100000000 +x_0=600000.000 +y_0=3200000.000 +units=m +no_defs",LAMB4:"+title=Lambert IV +proj=lcc +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +pm=2.337229167 +lat_0=42.165000000 +lon_0=0.000000000 +k_0=0.99994471 +lat_1=42.165000000 +x_0=234.358 +y_0=185861.369 +units=m +no_defs",LAMB4C:"+title=Lambert IV Carto +proj=lcc +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +pm=2.337229167 +lat_0=42.165000000 +lon_0=0.000000000 +k_0=0.99994471 +lat_1=42.165000000 +x_0=234.358 +y_0=4185861.369 +units=m +no_defs",LAMB93:"+title=Lambert 93 +proj=lcc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=46.500000000 +lon_0=3.000000000 +lat_1=44.000000000 +lat_2=49.000000000 +x_0=700000.000 +y_0=6600000.000 +units=m +no_defs",RGF93CC42:"+title=Lambert conique conforme Zone 1 +proj=lcc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=42.000000000 +lon_0=3.000000000 +lat_1=41.200000000 +lat_2=42.800000000 +x_0=1700000.000 +y_0=1200000.000 +units=m +no_defs",RGF93CC43:"+title=Lambert conique conforme Zone 2 +proj=lcc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=43.000000000 +lon_0=3.000000000 +lat_1=42.200000000 +lat_2=43.800000000 +x_0=1700000.000 +y_0=2200000.000 +units=m +no_defs",RGF93CC44:"+title=Lambert conique conforme Zone 3 +proj=lcc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=44.000000000 +lon_0=3.000000000 +lat_1=43.200000000 +lat_2=44.800000000 +x_0=1700000.000 +y_0=3200000.000 +units=m +no_defs",RGF93CC45:"+title=Lambert conique conforme Zone 4 +proj=lcc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=45.000000000 +lon_0=3.000000000 +lat_1=44.200000000 +lat_2=45.800000000 +x_0=1700000.000 +y_0=4200000.000 +units=m +no_defs",RGF93CC46:"+title=Lambert conique conforme Zone 5 +proj=lcc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=46.000000000 +lon_0=3.000000000 +lat_1=45.200000000 +lat_2=46.800000000 +x_0=1700000.000 +y_0=5200000.000 +units=m +no_defs",RGF93CC47:"+title=Lambert conique conforme Zone 6 +proj=lcc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=47.000000000 +lon_0=3.000000000 +lat_1=46.200000000 +lat_2=47.800000000 +x_0=1700000.000 +y_0=6200000.000 +units=m +no_defs",RGF93CC48:"+title=Lambert conique conforme Zone 7 +proj=lcc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=48.000000000 +lon_0=3.000000000 +lat_1=47.200000000 +lat_2=48.800000000 +x_0=1700000.000 +y_0=7200000.000 +units=m +no_defs",RGF93CC49:"+title=Lambert conique conforme Zone 8 +proj=lcc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=49.000000000 +lon_0=3.000000000 +lat_1=48.200000000 +lat_2=49.800000000 +x_0=1700000.000 +y_0=8200000.000 +units=m +no_defs",
       
   151 RGF93CC50:"+title=Lambert conique conforme Zone 9 +proj=lcc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=50.000000000 +lon_0=3.000000000 +lat_1=49.200000000 +lat_2=50.800000000 +x_0=1700000.000 +y_0=9200000.000 +units=m +no_defs",LAMBE:"+title=Lambert II etendu +proj=lcc +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +pm=2.337229167 +lat_0=46.800000000 +lon_0=0.000000000 +k_0=0.99987742 +lat_1=46.800000000 +x_0=600000.000 +y_0=2200000.000 +units=m +no_defs",MART38UTM20:"+title=Martinique Fort-Desaix +proj=tmerc +towgs84=126.9260,547.9390,130.4090,-2.7867,5.1612,-0.8584,13.822650 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-63.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs",MAYO50UTM38S:"+title=Mayotte Combani +proj=tmerc +towgs84=-599.9280,-275.5520,-195.6650,-0.0835,-0.4715,0.0602,49.281400 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=45.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",MILLER:"+title=Geoportail - Monde +proj=mill +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lon_0=0.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs",MOOREA87U6S:"+title=Moorea 1987 - UTM fuseau 6 Sud +proj=tmerc +towgs84=215.9820,149.5930,176.2290,3.2624,1.6920,1.1571,10.477300 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-147.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",NUKU72U7S:"+title=IGN 1972 Nuku Hiva - UTM fuseau 7 Sud +proj=tmerc +towgs84=165.7320,216.7200,180.5050,-0.6434,-0.4512,-0.0791,7.420400 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-141.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",REUN47GAUSSL:"+title=Reunion Gauss Laborde +proj=gstmerc +towgs84=789.5240,-626.4860,-89.9040,0.6006,76.7946,-10.5788,-32.324100 +a=6378388.0000 +rf=297.0000000000000 +lat_0=-21.116666667 +lon_0=55.533333333 +k_0=1.00000000 +x_0=160000.000 +y_0=50000.000 +units=m +no_defs",RGM04UTM38S:"+title=UTM fuseau 38 Sud (Reseau Geodesique de Mayotte 2004) +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=45.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",RGNCUTM57S:"+title=Reseau Geodesique de Nouvelle-Caledonie - UTM fuseau 57 Sud +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=159.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",RGNCUTM58S:"+title=Reseau Geodesique de Nouvelle-Caledonie - UTM fuseau 58 Sud +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=165.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",RGNCUTM59S:"+title=Reseau Geodesique de Nouvelle-Caledonie - UTM fuseau 59 Sud +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=171.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",RGPFUTM5S:"+title=RGPF - UTM fuseau 5 Sud +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-153.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",RGPFUTM6S:"+title=RGPF - UTM fuseau 6 Sud +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-147.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",RGPFUTM7S:"+title=RGPF - UTM fuseau 7 Sud +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-141.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",RGR92UTM40S:"+title=RGR92 UTM fuseau 40 Sud +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=57.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",RGSPM06U21:"+title=Saint-Pierre-et-Miquelon (2006) UTM Fuseau 21 Nord +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-57.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs",STPL69UTM43S:"+title=Saint-Paul 1969 UTM fuseau 43 Sud +proj=tmerc +towgs84=225.571,-346.608,-46.567,0,0,0,0 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=75.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",STPM50UTM21:"+title=St Pierre et Miquelon 1950 +proj=tmerc +towgs84=-95.5930,573.7630,173.4420,-0.9602,1.2510,-1.3918,42.626500 +a=6378206.4000 +rf=294.9786982000000 +lat_0=0.000000000 +lon_0=-57.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs",TAHAAUTM05S:"+title=Tahaa 1951 +proj=tmerc +towgs84=72.4380,345.9180,79.4860,-1.6045,-0.8823,-0.5565,1.374600 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-153.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",TAHI51UTM06S:"+title=Tahiti-Terme Nord UTM fuseau 6 Sud +proj=tmerc +towgs84=162.0000,117.0000,154.0000 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-147.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",TAHI79UTM6S:"+title=Tahiti 1979 +proj=tmerc +towgs84=221.5250,152.9480,176.7680,2.3847,1.3896,0.8770,11.474100 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-147.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",TERA50STEREO:"+title=Terre Adelie 1950 +proj=stere +towgs84=324.9120,153.2820,172.0260 +a=6378388.0000 +rf=297.0000000000000 +lat_0=-90.000000000 +lon_0=140.000000000 +lat_ts=-67 +k=0.96027295 +x_0=300000.000 +y_0=-2299363.482 +units=m +no_defs",UTM01SW84:"+title=World Geodetic System 1984 UTM fuseau 01 Sud +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-177.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",UTM20W84GUAD:"+title=World Geodetic System 1984 UTM fuseau 20 Nord-Guadeloupe +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-63.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs",UTM20W84MART:"+title=World Geodetic System 1984 UTM fuseau 20 Nord-Martinique +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-63.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs",UTM22RGFG95:"+title=RGFG95 UTM fuseau 22 Nord-Guyane +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-51.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs",UTM39SW84:"+title=World Geodetic System 1984 UTM fuseau 39 Sud +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=51.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",UTM42SW84:"+title=World Geodetic System 1984 UTM fuseau 42 Sud +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=69.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",UTM43SW84:"+title=World Geodetic System 1984 UTM fuseau 43 Sud +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=75.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",WALL78UTM1S:"+title=Wallis-Uvea 1978 (MOP78) UTM 1 SUD +proj=tmerc +towgs84=253.0000,-133.0000,-127.0000 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-177.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs",ETRS89GEO:"+title=ETRS89 geographiques (dms) +proj=longlat +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs",ETRS89LAEA:"+title=ETRS89 Lambert Azimutal Equal Area +proj=laea +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=52.000000000 +lon_0=10.000000000 +x_0=4321000.000 +y_0=3210000.000 +units=m +no_defs",ETRS89LCC:"+title=ETRS89 Lambert Conformal Conic +proj=lcc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=52.000000000 +lon_0=9.999999995 +lat_1=35.000000000 +lat_2=65.000000000 +x_0=4000000.000 +y_0=2800000.000 +units=m +no_defs",UTM26ETRS89:"+title=Europe - de 30d a 24d Ouest +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-27.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs",UTM27ETRS89:"+title=Europe - de 24d a 18d Ouest +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-21.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs",UTM28ETRS89:"+title=Europe - de 18d a 12d Ouest +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-15.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs",UTM29ETRS89:"+title=Europe - de 12d a 6d Ouest +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-9.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs",UTM30ETRS89:"+title=Europe - de -6d a 0d Ouest +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-3.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs",UTM31ETRS89:"+title=Europe - de 0d a 6d Est +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=3.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs",UTM32ETRS89:"+title=Europe - de 6d a 12d Est +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=9.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs",UTM33ETRS89:"+title=Europe - de 12d a 18d Est +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=15.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs",UTM34ETRS89:"+title=Europe - de 18d a 24d Est +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=21.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs",UTM35ETRS89:"+title=Europe - de 24d a 30d Est +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=27.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs",UTM36ETRS89:"+title=Europe - de 30d a 36d Est +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=33.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs",UTM37ETRS89:"+title=Europe - de 36d a 42d Est +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=39.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs",UTM38ETRS89:"+title=Europe - de 42d a 48d Est +proj=tmerc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=45.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs"}};return e}(proj4),LeafletCRSEPSG2154=function(t,e,i){var n={instance:null,build:function(){if(!this.instance){var t=new i.Proj.CRS("EPSG:2154",e.get("EPSG:2154"),{resolutions:this._getResolutions(),origin:this._getOrigin()});this.instance=t}return this.instance},_getResolutions:function(){var e=[];if(t.isConfigLoaded()){var i=t.getTileMatrix("LAMB93");e=i.nativeResolutions}return e.length?e:[104579.22454989408,52277.53235379051,26135.487078595408,13066.891381800004,6533.228604113456,3266.5595244626675,1633.2660045974187,816.6295549860224,408.31391467683596,204.15674151090204,102.07831678324082,51.0391448966112,25.519569074269395,12.759783693647506,6.379891635966491,3.18994576530532,1.5949728694977277,.7974864315474559,.398743214900604,.19937160727567999,.099685803696052,.049842901818919996]},_getOrigin:function(){return[0,12e6]}};return n}(CommonUtilsConfig,CommonUtilsRegister,leaflet),LeafletCRSEPSG27572=function(t,e,i){var n={instance:null,build:function(){if(!this.instance){var t=new i.Proj.CRS("EPSG:27572",e.get("EPSG:27572"),{resolutions:this._getResolutions(),origin:this._getOrigin()});this.instance=t}return this.instance},_getResolutions:function(){var e=[];if(t.isConfigLoaded()){var i=t.getTileMatrix("LAMB2E");i&&Object.keys(i)&&(e=i.nativeResolutions)}return e.length?e:[104579.22454989408,52277.53235379051,26135.487078595408,13066.891381800004,6533.228604113456,3266.5595244626675,1633.2660045974187,816.6295549860224,408.31391467683596,204.15674151090204,102.07831678324082,51.0391448966112,25.519569074269395,12.759783693647506,6.379891635966491,3.18994576530532,1.5949728694977277,.7974864315474559,.398743214900604,.19937160727567999,.099685803696052,.049842901818919996]},_getOrigin:function(){return[0,12e6]}};return n}(CommonUtilsConfig,CommonUtilsRegister,leaflet),LeafletCRSEPSG4326=function(t,e,i){var n={instance:null,build:function(){if(!this.instance){var t=new i.Proj.CRS("EPSG:4326",e.get("EPSG:4326"),{resolutions:this._getResolutions(),origin:[-180,90]});this.instance=t}return this.instance},_getResolutions:function(){var e=[];return t.isConfigLoaded()&&(e=t.getResolutions()),e.length?e:[1.40625,.703125,.3515625,.17578125,.087890625,.0439453125,.02197265625,.010986328125,.0054931640625,.00274658203125,.001373291015625,.0006866455078125,.00034332275390625,.000171661376953126,858306884765628e-19,429153442382813e-19,214576721191407e-19,107288360595703e-19,536441802978517e-20,268220901489259e-20,13411045074463e-19,6.70552253723145e-7,3.3527612686157e-7]},_getOrigin:function(){}};return n}(CommonUtilsConfig,CommonUtilsRegister,leaflet),LeafletCRSCRS=function(t,e,i,n,o){!function(){t.load(),e.load()}();var s={EPSG2154:function(){return i.build()},EPSG27572:function(){return n.build()},EPSG4326:function(){return o.build()}};return s}(LeafletCRSProj4Leaflet,CommonUtilsRegister,LeafletCRSEPSG2154,LeafletCRSEPSG27572,LeafletCRSEPSG4326),LeafletControlsMousePosition=function(t,e,i,n,o,s,r,a){var l=t.Control.extend({includes:s,options:{position:"bottomleft",collapsed:!0,units:[],systems:[],displayAltitude:!0,displayCoordinates:!0,altitude:{triggerDelay:200,responseDelay:500,noDataValue:-99999,noDataValueTolerance:9e4,serviceOptions:{}}},initialize:function(e){t.Util.extend(this.options,e),this._uid=o.generate(),this._projectionSystems=[],this._initProjectionSystems(),this._projectionUnits={},this._initProjectionUnits(),this._isDesktop=this._detectSupport(),this.options.altitude.triggerDelay<100&&(this.options.altitude.triggerDelay=100),this._timer=this.options.altitude.triggerDelay,this._currentProjectionSystems=this._projectionSystems[0],this._projectionSystemsContainer=null,this._currentProjectionType=this._projectionSystems[0].type,this._currentProjectionUnits=this._projectionUnits[this._currentProjectionType][0].code,this._projectionUnitsContainer=null,this._showMousePositionContainer=null,this.options.displayAltitude||this.options.displayCoordinates||(this.options.displayCoordinates=!0),this._noRightManagement=!1,this.options.displayAltitude&&this._checkRightsManagement(),t.Util.setOptions(this,this.options)},onAdd:function(e){var i=this._container=this._initLayout();return this.options.collapsed||(this._isDesktop?e.on("mousemove",this.onMouseMove,this):e.on("move",this.onMapMove,this)),t.DomEvent.disableClickPropagation(i).disableScrollPropagation(i),t.DomEvent.addListener(i,"mousemove",t.DomEvent.stopPropagation).addListener(i,"mousemove",t.DomEvent.preventDefault),i},onRemove:function(t){t.off("mousemove",this.onMouseMove)},_initProjectionSystems:function(){for(var e=[{label:"Géographique",crs:t.CRS.Simple,type:"Geographical"},{label:"Web Mercator",crs:t.CRS.EPSG3395,type:"Metric"},{label:"Lambert 93",crs:a.EPSG2154,type:"Metric",geoBBox:{left:-9.86,bottom:41.15,right:10.38,top:51.56}},{label:"Lambert II étendu",crs:a.EPSG27572,type:"Metric",geoBBox:{left:-4.87,bottom:42.33,right:8.23,top:51.14}}],i=this.options.systems,n=0;n<i.length;n++){var o=i[n];if(o.label&&o.crs){o.type||(o.type="Metric"),this._projectionSystems.push(i[n]);for(var s=!1,r=0;r<e.length;r++){var l=e[r];o.crs===l.crs&&(s=!0)}}}0===this._projectionSystems.length&&(this._projectionSystems=e);for(var c=0;c<this._projectionSystems.length;++c)this._projectionSystems[c].code=c},_initProjectionUnits:function(){var t={Geographical:[{code:"DEC",label:"degrés décimaux",convert:this._displayDEC},{code:"DMS",label:"degrés sexagésimaux",convert:this._displayDMS},{code:"RAD",label:"radians",convert:this._displayRAD},{code:"GON",label:"grades",convert:this._displayGON}],Metric:[{code:"M",label:"mètres",convert:this._displayMeter},{code:"KM",label:"kilomètres",convert:this._displayKMeter}]},e=this.options.units;for(var i in t)if(t.hasOwnProperty(i)){for(var n=!1,o=0;o<t[i].length;o++)for(var s=t[i][o],r=0;r<e.length;r++){var a=e[r];s.code===a&&(n=!0,this._projectionUnits[i]||(this._projectionUnits[i]=[]),this._projectionUnits[i].push(s))}n||(this._projectionUnits[i]=t[i])}0===Object.keys(this._projectionUnits).length&&(this._projectionUnits=t)},_checkRightsManagement:function(){var t=n.check({key:this.options.apiKey,resources:["SERVICE_CALCUL_ALTIMETRIQUE_RSC"],services:["Elevation"]});t||(this._noRightManagement=!0),this.options.apiKey||(this.options.apiKey=t.key)},_detectSupport:function(){var t=!0,e=window.navigator.userAgent.toLowerCase();return e.indexOf("iphone")===-1&&e.indexOf("ipod")===-1&&e.indexOf("ipad")===-1&&e.indexOf("android")===-1&&e.indexOf("mobile")===-1&&e.indexOf("blackberry")===-1&&e.indexOf("tablet")===-1&&e.indexOf("phone")===-1&&e.indexOf("touch")===-1||(t=!1),e.indexOf("msie")===-1&&e.indexOf("trident")===-1||(t=!0),t},_initLayout:function(){var t=this._createMainContainerElement(),e=this._showMousePositionContainer=this._createShowMousePositionElement();t.appendChild(e),this.options.collapsed||(e.checked=!0);var i=this._createShowMousePositionPictoElement(this._isDesktop);t.appendChild(i);var n=this._createMousePositionPanelElement(this.options.displayAltitude,this.options.displayCoordinates),o=this._createMousePositionSettingsElement(),s=this._projectionSystemsContainer=this._createMousePositionSettingsSystemsElement(this._projectionSystems),r=this._projectionUnitsContainer=this._createMousePositionSettingsUnitsElement(this._projectionUnits[this._currentProjectionType]);o.appendChild(s),o.appendChild(r),n.appendChild(o),t.appendChild(n);var a=this._createMapCenter(),l=this._map;return l.getContainer().appendChild(a),t},_setElevationPanel:function(e){var i=null;e||(i=t.DomUtil.get(this._addUID("GPmousePositionAltitude")),i.style.display="none"),e&&this._noRightManagement&&(i=t.DomUtil.get(this._addUID("GPmousePositionAlt")),i.innerHTML="no right !")},_setCoordinatePanel:function(e){if(!e){var i=t.DomUtil.get(this._addUID("GPmousePositionCoordinate"));i.style.display="none"}},_setSettingsPanel:function(e){if(!e){var i=t.DomUtil.get("GPshowMousePositionSettingsPicto"),n=t.DomUtil.get(this._addUID("GPmousePositionSettings"));i.style.display="none",n.style.display="none"}},_setTypeUnitsPanel:function(t){for(var e=this._projectionUnitsContainer;e.firstChild;)e.removeChild(e.firstChild);for(var i=this._projectionUnits[t],n=0;n<i.length;n++){var o=i[n],s=document.createElement("option");s.value=o.code?o.code:n,s.text=o.label||n,e.appendChild(s)}this._currentProjectionType=t,this._currentProjectionUnits=this._projectionUnits[t][0].code},_displayDEC:function(t){var e={};return e.lat=r.roundToDecimal(t.lat,6),e.lng=r.roundToDecimal(t.lng,6),e},_displayDMS:function(t){var e={};return e.lat=r.decimalLatToDMS(t.lat),e.lng=r.decimalLongToDMS(t.lng),e},_displayRAD:function(t){var e={};return e.lat=r.decimalToRadian(t.lat),e.lng=r.decimalToRadian(t.lng),e},_displayGON:function(t){var e={};return e.lat=r.decimalToGrade(t.lat),e.lng=r.decimalToGrade(t.lng),e},_displayMeter:function(e){var i={};return i.x=t.Util.formatNum(e.x,2),i.y=t.Util.formatNum(e.y,2),i.unit="m",i},_displayKMeter:function(e){var i={};return i.x=t.Util.formatNum(e.x/1e3,2),i.y=t.Util.formatNum(e.y/1e3,2),i.unit="km",i},_project:function(e,i){if("function"==typeof i&&(i=i()),"object"==typeof i){if(i===t.CRS.Simple)return e;if(i.projection&&"object"==typeof i.projection){var n=i.projection.project(e);return"Geographical"===this._currentProjectionType&&(n.lat=n.y,n.lng=n.x),!n||0===Object.keys(n).length,n}}},_setCoordinate:function(t){for(var e=this._currentProjectionSystems.type,i=null,n=this._projectionUnits[e],o=0;o<n.length;o++)if(n[o].code===this._currentProjectionUnits){i=n[o].convert;break}var s={},r=this._currentProjectionSystems.crs;r&&(s=i(this._project(t,r)),s&&0!==Object.keys(s).lenght&&this.GPdisplayCoords(s))},_setElevation:function(t){var e=this.options.altitude.responseDelay,i=this.options.altitude.noDataValue,n=this.options.altitude.noDataValueTolerance;this.GPdisplayElevation(t,e,i,n)},onMoveStopped:function(t){this._noRightManagement||this._setElevation(t)},onMouseMove:function(t){var e=this,i=t.latlng;this._setCoordinate(i),clearTimeout(this._timer),this._timer=setTimeout(function(){e.onMoveStopped(i)},this.options.altitude.triggerDelay)},onMapMove:function(){var t=this,e=this._map,i=e.getCenter();this._setCoordinate(i),clearTimeout(this._timer),this._timer=setTimeout(function(){t.onMoveStopped(i)},this.options.altitude.triggerDelay)},onRequestAltitude:function(e,n){if(e&&0!==Object.keys(e).length&&this.options.displayAltitude&&!this._noRightManagement){var o={};t.Util.extend(o,this.options.altitude.serviceOptions),t.Util.extend(o,{zonly:!0,positions:[{lon:e.lon||e.lng,lat:e.lat}]}),t.Util.extend(o,{scope:this,onSuccess:function(t){t&&Object.keys(t)&&n.call(this,t.elevations[0].z)},onFailure:function(t){}}),t.Util.extend(o,{apiKey:o.apiKey||this.options.apiKey}),i.Services.getAltitude(o)}},onShowMousePositionClick:function(t){var e=this._map;this._showMousePositionContainer.checked?this._isDesktop?e.off("mousemove",this.onMouseMove,this):e.off("move",this.onMapMove,this):this._isDesktop?e.on("mousemove",this.onMouseMove,this):e.on("move",this.onMapMove,this),this._setElevationPanel(this.options.displayAltitude),this._setCoordinatePanel(this.options.displayCoordinates),this.options.displayCoordinates||this._setSettingsPanel(!1)},onMousePositionProjectionSystemChange:function(t){var e=t.target.selectedIndex,i=t.target.options[e].value;t.target.options[e].label;this._setCurrentSystem(i)},_setCurrentSystem:function(t){for(var e=null,i=0;i<this._projectionSystems.length;++i)if(this._projectionSystems[i].code==t){e=this._projectionSystems[i].type;break}e&&(e!==this._currentProjectionType&&this._setTypeUnitsPanel(e),this._currentProjectionSystems=this._projectionSystems[Number(t)],this._isDesktop||this.onMapMove())},onMousePositionProjectionSystemMouseOver:function(t){var e=this._map;if(e){var i=document.getElementById(this._addUID("GPmousePositionProjectionSystem"));i.innerHTML="";for(var n=0;n<this._projectionSystems.length;n++){var o=this._projectionSystems[n];if(o.geoBBox&&(e.getBounds()._southWest.lng>o.geoBBox.right||e.getBounds()._southWest.lat>o.geoBBox.top||e.getBounds()._northEast.lng<o.geoBBox.left||e.getBounds()._northEast.lat<o.geoBBox.bottom)){if(o===this._currentProjectionSystems){var s=document.createElement("option");s.value=o.code,s.text=o.label||n,s.setAttribute("selected","selected"),s.setAttribute("disabled","disabled"),i.appendChild(s)}}else{var s=document.createElement("option");s.value=o.code,s.text=o.label||n,o===this._currentProjectionSystems&&s.setAttribute("selected","selected"),i.appendChild(s)}}}},onMousePositionProjectionUnitsChange:function(t){var e=t.target.selectedIndex,i=t.target.options[e].value;t.target.options[e].label;this._currentProjectionUnits=i,this._isDesktop||this.onMapMove()}});return l}(leaflet,{},gp,CommonUtilsCheckRightManagement,CommonUtilsSelectorID,CommonControlsMousePositionDOM,LeafletControlsUtilsPositionFormater,LeafletCRSCRS),CommonControlsReverseGeocodingDOM=function(){var t={_addUID:function(t){return t+"-"+this._uid},_createMainContainerElement:function(){var t=document.createElement("div");return t.id=this._addUID("GPreverseGeocoding"),t.className="GPwidget",t},_createShowReverseGeocodingElement:function(){var t=document.createElement("input");return t.id=this._addUID("GPshowReverseGeocoding"),t.type="checkbox",t},_createShowReverseGeocodingPictoElement:function(){var t=this,e=document.createElement("label");e.id=this._addUID("GPshowReverseGeocodingPicto"),e.className="GPshowAdvancedToolPicto",e.htmlFor=this._addUID("GPshowReverseGeocoding"),e.title="Ouvrir la recherche inverse",e.addEventListener?e.addEventListener("click",function(){t.onShowReverseGeocodingClick()}):e.attachEvent&&e.attachEvent("onclick",function(){t.onShowReverseGeocodingClick()});var i=document.createElement("span");return i.id=this._addUID("GPshowReverseGeocodingOpen"),i.className="GPshowAdvancedToolOpen",e.appendChild(i),e},_createReverseGeocodingWaitingElement:function(){var t=document.createElement("div");t.id=this._addUID("GPreverseGeocodingCalcWaitingContainer"),t.className="GPreverseGeocodingCalcWaitingContainerHidden";var e=document.createElement("p");return e.className="GPreverseGeocodingCalcWaiting",e.innerHTML="Recherche en cours...",t.appendChild(e),t},_createReverseGeocodingResultsPanelElement:function(){var t=document.createElement("div");return t.id=this._addUID("GPreverseGeocodingResultsPanel"),t.className="GPpanel GPreverseGeocodingComponentHidden",t},_createReverseGeocodingResultsListElement:function(){var t=document.createElement("div");return t.id=this._addUID("GPreverseGeocodingResultsList"),t},_createReverseGeocodingResultElement:function(t,e){var i=this,n=document.getElementById(this._addUID("GPreverseGeocodingResultsList")),o=document.createElement("div");o.id=this._addUID("ReverseGeocodedLocation_"+e),o.className="GPautoCompleteProposal",o.innerHTML=t,o.title=t,o.addEventListener?(o.addEventListener("mouseover",function(t){i.onReverseGeocodingResultMouseOver(t)}),o.addEventListener("mouseout",function(t){i.onReverseGeocodingResultMouseOut(t)}),o.addEventListener("click",function(t){"function"==typeof i.onReverseGeocodingResultClick&&i.onReverseGeocodingResultClick(t)})):o.attachEvent&&(o.attachEvent("onmouseover",function(t){i.onReverseGeocodingResultMouseOver(t)}),o.attachEvent("onmouseout",function(t){i.onReverseGeocodingResultMouseOut(t)}),o.attachEvent("onclick",function(t){"function"==typeof i.onReverseGeocodingResultClick&&i.onReverseGeocodingResultClick(t)})),n.appendChild(o)},_createReverseGeocodingPanelElement:function(){var t=document.createElement("div");return t.id=this._addUID("GPreverseGeocodingPanel"),t.className="GPpanel",t},_createReverseGeocodingPanelHeaderElement:function(){var t=document.createElement("div");return t.className="GPpanelHeader",t},_createReverseGeocodingPanelReturnPictoElement:function(){var t=this,e=document.createElement("div");return e.id=this._addUID("GPreverseGeocodingReturnPicto"),e.title="Nouvelle recherche",e.className="GPreverseGeocodingReturnPictoHidden",e.addEventListener?e.addEventListener("click",function(e){document.getElementById(t._addUID("GPreverseGeocodingResultsPanel")).className="GProuteComponentHidden",document.getElementById(t._addUID("GPreverseGeocodingForm")).className="",document.getElementById(t._addUID("GPreverseGeocodingHeaderTitle")).innerHTML="Recherche inverse",document.getElementById(t._addUID("GPreverseGeocodingReturnPicto")).className="GPreverseGeocodingReturnPictoHidden",t.onGPreverseGeocodingReturnPictoClick(e)}):e.attachEvent&&e.attachEvent("onclick",function(e){document.getElementById(t._addUID("GPreverseGeocodingResultsPanel")).className="GProuteComponentHidden",document.getElementById(t._addUID("GPreverseGeocodingForm")).className="",document.getElementById(t._addUID("GPreverseGeocodingHeaderTitle")).innerHTML="Recherche inverse",document.getElementById(t._addUID("GPreverseGeocodingReturnPicto")).className="GPreverseGeocodingReturnPictoHidden",t.onGPreverseGeocodingReturnPictoClick(e)}),e},_createReverseGeocodingPanelTitleElement:function(){var t=document.createElement("div");return t.className="GPpanelTitle",t.id=this._addUID("GPreverseGeocodingHeaderTitle"),t.innerHTML="Recherche inverse",t},_createReverseGeocodingPanelCloseElement:function(){var t=this,e=document.createElement("div");return e.id=this._addUID("GPreverseGeocodingPanelClose"),e.className="GPpanelClose",e.title="Fermer le panneau",e.addEventListener?e.addEventListener("click",function(){document.getElementById(t._addUID("GPshowReverseGeocodingPicto")).click()},!1):e.attachEvent&&e.attachEvent("onclick",function(){document.getElementById(t._addUID("GPshowReverseGeocodingPicto")).click()}),e},_createReverseGeocodingPanelFormElement:function(){var t=this,e=document.createElement("form");return e.id=this._addUID("GPreverseGeocodingForm"),e.addEventListener?e.addEventListener("submit",function(e){e.preventDefault(),t.onReverseGeocodingSubmit()}):e.attachEvent&&e.attachEvent("onsubmit",function(e){e.preventDefault(),t.onReverseGeocodingSubmit()}),e},_createReverseGeocodingFormModeChoiceGeocodingTypeElement:function(t){var e=this,i=document.createElement("div");i.className="GPflexInput";var n=document.createElement("label");n.className="GPreverseGeocodingCodeLabel",n.innerHTML="Recherche par",n.title="Recherche par",i.appendChild(n);var o=document.createElement("select");o.className="GPreverseGeocodingCode",o.addEventListener?o.addEventListener("change",function(t){e.onReverseGeocodingTypeChange(t)}):o.attachEvent&&o.attachEvent("onchange",function(t){e.onReverseGeocodingTypeChange(t)}),t&&Array.isArray(t)||(t=["StreetAddress","PositionOfInterest","CadastralParcel"]);for(var s=0;s<t.length;s++)switch(t[s]){case"PositionOfInterest":var r=document.createElement("option");r.value="PositionOfInterest",r.text="Lieux/toponymes",o.appendChild(r);break;case"StreetAddress":var a=document.createElement("option");a.value="StreetAddress",a.text="Adresses",o.appendChild(a);break;case"CadastralParcel":var l=document.createElement("option");l.value="CadastralParcel",l.text="Parcelles cadastrales",o.appendChild(l);break;case"Administratif":var c=document.createElement("option");c.value="Administratif",c.text="Unités administratives",o.appendChild(c)}return i.appendChild(o),i},_createReverseGeocodingFormModeChoiceGeocodingDelimitationElement:function(t){var e=this,i=document.createElement("div");i.className="GPflexInput";var n=document.createElement("label");n.className="GPreverseGeocodingCodeLabel",n.innerHTML="Délimitation",n.title="Délimitation",i.appendChild(n);var o=document.createElement("select");o.className="GPreverseGeocodingCode",o.addEventListener?o.addEventListener("change",function(t){e.onReverseGeocodingDelimitationChange(t);
       
   152 }):o.attachEvent&&o.attachEvent("onchange",function(t){e.onReverseGeocodingDelimitationChange(t)}),t&&Array.isArray(t)||(t=["Point","Circle","Extent"]);for(var s=0;s<t.length;s++)switch(t[s].toLowerCase()){case"point":var r=document.createElement("option");r.value="point",r.text="Pointer un lieu",o.appendChild(r);break;case"circle":var a=document.createElement("option");a.value="circle",a.text="Dessiner un cercle",o.appendChild(a);break;case"extent":var l=document.createElement("option");l.value="extent",l.text="Dessiner une emprise",o.appendChild(l)}return i.appendChild(o),i},_createReverseGeocodingSubmitFormElement:function(){var t=document.createElement("input");return t.id=this._addUID("GPreverseGeocodingSubmit"),t.className="GPinputSubmit",t.type="submit",t.value="Rechercher",t}};return t}(),LeafletControlsReverseGeocoding=function(t,e,i,n,o,s,r,a){var l=t.Control.extend({includes:a,options:{position:"bottomleft",collapsed:!0,resources:["StreetAddress","PositionOfInterest"],delimitations:["Point","Circle","Extent"],reverseGeocodeOptions:{}},initialize:function(e){t.Util.extend(this.options,e),this._noRightManagement=!1,this._servicesRightManagement={},this._checkRightsManagement(),this._checkInputOptions(),this._uid=s.generate(),this._currentGeocodingType=null,this._initGeocodingType(),this._currentGeocodingDelimitation=null,this._initGeocodingDelimitation(),this._showReverseGeocodingContainer=null,this._panelHeaderContainer=null,this._panelTitleContainer=null,this._returnPictoContainer=null,this._formContainer=null,this._resultsContainer=null,this._resultsListContainer=null,this._waitingContainer=null,this._inputFeaturesLayer=null,this._inputResultsLayer=null,this._lastIdLayer=0,this._currentIdLayer=0,this._currentFeature=null,this._requestPosition=null,this._requestCircleFilter=null,this._requestBboxFilter=null,this._waiting=!1,this._timer=null,this._reverseGeocodingLocations=[]},onAdd:function(e){var i=this._container=this._initLayout();return t.DomEvent.disableClickPropagation(i).disableScrollPropagation(i),e&&(this.options.collapsed||this._activateMapInteraction(e)),i},onRemove:function(){},_checkRightsManagement:function(){var t,e=[],i=null;t=this.options.reverseGeocodeOptions.apiKey,i=this.options.reverseGeocodeOptions.filterOptions,e=i?i.type:[],e&&0!==e.length||(e=this.options.resources),e&&0!==e.length||(e=["StreetAddress","PositionOfInterest"]);var n=o.check({key:t||this.options.apiKey,resources:e,services:["Geocode"]});return n?(this.options.apiKey||(this.options.apiKey=n.key),void(n&&(this._servicesRightManagement.Geocode=n.Geocode))):void(this._noRightManagement=!0)},_checkInputOptions:function(){var t;if(this.options.resources){var e=this.options.resources;Array.isArray(e)||(console.log("[ReverseGeocoding] 'options.resources' parameter should be an array"),e=null);var i=["StreetAddress","PositionOfInterest","CadastralParcel","Administratif"];for(t=0;t<e.length;t++)i.indexOf(e[t])===-1&&console.log("[ReverseGeocoding] options.resources : "+e[t]+" is not a resource for reverse geocode")}if(this.options.delimitations){var n=this.options.delimitations;Array.isArray(n)||(console.log("[ReverseGeocoding] 'options.delimitations' parameter should be an array"),n=null);var o=["Circle","Point","Extent"];for(t=0;t<n.length;t++)o.indexOf(n[t])===-1&&console.log("[ReverseGeocoding] options.delimitations : "+n[t]+" is not a delimitation for reverse geocode")}},_initGeocodingType:function(){this._currentGeocodingType="StreetAddress";var t=this.options.resources;if(t&&0!==t.length||(this.options.resources=["StreetAddress","PositionOfInterest","CadastralParcel"]),Array.isArray(t)&&t.length){for(var e=[],i=0;i<t.length;i++)this._servicesRightManagement.Geocode.indexOf(t[i])<0&&(e.push(i),console.log("[ReverseGeocode] no rights for options.resources : "+t[i]));if(0!==e.length)for(var n=0;n<e.length;n++)t.splice(e[n],1);"StreetAddress"!==t[0]&&"PositionOfInterest"!==t[0]&&"CadastralParcel"!==t[0]&&"Administratif"!==t[0]||(this._currentGeocodingType=t[0])}var o=this.options.reverseGeocodeOptions;o.filterOptions&&Array.isArray(o.filterOptions.type)&&0!==o.filterOptions.type.length&&(this._currentGeocodingType=o.filterOptions.type[0])},_initGeocodingDelimitation:function(){this._currentGeocodingDelimitation="Point";var t=this.options.delimitations;if(t&&0!==t.length||(this.options.delimitations=["Point","Circle","Extent"]),Array.isArray(t)&&t.length){var e=t[0].toLowerCase();"point"!==e&&"circle"!==e&&"extent"!==e||(this._currentGeocodingDelimitation=t[0])}},_initLayout:function(){var t=this._createMainContainerElement(),e=this._showReverseGeocodingContainer=this._createShowReverseGeocodingElement();t.appendChild(e),this.options.collapsed||(e.checked=!0);var i=this._createShowReverseGeocodingPictoElement();t.appendChild(i);var n=this._createReverseGeocodingPanelElement(),o=this._panelHeaderContainer=this._createReverseGeocodingPanelHeaderElement(),s=this._returnPictoContainer=this._createReverseGeocodingPanelReturnPictoElement();o.appendChild(s);var r=this._panelTitleContainer=this._createReverseGeocodingPanelTitleElement();o.appendChild(r);var a=this._createReverseGeocodingPanelCloseElement();o.appendChild(a),n.appendChild(o);var l=this._formContainer=this._createReverseGeocodingPanelFormElement();l.appendChild(this._createReverseGeocodingFormModeChoiceGeocodingTypeElement(this.options.resources)),l.appendChild(this._createReverseGeocodingFormModeChoiceGeocodingDelimitationElement(this.options.delimitations));var c=this._createReverseGeocodingSubmitFormElement();l.appendChild(c),n.appendChild(l);var h=this._waitingContainer=this._createReverseGeocodingWaitingElement();n.appendChild(h);var u=this._resultsContainer=this._createReverseGeocodingResultsPanelElement(),d=this._resultsListContainer=this._createReverseGeocodingResultsListElement();return u.appendChild(d),n.appendChild(u),t.appendChild(n),t},_activateMapInteraction:function(e){if(null===this._inputFeaturesLayer){this._inputFeaturesLayer=new t.FeatureGroup,e.addLayer(this._inputFeaturesLayer);var i=this;e.on("draw:created",function(e){var n=e.layer,o=e.layerType;i._setFeaturePosition(n,o),i._currentIdLayer=t.Util.stamp(n),i._setFeatureLayer(n)}),e.on("draw:drawstart",function(){i._removeFeatureLayer(i._lastIdLayer),i._lastIdLayer=i._currentIdLayer}),e.on("draw:drawstop",function(){})}var n=this._currentGeocodingDelimitation.toLowerCase();switch(n){case"point":this._activatePointInteraction(e);break;case"circle":this._activateCircleInteraction(e);break;case"extent":this._activateBoxInteraction(e)}},_removeMapInteraction:function(t){t&&(null!==this._inputFeaturesLayer&&(t.off("draw:created"),t.off("draw:drawstart"),t.off("draw:drawstop"),t.removeLayer(this._inputFeaturesLayer),this._inputFeaturesLayer=null),this._lastIdLayer=this._currentIdLayer=0,this._currentFeature&&this._currentFeature.disable())},_activatePointInteraction:function(e){this._currentFeature&&this._currentFeature.disable(),t.drawLocal.draw.handlers.marker.tooltip.start="click map to place search point";var i={repeatMode:!0};this._currentFeature=new t.Draw.Marker(e,i),this._currentFeature.enable()},_activateCircleInteraction:function(e){this._currentFeature&&this._currentFeature.disable();var i={repeatMode:!0};this._currentFeature=new t.Draw.Circle(e,i),this._currentFeature.enable()},_activateBoxInteraction:function(e){this._currentFeature&&this._currentFeature.disable();var i={repeatMode:!0};this._currentFeature=new t.Draw.Rectangle(e,i),this._currentFeature.enable()},_setFeaturePosition:function(t,e){var i=null;if("marker"===e)i=t.getLatLng(),this._requestPosition={x:i.lat,y:i.lng};else if("circle"===e)i=t.getLatLng(),this._requestPosition={x:i.lat,y:i.lng},this._requestCircleFilter={x:i.lat,y:i.lng,radius:t.getRadius()};else if("rectangle"===e){i=t.getBounds();var n={lng:(i.getSouthWest().lng+i.getNorthEast().lng)/2,lat:(i.getSouthWest().lat+i.getNorthEast().lat)/2};this._requestPosition={x:n.lat,y:n.lng},this._requestBboxFilter={left:i.getSouthWest().lat,right:i.getNorthEast().lat,bottom:i.getSouthWest().lng,top:i.getNorthEast().lng}}},_setFeatureLayer:function(t){this._inputFeaturesLayer&&this._inputFeaturesLayer.addLayer(t)},_removeFeatureLayer:function(t){this._inputFeaturesLayer&&0!==t&&(t?this._inputFeaturesLayer.removeLayer(t):this._inputFeaturesLayer.clearLayers())},_reverseGeocodingRequest:function(e){var i=this._map;this._removeMapInteraction(i);var o={};t.Util.extend(o,this.options.reverseGeocodeOptions),t.Util.extend(o,e),t.Util.extend(o,{apiKey:this.options.apiKey,srs:"EPSG:4326",returnFreeForm:!1,timeOut:3e4,protocol:"XHR"});var s=o.filterOptions.type;"circle"===this._currentGeocodingDelimitation.toLowerCase()&&this._requestCircleFilter&&(this._requestCircleFilter.radius>1e3&&(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<t.length;e++){var i=t[e],n=this._fillGeocodedLocationDescription(i);0!==n.length&&this._createReverseGeocodingResultElement(n,e)}},_fillGeocodedLocationDescription:function(t){if(t&&t.placeAttributes){var e=t.placeAttributes,i="";switch(t.type){case"StreetAddress":e.street&&(i+=e.number?e.number+" ":"",i+=e.street+", "),i+=e.postalCode+" "+e.commune;break;case"PositionOfInterest":"City"===t.matchType&&e.commune?(i+=e.commune,i+=e.postalCode?", "+e.postalCode:""):"Département"===t.matchType&&e.municipality?(i+=e.municipality,i+=e.postalCode?", "+e.postalCode:""):"Toponym"===t.matchType&&e.municipality?(i+=e.municipality,i+=e.postalCode?", "+e.postalCode:"",i+=e.commune?" "+e.commune:""):i+=e.municipality?e.municipality:"",i+=e.nature?" ("+e.nature+") ":"";break;case"CadastralParcel":i+=e.cadastralParcel?e.cadastralParcel:"",i+=e.municipality?" ("+e.municipality+")":"";break;case"Administratif":i+=e.municipality?e.municipality:"",e.inseeDepartment?i+="(Département)":e.inseeRegion&&(i+="(Région)");break;default:i+=e.municipality?e.municipality:""}return i}},_displayGeocodedLocationsOnMap:function(e){function i(e){var i=e.target;i.setIcon(new r("red"));var n=t.DomUtil.get("ReverseGeocodedLocation_"+i.options.id+"-"+s._uid);t.DomUtil.addClass(n,"GPreverseGeocodedLocationHighlight"),n.scrollIntoView(!1)}function n(e){var i=e.target;i.setIcon(new r("green"));var n=t.DomUtil.get("ReverseGeocodedLocation_"+i.options.id+"-"+s._uid);t.DomUtil.removeClass(n,"GPreverseGeocodedLocationHighlight")}var o=this._map,s=this;this._inputResultsLayer=new t.FeatureGroup,o.addLayer(this._inputResultsLayer);for(var a=0;a<e.length;a++){var l=e[a];if(l){var c={id:a,icon:new r("green"),riseOnHover:!0,draggable:!1,clickable:!0,zIndexOffset:1e3},h=t.marker(t.latLng(l.position.x,l.position.y),c),u="<ul>",d=l.placeAttributes;for(var p in d)d.hasOwnProperty(p)&&"bbox"!==p&&(u+="<li>",u+='<span class="gp-attname-others-span">'+p.toUpperCase()+" : </span>",u+=d[p],u+=" </li>");u+=" </ul>",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;c<n.length;c++){var h=n[c].childNodes[0].id;if(l=t.index(h),"GPflexInput GPlocationStageFlexInput"==document.getElementById(e._addUID("GPlocationPoint_"+l)).className){var u=document.createElement("div");u.className="GProuteResultsStages";var d=document.createElement("div");d.className="GProuteResultStageLabel",d.innerHTML=document.getElementById(e._addUID("GPlocationOriginLabel_"+l)).innerHTML+" :",u.appendChild(d);var p=document.createElement("div");p.className="GProuteResultStageValue";var m=document.getElementById(e._addUID("GPlocationOriginCoords_"+l)),f=m.value,_="GPlocationOriginVisible"===m.className;null!=f&&""!=f&&_?p.innerHTML=f:p.innerHTML=document.getElementById(e._addUID("GPlocationOrigin_"+l)).value,u.appendChild(p),""!=p.innerHTML&&document.getElementById(e._addUID("GProuteResultsStages")).appendChild(u)}}var g=null;if(document.getElementById(e._addUID("GProuteComputationSelect"))){var v=document.getElementById(e._addUID("GProuteResultsComputationSelect"));v.selectedIndex=document.getElementById(e._addUID("GProuteComputationSelect")).selectedIndex,g=v.options[v.selectedIndex].value}var y=null;document.getElementById(e._addUID("GProuteTransportCar"))&&document.getElementById(e._addUID("GProuteTransportCar")).checked&&(y=document.getElementById(e._addUID("GProuteTransportCar")).value),document.getElementById(e._addUID("GProuteTransportPedestrian"))&&document.getElementById(e._addUID("GProuteTransportPedestrian")).checked&&(y=document.getElementById(e._addUID("GProuteTransportPedestrian")).value);for(var E=[],P=document.getElementsByClassName("GProuteExclusionsOption"),C=0;C<P.length;C++){l=P[C].htmlFor;var S=document.getElementById(l);S.checked||E.push(S.value)}return e.onRouteComputationSubmit({computation:g,transport:y,exclusions:E}),!1}),i},_createRoutePanelResultsElement:function(){var t=document.createElement("div");t.id=this._addUID("GProuteResultsPanel"),t.className="GProuteComponentHidden",t.appendChild(this._createRouteResultsStagesElement()),t.appendChild(this._createRouteResultsElement());var e=document.createElement("div");e.className="GPfakeBorder GPfakeBorderLeft",t.appendChild(e),t.appendChild(this._createRouteShowResultsDetailsElement());var i=document.createElement("label");i.htmlFor=this._addUID("GProuteResultsShowDetails"),i.innerHTML="Afficher le détail",t.appendChild(i);var n=document.createElement("label");n.htmlFor=this._addUID("GProuteResultsShowDetails"),n.innerHTML="Masquer le détail",t.appendChild(n);var o=document.createElement("div");return o.className="GPfakeBorder",t.appendChild(o),t.appendChild(this._createRouteResultsDetailsElement()),t},_createRouteWaitingElement:function(){var t=document.createElement("div");t.id=this._addUID("GProuteCalcWaitingContainer"),t.className="GProuteCalcWaitingContainerHidden";var e=document.createElement("p");return e.className="GProuteCalcWaiting",e.innerHTML="Calcul en cours...",t.appendChild(e),t},_createRouteResultsStagesElement:function(){var t=document.createElement("div");return t.id=this._addUID("GProuteResultsStages"),t},_createRouteResultsElement:function(){var t=this,e=document.createElement("div");e.id=this._addUID("GProuteResults");var i=document.createElement("div");i.id=this._addUID("GProuteResultsValues"),e.appendChild(i);var n=document.createElement("div");n.id=this._addUID("GProuteResultsMode");var o=document.createElement("select");o.id=this._addUID("GProuteResultsComputationSelect"),o.className="GPinputSelect",o.addEventListener("change",function(e){t.onRouteModeComputationChangeAndRun(e)});for(var s=[{code:"fastest",label:"Plus rapide"},{code:"shortest",label:"Plus court"}],r=0;r<s.length;r++){var a=document.createElement("option");a.value=s[r].code,a.text=s[r].label,o.appendChild(a)}n.appendChild(o),e.appendChild(n);var l=document.createElement("div");return l.id=this._addUID("GProuteResultsNew"),l.title="Modifier le calcul",l.addEventListener("click",function(e){document.getElementById(t._addUID("GProuteResultsPanel")).className="GProuteComponentHidden",document.getElementById(t._addUID("GProuteForm")).className="",t.onShowRouteResultsNewClick(e)}),e.appendChild(l),e},_addRouteResultsValuesElement:function(t,e,i){var n=document.getElementById(this._addUID("GProuteResultsValues"));if(n.childElementCount)for(;n.firstChild;)n.removeChild(n.firstChild);var o=document.createElement("div");o.className="GProuteResultsValue";var s=document.createElement("label");s.className="GProuteResultsValueLabel",s.innerHTML="Distance :",o.appendChild(s);var r=0,a=parseInt(t/1e3,10);if(a){var l=Math.round(t);l/=1e3,r=l+" km"}else r=Math.round(t)+" m";var c=document.createElement("div");c.id=this._addUID("GProuteResultsValueDist"),c.innerHTML=r,o.appendChild(c),n.appendChild(o);var h=document.createElement("div");h.className="GProuteResultsValue";var u=document.createElement("label");u.className="GProuteResultsValueLabel",u.innerHTML="Durée :",h.appendChild(u);var d=document.createElement("div");return d.id=this._addUID("GProuteResultsValueDist"),d.innerHTML=i(e),h.appendChild(d),n.appendChild(h),n},_createRouteShowResultsDetailsElement:function(){var t=document.createElement("input");return t.id=this._addUID("GProuteResultsShowDetails"),t.type="checkbox",t},_createRouteResultsDetailsElement:function(){var t=document.createElement("div");return t.id=this._addUID("GProuteResultsDetails"),t},_addRouteResultsDetailsElement:function(t,e){var i=this,n=document.getElementById(this._addUID("GProuteResultsDetails"));if(n.childElementCount)for(;n.firstChild;)n.removeChild(n.firstChild);for(var o=0,s=0,r=0;r<t.length;r++){var a=r+1,l=t[r],c=document.createElement("div");c.className="GProuteResultsDetailsNumber",c.innerHTML=a+".",n.appendChild(c),s+=parseFloat(l.duration),o+=parseFloat(l.distance);var h=0,u=parseInt(o/1e3,10);if(u){var d=Math.round(o);d/=1e3,h=d+" km"}else h=Math.round(o)+" m";var p=document.createElement("div");p.className="GProuteResultsDetailsInstruction",p.id=this._addUID("GProuteResultsDetailsInstruction_"+a),p.title="distance : "+h+" / temps : "+e(s),p.innerHTML=l.instruction,p.addEventListener("mouseover",function(t){i.onRouteResultsDetailsMouseOver(t)}),p.addEventListener("mouseout",function(t){i.onRouteResultsDetailsMouseOut(t)}),p.addEventListener("click",function(t){"function"==typeof i.onRouteResultsDetailsClick&&i.onRouteResultsDetailsClick(t)}),n.appendChild(p)}return n},_createRoutePanelFormPointElement:function(t,e,i){var n=this,o=document.createElement("div");o.id="GProutePoint"+t,o.className=i?"GPflexInput GProuteStageFlexInput":"GPflexInput GProuteStageFlexInputHidden";var s=document.createElement("label");s.id="GProuteOriginLabel"+t,s.htmlFor="GProuteOrigin"+t,s.innerHTML=e,s.addEventListener("click",function(){var t=this.id.charAt(this.id.length-1);document.getElementById("GProuteOriginCoords"+t).value="";for(var e=1;e<8;e++)document.getElementById("GProutePoint"+e).style.display="flex";document.getElementById("GProuteForm").className="",document.getElementById("GProuteOriginPointer"+t).checked=!1,document.getElementById("GProuteOrigin"+t).className="GProuteOriginVisible",document.getElementById("GProuteOriginCoords"+t).className="GProuteOriginHidden"}),o.appendChild(s);var r=document.createElement("input");r.id="GProuteOrigin"+t,r.className="GProuteOriginVisible",r.type="text",r.placeholder="Saisir une adresse",r.addEventListener("keyup",function(t){var e=t.which||t.keyCode;if(13!==e&&10!==e){var i=this.id.charAt(this.id.length-1);document.getElementById("GProuteOrigin"+i).value.length>2?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;o<t.length;o++){var s=t[o];if("Voiture"===s){var r=document.createElement("input");r.id=this._addUID("GProuteTransportCar"),r.type="radio",r.name="GProuteTransport",r.value="Voiture",0===o&&(r.checked=!0),r.addEventListener?r.addEventListener("change",function(t){e.onRouteModeTransportChange(t)}):r.attachEvent&&r.attachEvent("onchange",function(t){e.onRouteModeTransportChange(t)}),i.appendChild(r);var a=document.createElement("label");a.className="GProuteTransportImg",a.htmlFor=this._addUID("GProuteTransportCar"),a.title="Voiture",i.appendChild(a)}if("Pieton"===s){var l=document.createElement("input");l.id=this._addUID("GProuteTransportPedestrian"),l.type="radio",l.name="GProuteTransport",l.value="Pieton",0===o&&(l.checked=!0),l.addEventListener?l.addEventListener("change",function(t){e.onRouteModeTransportChange(t)}):l.attachEvent&&l.attachEvent("onchange",function(t){e.onRouteModeTransportChange(t)}),i.appendChild(l);var c=document.createElement("label");c.className="GProuteTransportImg",c.htmlFor=this._addUID("GProuteTransportPedestrian"),c.title="Piéton",i.appendChild(c)}}return i},_createRoutePanelFormModeChoiceComputeElement:function(){var t=this,e=document.createElement("div");e.id=this._addUID("GProuteComputationChoice");var i=document.createElement("span");i.className="GProuteModeLabel",i.innerHTML="Mode de calcul",e.appendChild(i);var n=document.createElement("select");n.id=this._addUID("GProuteComputationSelect"),n.className="GPinputSelect",n.addEventListener("change",function(e){t.onRouteModeComputationChange(e)});for(var o=[{code:"fastest",label:"Plus rapide"},{code:"shortest",label:"Plus court"}],s=0;s<o.length;s++){var r=document.createElement("option");r.value=o[s].code,r.text=o[s].label,n.appendChild(r)}return e.appendChild(n),e},_createShowRouteExclusionsElement:function(){var t=document.createElement("input");return t.id=this._addUID("GPshowRouteExclusions"),t.type="checkbox",t},_createShowRouteExclusionsPictoElement:function(){var t=this,e=document.createElement("label");return e.id=this._addUID("GPshowRouteExclusionsPicto"),
       
   153 e.className="GPshowMoreOptions GPshowRouteExclusionsPicto",e.htmlFor=this._addUID("GPshowRouteExclusions"),e.title="Exclusions",e.style.top="185px",e.addEventListener?e.addEventListener("click",function(e){t.onShowRouteExclusionsClick(e)}):e.attachEvent&&e.attachEvent("onclick",function(e){t.onShowRouteExclusionsClick(e)}),e},_createRoutePanelFormExclusionsElement:function(){var t=document.createElement("div");t.id=this._addUID("GProuteExclusions");var e=document.createElement("span");return e.className="GProuteExclusionsLabel",e.innerHTML="Passages autorisés",t.appendChild(e),t},_createRoutePanelFormExclusionOptionsElement:function(t){var e=this,i=document.createElement("div");i.className="GProuteExclusionsOptions";for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];switch(n){case"toll":var s=document.createElement("input");s.id=this._addUID("GProuteExclusionsToll"),s.type="checkbox",s.value="Toll",s.checked=!o,s.addEventListener?s.addEventListener("change",function(t){e.onRouteExclusionsChange(t)}):s.attachEvent&&s.attachEvent("onchange",function(t){e.onRouteExclusionsChange(t)}),i.appendChild(s);var r=document.createElement("label");r.className="GProuteExclusionsOption",r.htmlFor=this._addUID("GProuteExclusionsToll"),r.innerHTML="Péages",i.appendChild(r);break;case"tunnel":var a=document.createElement("input");a.id=this._addUID("GProuteExclusionsTunnel"),a.type="checkbox",a.value="Tunnel",a.checked=!o,a.addEventListener?a.addEventListener("change",function(t){e.onRouteExclusionsChange(t)}):a.attachEvent&&a.attachEvent("onchange",function(t){e.onRouteExclusionsChange(t)}),i.appendChild(a);var l=document.createElement("label");l.className="GProuteExclusionsOption",l.htmlFor=this._addUID("GProuteExclusionsTunnel"),l.innerHTML="Tunnels",i.appendChild(l);break;case"bridge":var c=document.createElement("input");c.id=this._addUID("GProuteExclusionsBridge"),c.type="checkbox",c.value="Bridge",c.checked=!o,c.addEventListener?c.addEventListener("change",function(t){e.onRouteExclusionsChange(t)}):c.attachEvent&&c.attachEvent("onchange",function(t){e.onRouteExclusionsChange(t)}),i.appendChild(c);var h=document.createElement("label");h.className="GProuteExclusionsOption",h.htmlFor=this._addUID("GProuteExclusionsBridge"),h.innerHTML="Ponts",i.appendChild(h)}}return i},_createRouteSubmitFormElement:function(){var t=document.createElement("input");return t.id=this._addUID("GProuteSubmit"),t.className="GPinputSubmit",t.type="submit",t.value="Calculer",t},_createRouteFormResetElement:function(){var t=this,e=document.createElement("div");return e.id=this._addUID("GProuteReset"),e.title="Réinitialiser les paramètres",e.addEventListener("click",function(e){t.onRouteResetClick(e)}),e}};return e}(CommonUtilsSelectorID),LeafletControlsRoute=function(t,e,i,n,o,s,r){var a=t.Control.extend({includes:r,options:{position:"topleft",collapsed:!0,graphs:["Voiture","Pieton"],exclusions:{toll:!1,tunnel:!1,bridge:!1},disableReverse:!1,routeOptions:{},autocompleteOptions:{}},initialize:function(e){t.Util.setOptions(this,e),this._uid=o.generate(),this._initTransport(),this._initExclusions(),this._initComputation(),this._waitingContainer=null,this._formRouteContainer=null,this._resultsRouteContainer=null,this._isDesktop=this._detectSupport(),this._currentPoints=[],this._currentTransport=null,this._currentComputation=null,this._currentExclusions=[],this._geojsonRoute=null,this._geojsonSections=null,this._waiting=!1,this._timer=null,this._currentRouteInformations=null,this._resources={},this._noRightManagement=!1,this._checkRightsManagement()},onAdd:function(e){var i=this._container=this._initLayout(e);return t.DomEvent.disableClickPropagation(i).disableScrollPropagation(i),i},onRemove:function(){},_initTransport:function(){this._currentTransport="Voiture";var e=this.options.graphs;e&&0!==e.length||(this.options.graphs=["Voiture","Pieton"]),t.Util.isArray(e)&&e.length&&("Voiture"!==e[0]&&"Pieton"!==e[0]||(this._currentTransport=e[0]));var i=this.options.routeOptions;i.graph&&(this._currentTransport=i.graph)},_initComputation:function(){this._currentComputation="fastest";var t=this.options.routeOptions;t.routePreference&&(this._currentComputation=t.routePreference)},_initExclusions:function(){this._currentExclusions=[];var e=this.options.exclusions;if(e&&0!==Object.keys(e).length||(this.options.exclusions={toll:!1,tunnel:!1,bridge:!1}),e&&Object.keys(e).length)for(var i in e)e.hasOwnProperty(i)&&e.k&&this._currentExclusions.push(i);var n=this.options.routeOptions;t.Util.isArray(n.exclusions)&&(this._currentExclusions=n.exclusions)},_checkRightsManagement:function(){var t=null,e=[],i=null;i=this.options.routeOptions.apiKey,t=this.options.routeOptions.filterOptions,e=t?t.type:[],e&&0!==e.length||(e=["Voiture","Pieton"]);var o=n.check({key:i||this.options.apiKey,resources:e,services:["Itineraire"]});i=this.options.autocompleteOptions.apiKey,t=this.options.autocompleteOptions.filterOptions,e=t?t.type:[],e&&0!==e.length||(e=["StreetAddress","PositionOfInterest"]);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.Itineraire={},this._resources.Itineraire.resources=o.Itineraire,this._resources.Itineraire.key=o.key)},_detectSupport:function(){var t=!0,e=window.navigator.userAgent.toLowerCase();return e.indexOf("iphone")===-1&&e.indexOf("ipod")===-1&&e.indexOf("ipad")===-1&&e.indexOf("android")===-1&&e.indexOf("mobile")===-1&&e.indexOf("blackberry")===-1&&e.indexOf("tablet")===-1&&e.indexOf("phone")===-1&&e.indexOf("touch")===-1||(t=!1),e.indexOf("msie")===-1&&e.indexOf("trident")===-1||(t=!0),t},_initLayout:function(t){var e=this._createMainContainerElement(),i=this._showRouteContainer=this._createShowRouteElement();e.appendChild(i),this.options.collapsed||(i.checked=!0);var n=this._createShowRoutePictoElement();e.appendChild(n);var o=this._createRoutePanelElement(),s=this._createRoutePanelHeaderElement();o.appendChild(s);for(var r=this._formRouteContainer=this._createRoutePanelFormElement(),a=this._createRoutePanelFormPointsElement(t),l=0;l<a.length;l++)r.appendChild(a[l]);var c=this._createRoutePanelFormModeChoiceElement();c.appendChild(this._createRoutePanelFormModeChoiceTransportElement(this.options.graphs)),c.appendChild(this._createRoutePanelFormModeChoiceComputeElement()),r.appendChild(c),r.appendChild(this._createShowRouteExclusionsElement()),r.appendChild(this._createShowRouteExclusionsPictoElement());var h=this._createRoutePanelFormExclusionsElement();h.appendChild(this._createRoutePanelFormExclusionOptionsElement(this.options.exclusions)),r.appendChild(h);var u=this._createRouteSubmitFormElement();r.appendChild(u),o.appendChild(r);var d=this._resultsRouteContainer=this._createRoutePanelResultsElement();o.appendChild(d);var p=this._waitingContainer=this._createRouteWaitingElement();return o.appendChild(p),e.appendChild(o),e},_createRoutePanelFormPointsElement:function(t){var e=[],i=1,n=new s({apiKey:this.options.apiKey||null,tag:{id:i,unique:this._uid,label:"Départ",color:"blue",display:!0},disableReverse:this.options.disableReverse,autocompleteOptions:this.options.autocompleteOptions||null});for(n.setMap(t),e.push(n.getContainer()),this._currentPoints.push(n),i=2;i<7;i++){var o=new s({apiKey:this.options.apiKey||null,tag:{id:i,unique:this._uid,label:"Etape",color:"green",display:!1,removeOption:!0},disableReverse:this.options.disableReverse,autocompleteOptions:this.options.autocompleteOptions||null});o.setMap(t),e.push(o.getContainer()),this._currentPoints.push(o)}var r=new s({apiKey:this.options.apiKey||null,tag:{id:i,unique:this._uid,label:"Arrivée",color:"red",display:!0,addOption:!0,removeOption:!1},disableReverse:this.options.disableReverse,autocompleteOptions:this.options.autocompleteOptions||null});return r.setMap(t),e.push(r.getContainer()),this._currentPoints.push(r),e},onShowRoutePanelClick:function(t){this._geojsonSections||this._clear()},onRouteModeComputationChange:function(t){var e=t.target.selectedIndex,i=t.target.options[e].value;i&&(this._currentComputation=i)},onRouteModeComputationChangeAndRun:function(t){this.onRouteModeComputationChange(t),this._clearRouteResultsDetails(),this._clearRouteResultsGeometry(),this._clearRouteResultsFeatureGeometry(),this.onRouteComputationSubmit({computation:this._currentComputation,transport:this._currentTransport,exclusions:this._currentExclusions})},onRouteModeTransportChange:function(t){var e=t.target.value;e&&(this._currentTransport=e)},onShowRouteExclusionsClick:function(t){},onRouteExclusionsChange:function(t){var e=t.target.value,i=t.target.checked;if(e){for(var n=!1,o=null,s=0;s<this._currentExclusions.length;s++)this._currentExclusions[s]===e&&(o=s,n=!0);!n&&i&&this._currentExclusions.push(e),n&&!i&&(this._currentExclusions[o]=null)}},onRouteComputationSubmit:function(t){var e=this._currentPoints,i=e[0].getCoordinate();e[0].dragging(!1);var n=e[e.length-1].getCoordinate();e[e.length-1].dragging(!1);for(var o=[],s=1;s<e.length-1;s++){var r=e[s].getCoordinate();e[s].dragging(!1),r&&o.push(r)}if(!this._noRightManagement){this._currentTransport=t.transport,this._currentComputation=t.computation,this._currentExclusions=t.exclusions,this._displayWaitingContainer();var a=this;this._requestRouting({startPoint:i,endPoint:n,viaPoints:o,graph:this._currentTransport,routePreference:this._currentComputation,exclusions:this._currentExclusions,geometryInInstructions:!0,distanceUnit:"m",onSuccess:function(t){t&&a._fillRouteResultsDetails(t)},onFailure:function(t){a._hideWaitingContainer(),a._clearRouteResultsDetails()}})}},onShowRouteResultsNewClick:function(t){for(var e=this._currentPoints,i=0;i<e.length;i++)e[i].dragging(!0);this._clearRouteResultsDetails(),this._clearRouteResultsGeometry(),this._clearRouteResultsFeatureGeometry()},onRouteResultsDetailsMouseOver:function(t){var e=o.index(t.target.id);this._isDesktop&&this._geojsonSections&&this._geojsonSections.eachLayer(function(t){t.feature.id===parseInt(e,10)&&t.setStyle({weight:10,color:"#0F9DE8",opacity:.5})})},onRouteResultsDetailsMouseOut:function(t){var e=o.index(t.target.id);this._isDesktop&&this._geojsonSections&&this._geojsonSections.eachLayer(function(t){t.feature.id===parseInt(e,10)&&t.setStyle({color:"#ED7F10",weight:5,opacity:.75})})},onRouteResultsDetailsClick:function(t){var e=o.index(t.target.id),i=this;if(!this._isDesktop&&this._geojsonSections){var n=t.target.title,s=t.target.innerHTML;this._geojsonSections.eachLayer(function(i){i.feature.id===parseInt(e,10)&&(t.target.innerHTML=n,i.setStyle({weight:10,color:"#0F9DE8",opacity:.5}))}),clearTimeout(1e3),setTimeout(function(){i._geojsonSections.eachLayer(function(i){i.feature.id===parseInt(e,10)&&(t.target.innerHTML=s,i.setStyle({color:"#ED7F10",weight:5,opacity:.75}))})},1e3)}},_requestRouting:function(e){if(e&&0!==Object.keys(e).length&&e.startPoint&&e.endPoint){if(this._noRightManagement)return void console.log("no rights for all service !?");if(!this._resources.Itineraire)return void console.log("no rights for this service !?");var n=this._resources.Itineraire.resources;if(n&&0!==Object.keys(n).length){var o=this._resources.Itineraire.key,s={};t.Util.extend(s,this.options.routeOptions),t.Util.extend(s,e);for(var r=!1,a=0;a<n.length;a++)n[a]===s.graph&&(r=!0);if(!r)return void console.log("no rights for this service !?");t.Util.extend(s,{apiKey:this.options.routeOptions.apiKey||this.options.apiKey||o}),i.Services.route(s)}}},_fillRouteResultsDetails:function(e){var i=e.totalDistance,n=e.totalTime,o=this._simplifiedInstructions(e.routeInstructions);o&&this._fillRouteResultsDetailsContainer(i,n,o);var s=e.routeGeometry;s&&this._fillRouteResultsDetailsGeometry(s);var r=0!==o[0].geometry.length;o&&r&&this._fillRouteResultsDetailsFeatureGeometry(o);var a=e.bbox;if(a){var l=this._map,c=t.latLngBounds([a.bottom,a.left],[a.top,a.right]);l.fitBounds(c,{padding:[1,1]})}this._currentRouteInformations=e,this._formRouteContainer.className="GProuteComponentHidden",this._hideWaitingContainer(),this._resultsRouteContainer.className=""},_fillRouteResultsDetailsContainer:function(t,e,i){this._resultsRouteValuesContainer=this._addRouteResultsValuesElement(t,e,this._convertSecondsToTime),this._resultsRouteDetailsContainer=this._addRouteResultsDetailsElement(i,this._convertSecondsToTime)},_fillRouteResultsDetailsGeometry:function(e){this._clearRouteResultsGeometry();var i=this._map,n={color:"#ff7800",weight:5,opacity:.65};this._geojsonRoute=t.geoJson(e,{style:n}).addTo(i)},_fillRouteResultsDetailsFeatureGeometry:function(e){function i(e){var i=e.target;h._geojsonSections.resetStyle(i);var n=t.DomUtil.get("GProuteResultsDetailsInstruction_"+i.feature.id+"-"+h._uid);t.DomUtil.removeClass(n,"GProuteResultsDetailsHighlight")}function n(e){var i=e.target;i.setStyle({weight:10,color:"#0F9DE8",opacity:.5});var n=t.DomUtil.get("GProuteResultsDetailsInstruction_"+i.feature.id+"-"+h._uid);t.DomUtil.addClass(n,"GProuteResultsDetailsHighlight")}this._clearRouteResultsFeatureGeometry();for(var o=this._map,s={color:"#ED7F10",weight:5,opacity:.75},r={type:"FeatureCollection",features:[]},a=0;a<e.length;a++){var l=e[a],c=a+1;r.features.push({id:c,type:"Feature",geometry:l.geometry,properties:{popupContent:"("+c+") distance : "+this._convertDistance(l.distance)+" / temps : "+this._convertSecondsToTime(l.duration)}})}var h=this;this._geojsonSections=t.geoJson(r,{style:s,onEachFeature:function(t,e){e.on({mouseover:n,mouseout:i}),e.bindPopup(t.properties.popupContent)}}).addTo(o)},_clear:function(){this._currentTransport=null,this._currentExclusions=[],this._currentComputation=null,this._clearRouteResultsDetails(),this._clearRouteResultsGeometry(),this._clearRouteResultsFeatureGeometry();for(var t=0;t<this._currentPoints.length;t++)this._currentPoints[t].clear()},_clearRouteResultsDetails:function(){if(this._currentRouteInformations=null,this._resultsRouteDetailsContainer){var t=this._resultsRouteDetailsContainer;if(t.childElementCount)for(;t.firstChild;)t.removeChild(t.firstChild)}if(this._resultsRouteValuesContainer){var e=this._resultsRouteValuesContainer;if(e.childElementCount)for(;e.firstChild;)e.removeChild(e.firstChild)}},_clearRouteResultsGeometry:function(){var t=this._map;null!=this._geojsonRoute&&(t.removeLayer(this._geojsonRoute),this._geojsonRoute=null)},_clearRouteResultsFeatureGeometry:function(){var t=this._map;null!=this._geojsonSections&&(t.removeLayer(this._geojsonSections),this._geojsonSections=null)},_displayWaitingContainer:function(){this._waitingContainer.className="GProuteCalcWaitingContainerVisible",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="GProuteCalcWaitingContainerHidden",this._waiting=!1,clearTimeout(this._timer),this._timer=null)},_simplifiedInstructions:function(t){var e=[],i=t[0];1===t.length&&e.push(i);for(var n=1;n<t.length;n++){var o=t[n];if(o.instruction===i.instruction){i.distance=(parseFloat(o.distance)+parseFloat(i.distance)).toString(),i.duration=(parseFloat(o.duration)+parseFloat(i.duration)).toString();for(var s=1;s<o.geometry.coordinates.length;s++)i.geometry.coordinates.push(o.geometry.coordinates[s]);n===t.length-1&&(e.push(i),i=null)}else e.push(i),i=o,n===t.length-1&&(e.push(o),i=null)}return e},_convertSecondsToTime:function(t){var e="";t=Math.round(t);var i=Math.floor(t/3600);i||(i="00");var n=t%3600,o=Math.floor(n/60);o||(o="00");var s=n%60,r=Math.ceil(s);return r||(r="00"),e=i+"h "+o+"m "+r+"s"},_convertDistance:function(t){var e="",i=parseInt(t/1e3,10);return e=i?i+" km":parseInt(t,10)+" m"}});return a}(leaflet,{},gp,CommonUtilsCheckRightManagement,CommonUtilsSelectorID,LeafletControlsLocationSelector,CommonControlsRouteDOM),CommonControlsSearchEngineDOM=function(t){var e={_addUID:function(t){return t+"-"+this._uid},_createMainContainerElement:function(){var t=document.createElement("div");return t.id=this._addUID("GPsearchEngine"),t.className="GPwidget",t},_createShowSearchEngineElement:function(){var t=document.createElement("input");return t.id=this._addUID("GPshowSearchEngine"),t.type="checkbox",t},_createShowSearchEnginePictoElement:function(){var t=this,e=document.createElement("label");e.id=this._addUID("GPshowSearchEnginePicto"),e.className="GPshowAdvancedToolPicto",e.htmlFor=this._addUID("GPshowSearchEngine"),e.title="Afficher/masquer la recherche par lieux",e.addEventListener("click",function(){document.getElementById(t._addUID("GPautoCompleteList")).style.display="none",document.getElementById(t._addUID("GPgeocodeResultsList")).style.display="none";var e=document.getElementById(t._addUID("GPshowAdvancedSearch"));e&&(e.style.display=null,document.getElementById(t._addUID("GPadvancedSearchPanel")).style.display="none");var i="#GPsearchInput-"+t._uid;document.querySelector(i+" input").disabled=!1,t.onShowSearchEngineClick()});var i=document.createElement("span");return i.id=this._addUID("GPshowSearchEngineOpen"),i.className="GPshowAdvancedToolOpen",e.appendChild(i),e},_createSearchInputElement:function(){var t=this,e=document.createElement("form");e.id=this._addUID("GPsearchInput"),e.addEventListener("submit",function(e){return e.preventDefault(),document.getElementById(t._addUID("GPgeocodeResultsList")).style.display="block",document.getElementById(t._addUID("GPautoCompleteList")).style.display="none",t.onGeocodingSearchSubmit(e),!1});var i=document.createElement("input");i.id=this._addUID("GPsearchInputText"),i.type="text",i.placeholder="Rechercher un lieu, une adresse",i.autocomplete="off",i.addEventListener("keyup",function(e){var n=e.which||e.keyCode;13!==n&&10!==n&&38!==n&&40!==n&&(document.getElementById(t._addUID("GPgeocodeResultsList")).style.display="none",i.value.length>2?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;s<o.length;s++){var r=o[s];i.push({key:r.name,value:r.value})}return e.onGeocodingAdvancedSearchSubmit(t,i),document.getElementById(e._addUID("GPgeocodeResultsList")).style.display="block",!1});var n=document.createElement("div");n.className="GPflexInput";var o=document.createElement("label");o.className="GPadvancedSearchCodeLabel",o.innerHTML="Recherche par",n.appendChild(o);var s=this._createAdvancedSearchFormCodeElement(t);return n.appendChild(s),i.appendChild(n),i},_createAdvancedSearchFormCodeElement:function(t){var e=this,i=document.createElement("select");i.id=this._addUID("GPadvancedSearchCode"),i.className="GPadvancedSearchCode",i.addEventListener("change",function(t){e.onGeocodingAdvancedSearchCodeChange(t)},!1),t||(t=[{id:"PositionOfInterest",title:"Lieux/toponymes"},{id:"StreetAddress",title:"Adresses"},{id:"CadastralParcel",title:"Parcelles cadastrales"},{id:"Administratif",title:"Administratif"}]);for(var n=0;n<t.length;n++){var o=document.createElement("option");o.value=t[n].id,o.text=t[n].title,i.appendChild(o)}return i},_createAdvancedSearchFormInputElement:function(){var t=document.createElement("input");return t.type="submit",t.id=this._addUID("GPadvancedSearchSubmit"),t.className="GPinputSubmit",t.value="Chercher",t},_createAdvancedSearchFormFiltersElement:function(){var t=document.createElement("div");return t.id=this._addUID("GPadvancedSearchFilters"),t},_createAdvancedSearchFiltersTableElement:function(t,e){var i=document.createElement("div");return i.id=this._addUID(t),e||(i.style.display="none"),i},_createAdvancedSearchFiltersAttributElement:function(t){var e=null,i=t.name,n=t.title,o=t.description,s=t.code,r=t.value,a=document.createElement("div");a.className="GPflexInput";var l=document.createElement("label");l.className="GPadvancedSearchFilterLabel",l.htmlFor=i,l.title=o||n,l.innerHTML=n,a.appendChild(l);var c=document.createElement("input");return c.id=i,c.className="GPadvancedSearchFilterInput",c.type="text",c.name=i,r&&(c.value=r),a.appendChild(c),e=document.getElementById(this._addUID(s)),e?e.appendChild(a):e=a,e},_createGeocodeResultsHeaderElement:function(){var t=this,e=document.createElement("div");e.className="GPpanelHeader";var i=document.createElement("div");i.className="GPpanelTitle",i.innerHTML="Résultats de la recherche",e.appendChild(i);var n=document.createElement("div");return n.id=this._addUID("GPgeocodeResultsClose"),n.className="GPpanelClose",n.title="Fermer la fenêtre de résultats",n.addEventListener?n.addEventListener("click",function(){document.getElementById(t._addUID("GPgeocodeResultsList")).style.display="none"},!1):n.attachEvent&&n.attachEvent("onclick",function(){document.getElementById(t._addUID("GPgeocodeResultsList")).style.display="none"}),e.appendChild(n),e},_createGeocodeResultsListElement:function(){var t=this,e=document.createElement("div");return e.id=this._addUID("GPgeocodeResults"),e.addEventListener?e.addEventListener("click",function(e){e.ctrlKey||(document.getElementById(t._addUID("GPgeocodeResultsList")).style.display="none"),t.onGeocodedResultsItemClick(e)},!1):e.attachEvent&&e.attachEvent("onclick",function(e){e.ctrlKey||(document.getElementById(t._addUID("GPgeocodeResultsList")).style.display="none"),t.onGeocodedResultsItemClick(e)}),e},_createGeocodedLocationElement:function(t,e){var i=document.getElementById(this._addUID("GPgeocodeResults")),n=document.createElement("div");if(n.id=this._addUID("GeocodedLocation_"+e),n.className="GPautoCompleteProposal","string"==typeof t)n.innerHTML=t;else{var o=t.placeAttributes;o.freeform?n.innerHTML=o.freeform:o.postalCode?n.innerHTML=o.postalCode+" "+o.commune:o.cadastralParcel?n.innerHTML=o.cadastralParcel:n.innerHTML="..."}i.appendChild(n)}};return e}(CommonUtilsSelectorID),CommonControlsSearchEngineUtils=function(){var t={advancedSearchFiltersByDefault:{PositionOfInterest:[{name:"importance",title:"Importance"},{name:"nature",title:"Nature"},{name:"territory",title:"Territoire"},{name:"insee",title:"Code INSEE"},{name:"municipality",title:"Ville"},{name:"department",title:"Département"}],StreetAddress:[{name:"territory",title:"Territoire"},{name:"insee",title:"Code INSEE"},{name:"municipality",title:"Ville"},{name:"department",title:"Département"}],CadastralParcel:[{name:"department",title:"Département",description:"Numéro du département (ex: 01, 94)"},{name:"commune",title:"Code commune (INSEE)",description:"Code commune (INSEE) : 3 chiffres (ex: 067)"},{name:"absorbedCity",title:"Commune absorbée",description:"Commune absorbée : 3 chiffres (ex: 000, 001)"},{name:"section",title:"Section",description:"Section : 2 caractères (ex: AA, 0D)"},{name:"number",title:"Numéro",description:"Numéro de la parcelle : 4 chiffres (ex: 0041, 0250)"}],Administratif:[{name:"prefecture",title:"Préfecture"},{name:"inseeRegion",title:"Code région (INSEE)"},{name:"inseeDepartment",title:"Code département (INSEE)"},{name:"municipality",title:"Ville"}]},zoomToResultsByDefault:function(t){var e=15,i=t.service,n=t.fields,o=t.type,s={1:11,2:12,3:13,4:14,5:15,6:16,7:17,8:17};return"SuggestedLocation"===i&&"PositionOfInterest"===o&&(e=s[n.classification]),"DirectGeocodedLocation"===i&&"PositionOfInterest"===o&&(e=s[n.importance]||14),"StreetAddress"===o&&(e=17),"CadastralParcel"===o&&(e=17),"Administratif"===o&&(e=12),e}};return t}(),LeafletControlsSearchEngine=function(t,e,i,n,o,s,r){var a=t.Control.extend({includes:s,options:{position:"topleft",collapsed:!0,displayInfo:!0,zoomTo:"",resources:[],displayAdvancedSearch:!0,advancedSearch:{},geocodeOptions:{},autocompleteOptions:{}},initialize:function(e){t.Util.setOptions(this,e),this._uid=o.generate(),this._inputContainer=null,this._suggestedContainer=null,this._suggestedLocations=[],this._geocodedContainer=null,this._geocodedLocations=[],this._filterContainer=null,this._currentGeocodingCode=null,this._currentGeocodingLocation=null,this._advancedSearchFilters={},this._advancedSearchCodes=[],this._marker=null,this._servicesRightManagement={},this._noRightManagement=!1,this._checkRightsManagement()},onAdd:function(){this._initAdvancedSearchCodes(),this._initAdvancedSearchFilters();var e=this._initLayout();return t.DomEvent.disableClickPropagation(e).disableScrollPropagation(e),e},onRemove:function(){},_checkRightsManagement:function(){this.options.resources&&0!==this.options.resources.length||(this.options.resources=["StreetAddress","PositionOfInterest"]);var t=null,e=[],i=null;i=this.options.geocodeOptions.apiKey,t=this.options.geocodeOptions.filterOptions,e=t?t.type:[],e&&0!==e.length||(e=this.options.resources||["StreetAddress","PositionOfInterest"]);var o=n.check({key:i||this.options.apiKey,resources:e,services:["Geocode"]});i=this.options.autocompleteOptions.apiKey,t=this.options.autocompleteOptions.filterOptions,e=t?t.type:[],e&&0!==e.length||(e=this.options.resources||["StreetAddress","PositionOfInterest"]);var s=n.check({key:i||this.options.apiKey,resources:e,services:["AutoCompletion"]});if(o||s||(this._noRightManagement=!0),s&&(this._servicesRightManagement.AutoCompletion={},this._servicesRightManagement.AutoCompletion.resources=s.AutoCompletion,this._servicesRightManagement.AutoCompletion.key=s.key),o&&(this._servicesRightManagement.Geocode={},this._servicesRightManagement.Geocode.resources=o.Geocode,this._servicesRightManagement.Geocode.key=o.key),!this.options.advancedSearch||0===Object.keys(this.options.advancedSearch).length)for(var r=this._servicesRightManagement.Geocode.resources,a=0;a<r.length;a++){var l=r[a];this.options.advancedSearch[l]=[]}},_initLayout:function(){var t=this._createMainContainerElement(),e=this._createShowSearchEngineElement();t.appendChild(e),this.options.collapsed||(e.checked="true");var i=this._createShowSearchEnginePictoElement();t.appendChild(i);var n=this._createSearchInputElement();if(t.appendChild(n),this.options.displayAdvancedSearch){var o=this._createShowAdvancedSearchElement();t.appendChild(o);var s=this._createAdvancedSearchPanelElement(),r=this._createAdvancedSearchPanelHeaderElement(),a=this._createAdvancedSearchPanelFormElement(this._advancedSearchCodes),l=this._filterContainer=this._createAdvancedSearchFormFiltersElement();this._setFilter(this._advancedSearchCodes[0].id);var c=this._createAdvancedSearchFormInputElement();a.appendChild(l),a.appendChild(c),s.appendChild(r),s.appendChild(a),t.appendChild(s)}var h=this._createAutoCompleteElement(),u=this._suggestedContainer=this._createAutoCompleteListElement();h.appendChild(u),t.appendChild(h);var d=this._createGeocodeResultsElement(),p=this._geocodedContainer=this._createGeocodeResultsListElement();return d.appendChild(p),t.appendChild(d),t},_initAdvancedSearchCodes:function(){for(var t=[{id:"PositionOfInterest",title:"Lieux/toponymes"},{id:"StreetAddress",title:"Adresses"},{id:"CadastralParcel",title:"Parcelles cadastrales"},{id:"Administratif",title:"Administratif"}],e=Object.keys(this.options.advancedSearch),i=0;i<e.length;i++)for(var n=e[i],o=0;o<t.length;o++)t[o].id===n&&this._advancedSearchCodes.push(t[o]);0===this._advancedSearchCodes.length&&(this._advancedSearchCodes=t)},_initAdvancedSearchFilters:function(){var e={PositionOfInterest:[{name:"city",title:"Ville",filter:!1,sep:!0},{name:"importance",title:"Importance",filter:!0},{name:"nature",title:"Nature",filter:!0},{name:"territory",title:"Territoire",filter:!0},{name:"insee",title:"Code commune (INSEE)",filter:!0},{name:"department",title:"Département",filter:!0}],StreetAddress:[{name:"number",title:"Numéro",filter:!1,sep:!0},{name:"street",title:"Rue",filter:!1,sep:!0},{name:"postalCode",
       
   154 title:"Code Postal",filter:!1,sep:!0},{name:"city",title:"Ville",filter:!1,sep:!0},{name:"territory",title:"Territoire",filter:!0},{name:"insee",title:"Code commune (INSEE)",filter:!0},{name:"department",title:"Département",filter:!0}],CadastralParcel:[{name:"department",title:"Département",filter:!1,sep:!1,value:"__"},{name:"commune",title:"Commune",filter:!1,sep:!1,value:"___"},{name:"absorbedCity",title:"Commune absorbée",filter:!1,sep:!1,value:"___"},{name:"section",title:"Section",filter:!1,sep:!1,value:"__"},{name:"number",title:"Numéro",filter:!1,sep:!1,value:"____"}],Administratif:[{name:"prefecture",title:"Préfecture",filter:!0},{name:"inseeRegion",title:"Code région (INSEE)",filter:!0},{name:"inseeDepartment",title:"Code département (INSEE)",filter:!0},{name:"city",title:"Ville",filter:!1,sep:!0}]},i=this.options.advancedSearch;for(var n in i)if(i.hasOwnProperty(n)){if(!i[n]||0===i[n].length){i[n]=e[n];continue}for(var o=i[n],s=0;s<o.length;s++){var r=o[s];r.hasOwnProperty("filter")||(r.filter="municipality"!==r.name)}}t.Util.extend(this._advancedSearchFilters,e,i)},_setFilter:function(t){for(var e=this._filterContainer,i=!1,n=0;n<this._advancedSearchCodes.length;n++)if(this._advancedSearchCodes[n].id===t){i=!0;break}if(i){for(this._currentGeocodingCode=t;e.firstChild;)e.removeChild(e.firstChild);var o=this._advancedSearchFilters[t];if(o&&0!==o.length){for(var s=this._createAdvancedSearchFiltersTableElement(t,!0),r=0;r<o.length;r++){var a=this._createAdvancedSearchFiltersAttributElement(o[r]);s.appendChild(a)}return e.appendChild(s),e}}else for(;e.firstChild;)e.removeChild(e.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._servicesRightManagement.AutoCompletion)return void console.log("no rights for this service !?");var n={};t.Util.extend(n,this.options.autocompleteOptions),t.Util.extend(n,e);var o=this._servicesRightManagement.AutoCompletion.resources;if(o&&0!==Object.keys(o).length){o&&t.Util.isArray(o)&&!n.filterOptions&&(n.filterOptions||(n.filterOptions={}),n.filterOptions.type=o);var s=this._servicesRightManagement.AutoCompletion.key;t.Util.extend(n,{apiKey:n.apiKey||this.options.apiKey||s}),i.Services.autoComplete(n)}}},_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;i<t.length;i++)this._createAutoCompletedLocationElement(t[i],i);this._suggestedLocations=t}},_requestGeocoding:function(e){if(e&&0!==Object.keys(e).length&&e.location){if(this._noRightManagement)return void console.log("no rights for all service !?");if(!this._servicesRightManagement.Geocode)return void console.log("no rights for this service !?");var n={};t.Util.extend(n,this.options.geocodeOptions),t.Util.extend(n,e),n.hasOwnProperty("returnFreeForm")||t.Util.extend(n,{returnFreeForm:!1});var o=this._servicesRightManagement.Geocode.resources;if(o&&0!==Object.keys(o).length){o&&t.Util.isArray(o)&&!n.filterOptions&&(n.filterOptions||(n.filterOptions={}),n.filterOptions.type=o);var s=this._servicesRightManagement.Geocode.key;t.Util.extend(n,{apiKey:n.apiKey||this.options.apiKey||s}),i.Services.geocode(n)}}},_fillGeocodedLocationListContainer:function(t){if(!t||0===t.length)return void this._clearGeocodedLocation();var e=this._geocodedContainer;if(e.childElementCount)for(;e.firstChild;)e.removeChild(e.firstChild);for(var i=0;i<t.length;i++)this._createGeocodedLocationElement(t[i],i);this._geocodedLocations=t},_setLabel:function(e){var i=t.DomUtil.get("GPsearchInputText-"+this._uid);i.value=e||""},_setPosition:function(e,i){var n=this._map;n.setZoomAround(t.latLng(e.x,e.y),i,!0),n.panTo(t.latLng(e.x,e.y))},_getZoom:function(t){var e=this._map,i=this.options.zoomTo,n=null;if("function"==typeof i&&(n=i.call(this,t)),"number"==typeof i&&(n=i),"string"==typeof i)if("auto"===i)n=r.zoomToResultsByDefault(t);else{var o=parseInt(i,10);isNaN(o)||(n=o)}Number.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},n&&""!==n&&Number.isInteger(n)||(n=e.getZoom());var s=e.getMinZoom(),a=e.getMaxZoom();return n<s&&(n=s),n>a&&(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;c<l.length;c++){var h=l[c].name,u=i.fields[h];"string"!=typeof u&&"number"!=typeof u||a.push(u)}r=a.join(" - ")}else"SuggestedLocation"===i.service?i.fields.fullText?r=i.fields.fullText:(a.push(i.fields.street||""),a.push(i.fields.postalCode||""),a.push(i.fields.commune||""),"PositionOfInterest"===i.type&&(a.push(i.fields.poi||""),a.push(i.fields.kind||"")),r=a.join(" - ")):r="sans informations."}else r=i;this._marker.bindPopup(r)}}},_clearResults:function(){this._currentGeocodingLocation=null,this._clearSuggestedLocation(),this._clearGeocodedLocation(),this._setMarker()},_clearSuggestedLocation:function(){if(this._suggestedLocations=[],this._suggestedContainer)for(;this._suggestedContainer.firstChild;)this._suggestedContainer.removeChild(this._suggestedContainer.firstChild)},_clearGeocodedLocation:function(){if(this._geocodedLocations=[],this._geocodedContainer)for(;this._geocodedContainer.firstChild;)this._geocodedContainer.removeChild(this._geocodedContainer.firstChild)},onShowSearchEngineClick:function(){},onSearchResetClick:function(){this._clearResults()},onAutoCompleteSearchText:function(t){var e=t.target.value;if(e&&!(this._noRightManagement||(this._currentGeocodingLocation=e,e.length<3))){var i=this;this._requestAutoComplete({text:e,onSuccess:function(t){if(t){var e=t.suggestedLocations;i._fillAutoCompletedLocationListContainer(e)}},onFailure:function(t){i._clearSuggestedLocation()}})}},onAutoCompletedResultsItemClick:function(t){var e=o.index(t.target.id),i=t.target.innerHTML;if(e){var n={x:this._suggestedLocations[e].position.y,y:this._suggestedLocations[e].position.x},s={service:"SuggestedLocation",type:this._suggestedLocations[e].type,fields:this._suggestedLocations[e]},r=this._getZoom(s);this._setLabel(i),this._setPosition(n,r),this._setMarker(n,s,this.options.displayInfo)}},onGeocodingSearchSubmit:function(t){var e=t.target[0].value;if(e&&!this._noRightManagement){this._currentGeocodingLocation=e;var i=this;this._requestGeocoding({location:e,onSuccess:function(t){if(t){var e=t.locations;i._fillGeocodedLocationListContainer(e)}},onFailure:function(t){i._clearGeocodedLocation()}})}},onGeocodedResultsItemClick:function(t){var e=o.index(t.target.id),i=t.target.innerHTML;if(e){var n=this._geocodedLocations[e].position,s={service:"DirectGeocodedLocation",type:this._geocodedLocations[e].type,fields:this._geocodedLocations[e].placeAttributes},r=this._getZoom(s);this._setLabel(i),this._setPosition(n,r),this._setMarker(n,s,this.options.displayInfo)}},onGeocodingAdvancedSearchCodeChange:function(t){var e=t.target.selectedIndex,i=t.target.options[e].value;i&&this._setFilter(i)},onGeocodingAdvancedSearchSubmit:function(t,e){if(e&&0!==e.length){var i={};i.type=[this._currentGeocodingCode];var n=this._currentGeocodingLocation||"";"CadastralParcel"===this._currentGeocodingCode&&(n="");for(var o=0;o<e.length;o++){var s=e[o];if(s.value)for(var r=this._advancedSearchFilters[this._currentGeocodingCode],a=0;a<r.length;a++){var l=r[a];if(l.name===s.key)if(l.filter)i[s.key]=s.value;else if(l.value){var c=s.value.length,h=l.value.length;if(h!==c){for(var u=h-c,d=l.value.charAt(0);d.length<u;)d+=d;var p=d.slice(0,u);s.value=s.value+p}n+=s.value}else"string"==typeof n&&(n={}),n[s.key]=s.value}}var m=this;this._requestGeocoding({location:n,filterOptions:i,onSuccess:function(t){if(t){var e=t.locations;m._fillGeocodedLocationListContainer(e)}},onFailure:function(t){m._clearGeocodedLocation()}})}}});return a}(leaflet,{},gp,CommonUtilsCheckRightManagement,CommonUtilsSelectorID,CommonControlsSearchEngineDOM,CommonControlsSearchEngineUtils),CommonControlsElevationPathDOM=function(){var t={_addUID:function(t){return t+"-"+this._uid},_createMainContainerElement:function(){var t=document.createElement("div");return t.id=this._addUID("GPelevationPath"),t.className="GPwidget",t},_createShowElevationPathElement:function(){var t=document.createElement("input");return t.id=this._addUID("GPshowElevationPath"),t.type="checkbox",t},_createShowElevationPathPictoElement:function(){var t=this,e=document.createElement("label");e.id=this._addUID("GPshowElevationPathPicto"),e.className="GPshowAdvancedToolPicto",e.htmlFor=this._addUID("GPshowElevationPath"),e.title="Calculer un profil",e.addEventListener?e.addEventListener("click",function(e){t.onShowElevationPathClick(e)}):e.attachEvent&&e.attachEvent("onclick",function(e){t.onShowElevationPathClick(e)});var i=document.createElement("span");return i.id=this._addUID("GPshowElevationPathOpen"),i.className="GPshowAdvancedToolOpen",e.appendChild(i),e},_createElevationPathPanelElement:function(){var t=document.createElement("div");return t.id=this._addUID("GPelevationPathPanel"),t.className="GPpanel",t},_createElevationPathPanelHeaderElement:function(){var t=this,e=document.createElement("div");e.className="GPpanelHeader";var i=document.createElement("div");i.className="GPpanelTitle",i.innerHTML="Profil Altimétrique",e.appendChild(i);var n=document.createElement("div");n.id=this._addUID("GPelevationPathPanelReduce"),n.className="GPpanelReduce",n.title="Masquer le panneau",n.addEventListener?n.addEventListener("click",function(){"function"==typeof t.onReduceElevationPathPanelClick&&(document.getElementById(t._addUID("GPshowElevationPath")).checked=!1,t.onReduceElevationPathPanelClick())},!1):n.attachEvent&&n.attachEvent("onclick",function(){"function"==typeof t.onReduceElevationPathPanelClick&&(document.getElementById(t._addUID("GPshowElevationPath")).checked=!1,t.onReduceElevationPathPanelClick())}),e.appendChild(n);var o=document.createElement("div");return o.id=this._addUID("GPelevationPathPanelClose"),o.className="GPpanelClose",o.title="Fermer le panneau",o.addEventListener?o.addEventListener("click",function(){document.getElementById(t._addUID("GPshowElevationPathPicto")).click()},!1):o.attachEvent&&o.attachEvent("onclick",function(){document.getElementById(t._addUID("GPshowElevationPathPicto")).click()}),e.appendChild(o),e},_createElevationPathPanelProfilElement:function(){var t=document.createElement("div");return t.id="GPelevationPathProfil",t},_createElevationPathWaitingElement:function(){var t=document.createElement("div");t.id=this._addUID("GPelevationPathCalcWaitingContainer"),t.className="GPelevationPathCalcWaitingContainerHidden";var e=document.createElement("p");return e.className="GPelevationPathCalcWaiting",e.innerHTML="Calcul en cours...",t.appendChild(e),t}};return t}(),LeafletControlsElevationPath=function(t,e,i,n,o,s,r,a,l,c){var h=t.Control.extend({includes:c,options:{position:"topleft",active:!1,elevationPathOptions:{},stylesOptions:{},displayProfileOptions:{apply:null,target:null}},initialize:function(e){t.Util.setOptions(this,e),this._uid=s.generate(),this._initDisplayProfileOptions(),this._showContainer=null,this._pictoContainer=null,this._panelContainer=null,this._profilContainer=null,this._waitingContainer=null,this._reducePanel=!1,this._featuresLayer=null,this._lastIdLayer=0,this._currentIdLayer=0,this._currentFeature=null,this._profile=null,this._marker=null,this._geometry=null,this._noRightManagement=!1,this._checkRightsManagement()},onAdd:function(e){var i=this._container=this._initLayout();return e&&this.options.active&&(null===this._profile&&(this._panelContainer.style.display="none"),this._activateMapInteraction(e)),t.DomEvent.disableClickPropagation(i).disableScrollPropagation(i),i},onRemove:function(){},_checkRightsManagement:function(){var t=o.check({key:this.options.apiKey,resources:["SERVICE_CALCUL_ALTIMETRIQUE_RSC"],services:["ElevationLine"]});t||(this._noRightManagement=!0),this.options.apiKey||(this.options.apiKey=t.key)},_initDisplayProfileOptions:function(){var t=this.options.displayProfileOptions||{};"undefined"==typeof t||0===Object.keys(t).length?this.options.displayProfileOptions={apply:h.DISPLAY_PROFILE_BY_DEFAULT,target:null}:this.options.displayProfileOptions={};var e=t.apply||this.options.displayProfileOptions.apply;this.options.displayProfileOptions.apply="function"==typeof e?e:h.DISPLAY_PROFILE_BY_DEFAULT;var i=t.target||this.options.displayProfileOptions.target;this.options.displayProfileOptions.target="undefined"==typeof i?null:i},_initLayout:function(){var t=this._createMainContainerElement(),e=this._showContainer=this._createShowElevationPathElement();t.appendChild(e),this.options.active&&(this._showContainer.checked=!0);var i=this._pictoContainer=this._createShowElevationPathPictoElement();t.appendChild(i);var n=this._panelContainer=this._createElevationPathPanelElement(),o=this._createElevationPathPanelHeaderElement();n.appendChild(o);var s=this._profilContainer=this._createElevationPathPanelProfilElement();n.appendChild(s);var r=this._waitingContainer=this._createElevationPathWaitingElement();return n.appendChild(r),t.appendChild(n),t},onShowElevationPathClick:function(t){var e=this._map;this._reducePanel?null!==this._profile&&(null===this.options.displayProfileOptions.target&&(this._pictoContainer.style.display="none"),this._panelContainer.style.display="block"):this._showContainer.checked?(this._pictoContainer.style.display="block",this._panelContainer.style.display="none",this._removeMapInteraction(e),this._clear()):(null===this._profile&&(this._panelContainer.style.display="none"),this._activateMapInteraction(e)),this._reducePanel=!1},onReduceElevationPathPanelClick:function(){this._reducePanel=!0,this._pictoContainer.style.display="block",this._panelContainer.style.display="none"},_activateMapInteraction:function(e){if(null===this._featuresLayer){this._featuresLayer=new t.FeatureGroup,e.addLayer(this._featuresLayer);var i=this;e.on("draw:created",function(e){i._currentIdLayer=t.Util.stamp(e.layer),i._getFeatureGeometry(e.layer),i._addFeatureLayer(e.layer)}),e.on("draw:drawstart",function(){i._removeFeatureLayer(i._lastIdLayer),i._lastIdLayer=i._currentIdLayer}),e.on("draw:drawstop",function(){"undefined"==typeof i.options.elevationPathOptions.onSuccess&&null===i.options.displayProfileOptions.target&&(i._pictoContainer.style.display="none",i._panelContainer.style.display="block"),i._altiRequest()})}this._activatePolyLineInteraction(e)},_removeMapInteraction:function(t){t&&(null!==this._featuresLayer&&(t.off("draw:created"),t.off("draw:drawstart"),t.off("draw:drawstop"),t.removeLayer(this._featuresLayer),this._featuresLayer=null),this._lastIdLayer=this._currentIdLayer=0,this._currentFeature&&this._currentFeature.disable())},_activatePolyLineInteraction:function(e){this._currentFeature&&this._currentFeature.disable();var i=this.options.stylesOptions||{},n=0!==Object.keys(i).length?i:{stroke:!0,color:"#C77A04",weight:4,opacity:.5,fill:!1};this._currentFeature=new t.Draw.Polyline(e,{shapeOptions:n}),this._currentFeature.enable()},_getFeatureGeometry:function(t){null!==this._geometry&&(this._geometry=null),this._geometry=[];for(var e=t.getLatLngs(),i=0;i<e.length;i++){var n=e[i];this._geometry.push({lon:n.lng,lat:n.lat})}},_addFeatureLayer:function(t){this._featuresLayer&&this._featuresLayer.addLayer(t)},_removeFeatureLayer:function(t){this._featuresLayer&&0!==t&&(t?this._featuresLayer.removeLayer(t):this._featuresLayer.clearLayers())},_altiRequest:function(){if(this._geometry&&!this._noRightManagement){var e={};t.Util.extend(e,this.options.elevationPathOptions),t.Util.extend(e,{apiKey:e.apiKey||this.options.apiKey});var i=this;t.Util.extend(e,{sampling:e.sampling||200,onSuccess:this.options.elevationPathOptions.onSuccess||function(t){t&&(null!==i.options.displayProfileOptions.target&&(i._pictoContainer.style.display="block",i._panelContainer.style.display="block"),i._displayProfil(t.elevations),i._waitingContainer.className="GPelevationPathCalcWaitingContainerHidden",i._waiting=!1)},onFailure:this.options.elevationPathOptions.onFailure||function(t){i._pictoContainer.style.display="block",i._panelContainer.style.display="none",i._waitingContainer.className="GPelevationPathCalcWaitingContainerHidden",i._waiting=!1,i._clear()}});var o=this._geometry;t.Util.extend(e,{positions:o}),this._waitingContainer.className="GPelevationPathCalcWaitingContainerVisible",n.Services.getAltitude(e)}},_computeElevationMeasure:function(t){var e=function(t,e){var i=a.decimalToRadian(t[1]),n=a.decimalToRadian(e[1]),o=(n-i)/2,s=a.decimalToRadian(e[0]-t[0])/2,r=Math.sin(o)*Math.sin(o)+Math.sin(s)*Math.sin(s)*Math.cos(i)*Math.cos(n);return 12756274*Math.atan2(Math.sqrt(r),Math.sqrt(1-r))};t[0].dist=0;for(var i=0,n=1;n<t.length;n++)i+=e([t[n].lon,t[n].lat],[t[n-1].lon,t[n-1].lat])/1e3,t[n].dist=i,t[n].lat=Math.round(1e4*t[n].lat)/1e4,t[n].lon=Math.round(1e4*t[n].lon)/1e4;var o=100;i>100?o=1:i>10&&(o=10);for(var s=0;s<t.length;s++){var r=t[s];r.z<0&&(r.z=0),r.dist=Math.round(r.dist*o)/o}return t},_displayProfil:function(t){var e=this._computeElevationMeasure(t),i=this.options.displayProfileOptions.target;i&&i.appendChild(this._panelContainer),i=this._profilContainer;var n=this,o=this.options.displayProfileOptions.apply;"undefined"!=typeof AmCharts&&"undefined"!=typeof d3,o.call(this,e,i,n)},_activateProfilEvent:function(e){if(null!==this._profile){var i=this._map,n=this;n._marker&&(i.removeLayer(n._marker),n._marker=null),n._marker=t.marker(t.latLng(e.lat,e.lon),{icon:new l("orange"),draggable:!1,clickable:!1,zIndexOffset:1e3}),n._marker.addTo(i);var o=function(e){var i=e.chart.dataProvider[e.index];n._marker.setLatLng(t.latLng(i.lat,i.lon)),n._marker.update()};n._profile.removeListener("changed",o),n._profile.addListener("changed",o)}},_clear:function(){if(this._geometry=null,this._profile=null,this._profilContainer)for(;this._profilContainer.firstChild;)this._profilContainer.removeChild(this._profilContainer.firstChild);var t=this._map;this._marker&&(t.removeLayer(this._marker),this._marker=null)}});return h.DISPLAY_PROFILE_BY_DEFAULT=function(e,i,n){if(i)for(;i.firstChild;)i.removeChild(i.firstChild);if(e){var o=JSON.parse(JSON.stringify(e));o.sort(function(t,e){return t.z-e.z});var s=o[0].z,r=o[o.length-1].z,a=r-s,c=e[e.length-1].dist,h=100/e.length,u=this,d=n._map,p=document.createElement("div");p.id="profileElevationByDefault",p.addEventListener("mouseover",function(e){var i=parseFloat(e.target.dataset.lon),n=parseFloat(e.target.dataset.lat);i&&n&&(u._marker=t.marker(t.latLng(n,i),{icon:new l("orange"),draggable:!1,clickable:!1,zIndexOffset:1e3}),u._marker.addTo(d))}),p.addEventListener("mousemove",function(){}),p.addEventListener("mouseout",function(){u._marker&&(d.removeLayer(u._marker),u._marker=null)}),i.appendChild(p);var m=document.createElement("div");m.className="z-title-vertical",m.innerHTML=s+" / "+r+" m",p.appendChild(m);var f=document.createElement("ul");f.id="data-default",f.className="z-axis x-axis",p.appendChild(f);for(var _=0;_<e.length;_++){var g=e[_],v=document.createElement("li");v.setAttribute("data-z",g.z),v.setAttribute("data-lon",g.lon),v.setAttribute("data-lat",g.lat),v.setAttribute("data-dist",g.dist);var y=Math.floor(100*(g.z-s)/a);v.setAttribute("class","percent v"+y),v.title="altitude : "+g.z+"m",v.setAttribute("style","width: "+h+"%"),f.appendChild(v)}var E=document.createElement("div");E.className="x-title-horizontal",E.innerHTML=c+" km",p.appendChild(E),n._profile=i}},h.DISPLAY_PROFILE_RAW=function(t,e,i){if(e)for(;e.firstChild;)e.removeChild(e.firstChild);var n=document.createElement("textarea");n.id="profilElevationResults",n.rows=10,n.cols=50,n.style.width="100%",n.innerHTML=JSON.stringify(t,void 0,4),e.appendChild(n),i._profile=e},h.DISPLAY_PROFILE_LIB_D3=function(e,i,n){if("undefined"==typeof d3)return void console.log("Lib. D3 is not loaded !");if(i)for(;i.firstChild;)i.removeChild(i.firstChild);var o={top:20,right:20,bottom:30,left:40},s=i.clientWidth-o.left-o.right,r=i.clientHeight-o.top-o.bottom,a=d3.scale.linear().range([0,s]),c=d3.scale.linear().range([r,0]),h=d3.svg.axis().scale(a).orient("bottom").ticks(5),u=d3.svg.axis().scale(c).orient("left").ticks(5),d=d3.svg.line().interpolate("basis").x(function(t){return a(t.dist)}).y(function(t){return c(t.z)}),p=d3.svg.area().interpolate("basis").x(function(t){return a(t.dist)}).y0(r).y1(function(t){return c(t.z)}),m=d3.select(i).append("svg").attr("width",s+o.left+o.right).attr("height",r+o.top+o.bottom).append("g").attr("transform","translate("+o.left+","+o.top+")"),f=d3.extent(e,function(t){return t.dist});a.domain(f);var _=[0,d3.max(e,function(t){return t.z})];c.domain(_),m.append("path").datum(e).attr("class","area-d3").attr("d",p),m.append("g").attr("class","x axis-d3").attr("transform","translate(0,"+r+")").call(h).append("text").attr("y",-15).attr("dy",".71em").attr("x",s).text("Distance (km)"),m.append("g").attr("class","y axis-d3").call(u).append("text").attr("transform","rotate(-90)").attr("y",6).attr("dy",".71em").text("Altitude (m)"),m.append("g").attr("class","grid-d3 vertical").attr("transform","translate(0,"+r+")").call(h.orient("bottom").tickSize(-r,0,0).tickFormat("")),m.append("g").attr("class","grid-d3 horizontal").call(u.orient("left").tickSize(-s,0,0).tickFormat("")),m.append("path").datum(e).attr("class","line-d3").attr("d",d),m.selectAll("circle").data(e).enter().append("circle").attr("cx",function(t){return a(t.dist)}).attr("cy",function(t){return c(t.z)}).attr("r",0).attr("class","circle-d3");var g=m.append("g").style("display","none");g.append("line").attr("id","focusLineX").attr("class","focusLine-d3"),g.append("line").attr("id","focusLineY").attr("class","focusLine-d3"),g.append("circle").attr("id","focusCircle").attr("r",4).attr("class","circle-d3 focusCircle-d3");var v=d3.select(i).append("div").attr("class","tooltip-d3").style("opacity",0),y=d3.bisector(function(t){return t.dist}).left,E=this,P=n._map;m.append("rect").attr("class","overlay-d3").attr("width",s).attr("height",r).on("mouseover",function(){g.style("display",null),E._marker=t.marker(t.latLng(e[0].lat,e[0].lon),{icon:new l("orange"),draggable:!1,clickable:!1,zIndexOffset:1e3}),E._marker.addTo(P)}).on("mouseout",function(){g.style("display","none"),E._marker&&(P.removeLayer(E._marker),E._marker=null),v.transition().duration(500).style("opacity",0)}).on("mousemove",function(){var i=d3.mouse(this),n=a.invert(i[0]),o=y(e,n),s=e[o-1],r=e[o],l=n-s[0]>r[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 <br/>Lon : "+l.lon+" <br/>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:"<span class='altiPathValue'>[[title]] : [[value]]m</span><br/><span class='altiPathCoords'>(lat: [[lat]] / lon:[[lon]])</span>",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;o<s;o++){n=!0;for(var r=t.originators[o],a=t.originators[o].constraints||[],l=0,c=a.length;l<c;l++){var h=a[l];n=!0;var u=this.getZoomLevelFromScaleDenominator(h.maxScaleDenominator,t.crs),d=this.getZoomLevelFromScaleDenominator(h.minScaleDenominator,t.crs);u&&u>e&&(n=!1),n&&d&&d<e&&(n=!1);var p=h.bbox;if(n&&p){n=!1;var m=t.extent;if(m){var f=[p.top,p.left,p.bottom,p.right];if(this.intersects(m,f)){n=!0;break}}}}if(n){var _=r.logo,g=r.url,v=r.name?r.name:"",y=r.attribution,E=document.createElement("div");E.className="gp-control-attribution";var P=null;P=document.createElement("a"),P.className="gp-control-attribution-link",P.target="_blank",E.appendChild(P),g&&(P.href=g);var C=!!_,S=null;C?(S=document.createElement("img"),P?(S.className="gp-control-attribution-image",P.appendChild(S)):(S.className="",E.appendChild(S)),S.src=_,S.title=y||v,S.style.height="30px",S.style.width="30px"):v?P.textContent=v:y?P.textContent=y:g?P.textContent=g:P.textContent="",i.push(E.innerHTML+" ")}}return i},intersects:function(t,e){var i=t[1]<=e[3]&&e[1]<=t[3],n=t[2]<=e[0]&&e[2]<=t[0];return i&&n}};return t}(),LeafletLayersLayerConfig=function(t,e,i){var n={get:function(t){var n={};if(e.isConfigLoaded()&&(n=e.getLayerParams(t.layer,t.service,t.key)))return n.minZoom=i.getZoomLevelFromScaleDenominator(n.maxScale)||1,n.maxZoom=i.getZoomLevelFromScaleDenominator(n.minScale)||21,n}};return n}({},CommonUtilsConfig,CommonUtilsLayerUtils),LeafletLayersLayerEvent=function(t,e){var i={_id:null,_attributions:[],_visibility:!0,_originators:[],isEnable:function(t){return!!t.attributionControl},setVisible:function(t){this._visibility=t},getVisible:function(){return this._visibility},_onRemoveLayer:function(t){t.layer._geoportal_id==this._geoportal_id&&this.setVisible(!1)},_onAddLayer:function(t){t.layer._geoportal_id==this._geoportal_id&&this.setVisible(!0)},_onMoveEndLayer:function(t){this.updateAttributions(this._map,this)},updateAttributions:function(t){this.isEnable(t)&&(this.removeAttributions(t),this.addAttributions(t))},removeAttributions:function(t){if(this.isEnable(t)){for(var e=0;e<this._attributions.length;e++)t.attributionControl.removeAttribution(this._attributions[e]);this._attributions&&(this._attributions=[])}},addAttributions:function(t){if(this.isEnable(t)){var i=t.getBounds().getNorthWest(),n=t.getBounds().getSouthEast(),o=[i.lat,i.lng,n.lat,n.lng],s={extent:o,zoom:t.getZoom(),originators:this._originators,visibility:this._visibility},r=e.getAttributions(s);if(r&&0!==r.length)for(var a=0;a<r.length;a++)this._attributions.push(r[a]),t.attributionControl.addAttribution(r[a])}}};return i}({},CommonUtilsLayerUtils),LeafletLayersWMS=function(t,e,i,n){var o=t.TileLayer.WMS.extend({includes:n,initialize:function(i,n){var o={};t.Util.extend(o,n.paramsWms,n.paramsNative),t.TileLayer.WMS.prototype.initialize.call(this,e.Helper.normalyzeUrl(i,{"gp-leaflet-ext":"0.9.0"},!1),o),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.WMS.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=["EPSG:4326"],n=this._map,o=this.options.tileSize,s=e.multiplyBy(o),r=s.add([o,o]),a=this._crs.project(n.unproject(s,e.z)),l=this._crs.project(n.unproject(r,e.z)),c=this._wmsVersion>=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),
       
   155 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;
       
   156 return Gp;
       
   157 }));