diff --git a/dist/GpServices-src.js b/dist/GpServices-src.js index eb2c226c..726a7920 100644 --- a/dist/GpServices-src.js +++ b/dist/GpServices-src.js @@ -10,7 +10,7 @@ * copyright IGN * @author IGN * @version 1.0.0-beta2 - * @date 2016-04-22 + * @date 2016-05-18 * */ /*! @@ -32,7 +32,7 @@ }(this, function() { /* BEGIN CODE */ -var log4js, loggerCfg, UtilsLoggerByDefault, UtilsMessagesResources, ExceptionsErrorService, UtilsHelper, promise, ProtocolsXHR, ProtocolsJSONP, ProtocolsProtocol, ServicesDefaultUrlService, ServicesCommonService, ServicesAltiRequestModelAltiRequest, ServicesAltiRequestModelAltiElevationRequest, ServicesAltiRequestModelAltiProfilRequest, ServicesAltiRequestAltiRequestREST, FormatsWPS, ServicesAltiRequestAltiRequestWPS, ServicesAltiRequestAltiRequestFactory, FormatsXML, ServicesAltiResponseModelAltiResponse, ServicesAltiResponseModelElevation, ServicesAltiFormatsAltiResponseReader, ServicesAltiResponseAltiResponseFactory, ServicesAltiAlti, ServicesAutoConfResponseModelAutoConfResponse, ServicesAutoConfResponseModelConstraint, ServicesAutoConfResponseModelFormat, ServicesAutoConfResponseModelLayer, ServicesAutoConfResponseModelLegend, ServicesAutoConfResponseModelMetadata, ServicesAutoConfResponseModelOriginator, ServicesAutoConfResponseModelService, ServicesAutoConfResponseModelStyle, ServicesAutoConfResponseModelTerritory, ServicesAutoConfResponseModelThematic, ServicesAutoConfResponseModelTileMatrixSet, ServicesAutoConfResponseModelTileMatrix, ServicesAutoConfResponseModelTileMatrixLimit, ServicesAutoConfFormatsAutoConfResponseReader, ServicesAutoConfResponseAutoConfResponseFactory, ServicesAutoConfAutoConf, FormatsXLSRequestHeader, FormatsXLSRequest, FormatsXLSAbstractService, FormatsXLS, FormatsXLSLocationUtilityServiceModelAddress, FormatsXLSLocationUtilityServiceGeocodeFilterExtension, FormatsXLSLocationUtilityServiceGeocodeRequest, FormatsXLSLocationUtilityServiceModelPosition, FormatsXLSLocationUtilityServiceModelPreference, FormatsXLSLocationUtilityServiceReverseGeocodeRequest, FormatsXLSLocationUtilityService, ServicesGeocodeRequestGeocodeLocation, ServicesGeocodeRequestModelStreetAddress, ServicesGeocodeRequestModelPositionOfInterest, ServicesGeocodeRequestModelCadastralParcel, ServicesGeocodeRequestModelAdministratif, ServicesGeocodeRequestDirectGeocodeRequestFactory, ServicesGeocodeResponseModelGeocodeResponse, ServicesGeocodeResponseModelGeocodedLocation, ServicesGeocodeResponseModelDirectGeocodedLocation, ServicesGeocodeFormatsDirectGeocodeResponseReader, ServicesGeocodeResponseDirectGeocodeResponseFactory, ServicesGeocodeGeocode, ServicesGeocodeRequestReverseGeocodeRequestFactory, ServicesGeocodeResponseModelReverseGeocodedLocation, ServicesGeocodeFormatsReverseGeocodeResponseReader, ServicesGeocodeResponseReverseGeocodeResponseFactory, ServicesGeocodeReverseGeocode, ServicesAutoCompleteResponseModelAutoCompleteResponse, ServicesAutoCompleteResponseModelSuggestedLocation, ServicesAutoCompleteResponseAutoCompleteResponseFactory, ServicesAutoCompleteAutoComplete, FormatsXLSRouteServiceModelRoutePlan, FormatsXLSRouteServiceDetermineRouteRequest, FormatsXLSRouteServiceRouteRequestExtension, FormatsXLSRouteService, ServicesRouteRequestRouteRequestOLS, ServicesRouteRequestModelRouteParamREST, ServicesRouteRequestRouteRequestREST, ServicesRouteRequestRouteRequestFactory, FormatsWKT, ServicesRouteResponseModelRouteResponse, ServicesRouteResponseModelRouteInstruction, ServicesRouteFormatsRouteResponseRESTReader, ServicesRouteFormatsRouteResponseOLSReader, ServicesRouteResponseRouteResponseFactory, ServicesRouteRoute, ServicesProcessIsoCurveRequestModelProcessIsoCurveParam, ServicesProcessIsoCurveRequestProcessIsoCurveRequest, ServicesProcessIsoCurveResponseModelProcessIsoCurveResponse, ServicesProcessIsoCurveFormatsProcessIsoCurveResponseReader, ServicesProcessIsoCurveResponseProcessIsoCurveResponseFactory, ServicesProcessIsoCurveProcessIsoCurve, ServicesServices, Gp; +var log4js, loggerCfg, UtilsLoggerByDefault, UtilsHelper, promise, ProtocolsXHR, UtilsMessagesResources, ExceptionsErrorService, ProtocolsJSONP, ProtocolsProtocol, ServicesDefaultUrlService, ServicesCommonService, ServicesAltiRequestModelAltiRequest, ServicesAltiRequestModelAltiElevationRequest, ServicesAltiRequestModelAltiProfilRequest, ServicesAltiRequestAltiRequestREST, FormatsWPS, ServicesAltiRequestAltiRequestWPS, ServicesAltiRequestAltiRequestFactory, FormatsXML, ServicesAltiResponseModelAltiResponse, ServicesAltiResponseModelElevation, ServicesAltiFormatsAltiResponseReader, ServicesAltiResponseAltiResponseFactory, ServicesAltiAlti, ServicesAutoConfResponseModelAutoConfResponse, ServicesAutoConfResponseModelConstraint, ServicesAutoConfResponseModelFormat, ServicesAutoConfResponseModelLayer, ServicesAutoConfResponseModelLegend, ServicesAutoConfResponseModelMetadata, ServicesAutoConfResponseModelOriginator, ServicesAutoConfResponseModelService, ServicesAutoConfResponseModelStyle, ServicesAutoConfResponseModelTerritory, ServicesAutoConfResponseModelThematic, ServicesAutoConfResponseModelTileMatrixSet, ServicesAutoConfResponseModelTileMatrix, ServicesAutoConfResponseModelTileMatrixLimit, ServicesAutoConfFormatsAutoConfResponseReader, ServicesAutoConfResponseAutoConfResponseFactory, ServicesAutoConfAutoConf, FormatsXLSRequestHeader, FormatsXLSRequest, FormatsXLSAbstractService, FormatsXLS, FormatsXLSLocationUtilityServiceModelAddress, FormatsXLSLocationUtilityServiceGeocodeFilterExtension, FormatsXLSLocationUtilityServiceGeocodeRequest, FormatsXLSLocationUtilityServiceModelPosition, FormatsXLSLocationUtilityServiceModelPreference, FormatsXLSLocationUtilityServiceReverseGeocodeRequest, FormatsXLSLocationUtilityService, ServicesGeocodeRequestGeocodeLocation, ServicesGeocodeRequestModelStreetAddress, ServicesGeocodeRequestModelPositionOfInterest, ServicesGeocodeRequestModelCadastralParcel, ServicesGeocodeRequestModelAdministratif, ServicesGeocodeRequestDirectGeocodeRequestFactory, ServicesGeocodeResponseModelGeocodeResponse, ServicesGeocodeResponseModelGeocodedLocation, ServicesGeocodeResponseModelDirectGeocodedLocation, ServicesGeocodeFormatsDirectGeocodeResponseReader, ServicesGeocodeResponseDirectGeocodeResponseFactory, ServicesGeocodeGeocode, ServicesGeocodeRequestReverseGeocodeRequestFactory, ServicesGeocodeResponseModelReverseGeocodedLocation, ServicesGeocodeFormatsReverseGeocodeResponseReader, ServicesGeocodeResponseReverseGeocodeResponseFactory, ServicesGeocodeReverseGeocode, ServicesAutoCompleteResponseModelAutoCompleteResponse, ServicesAutoCompleteResponseModelSuggestedLocation, ServicesAutoCompleteResponseAutoCompleteResponseFactory, ServicesAutoCompleteAutoComplete, FormatsXLSRouteServiceModelRoutePlan, FormatsXLSRouteServiceDetermineRouteRequest, FormatsXLSRouteServiceRouteRequestExtension, FormatsXLSRouteService, ServicesRouteRequestRouteRequestOLS, ServicesRouteRequestModelRouteParamREST, ServicesRouteRequestRouteRequestREST, ServicesRouteRequestRouteRequestFactory, FormatsWKT, ServicesRouteResponseModelRouteResponse, ServicesRouteResponseModelRouteInstruction, ServicesRouteFormatsRouteResponseRESTReader, ServicesRouteFormatsRouteResponseOLSReader, ServicesRouteResponseRouteResponseFactory, ServicesRouteRoute, ServicesProcessIsoCurveRequestModelProcessIsoCurveParam, ServicesProcessIsoCurveRequestProcessIsoCurveRequest, ServicesProcessIsoCurveResponseModelProcessIsoCurveResponse, ServicesProcessIsoCurveFormatsProcessIsoCurveResponseReader, ServicesProcessIsoCurveResponseProcessIsoCurveResponseFactory, ServicesProcessIsoCurveProcessIsoCurve, ServicesServices, Gp; log4js = undefined; loggerCfg = { loggers: [{ @@ -61,77 +61,6 @@ UtilsLoggerByDefault = function (Log4js, Config) { }; return LoggerByDefault; }(log4js, loggerCfg); -UtilsMessagesResources = function () { - var MessagesResources = { - 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 (clef, parametres) { - if (!arguments) { - return 'Message indefined !'; - } - var params = Array.prototype.slice.call(arguments); - var key = params.shift(); - var args = params; - var message = this[key]; - try { - if (Array.isArray(args) && args.length > 0) { - message = message.replace('%var%', args.join(' - ')); - } else { - message = message.replace('%var%', '%var% (not specified)'); - } - } catch (e) { - } - return message; - } - }; - return MessagesResources; -}(); -ExceptionsErrorService = function () { - function ErrorService(error) { - if (!(this instanceof ErrorService)) { - throw new TypeError('ErrorService constructor cannot be called as a function.'); - } - var e = error; - if (typeof error === 'string' || error instanceof String) { - this.message = error; - this.status = -1; - this.type = ErrorService.TYPE_UNKERR; - } else { - this.message = e.message || 'undefined!?'; - this.type = e.type; - this.status = e.status || -1; - } - this.name = 'ErrorService'; - this.stack = new Error().stack; - } - ErrorService.TYPE_SRVERR = 'SERVICE_ERROR'; - ErrorService.TYPE_USEERR = 'USAGE_ERROR'; - ErrorService.TYPE_UNKERR = 'UNKNOWN_ERROR'; - ErrorService.prototype = Object.create(Error.prototype, { - constructor: { - value: ErrorService, - writable: true, - configurable: true - } - }); - return ErrorService; -}(); UtilsHelper = function () { var Helper = { normalyzeParameters: function (params) { @@ -864,6 +793,77 @@ ProtocolsXHR = function (Logger, Helper, ES6Promise) { }; return XHR; }(UtilsLoggerByDefault, UtilsHelper, promise); +UtilsMessagesResources = function () { + var MessagesResources = { + 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 (clef, parametres) { + if (!arguments) { + return 'Message indefined !'; + } + var params = Array.prototype.slice.call(arguments); + var key = params.shift(); + var args = params; + var message = this[key]; + try { + if (Array.isArray(args) && args.length > 0) { + message = message.replace('%var%', args.join(' - ')); + } else { + message = message.replace('%var%', '%var% (not specified)'); + } + } catch (e) { + } + return message; + } + }; + return MessagesResources; +}(); +ExceptionsErrorService = function () { + function ErrorService(error) { + if (!(this instanceof ErrorService)) { + throw new TypeError('ErrorService constructor cannot be called as a function.'); + } + var e = error; + if (typeof error === 'string' || error instanceof String) { + this.message = error; + this.status = -1; + this.type = ErrorService.TYPE_UNKERR; + } else { + this.message = e.message || 'undefined!?'; + this.type = e.type; + this.status = e.status || -1; + } + this.name = 'ErrorService'; + this.stack = new Error().stack; + } + ErrorService.TYPE_SRVERR = 'SERVICE_ERROR'; + ErrorService.TYPE_USEERR = 'USAGE_ERROR'; + ErrorService.TYPE_UNKERR = 'UNKNOWN_ERROR'; + ErrorService.prototype = Object.create(Error.prototype, { + constructor: { + value: ErrorService, + writable: true, + configurable: true + } + }); + return ErrorService; +}(); ProtocolsJSONP = function (Logger) { var JSONP = { uuid: function () { @@ -7203,11 +7203,11 @@ ServicesServices = function (Alti, AutoConf, Geocode, ReverseGeocode, AutoComple var bbox = {}; return Services; }(ServicesAltiAlti, ServicesAutoConfAutoConf, ServicesGeocodeGeocode, ServicesGeocodeReverseGeocode, ServicesAutoCompleteAutoComplete, ServicesRouteRoute, ServicesProcessIsoCurveProcessIsoCurve); -Gp = function (Services, AltiResponse, Elevation, AutoCompleteResponse, SuggestedLocation, GetConfigResponse, Constraint, Format, Layer, Legend, Metadata, Originator, Service, Style, Territory, Thematic, TM, TMLimit, TMS, GeocodeResponse, GeocodedLocation, DirectGeocodedLocation, ReverseGeocodedLocation, IsoCurveResponse, RouteResponse, RouteInstruction, Error) { +Gp = function (XHR, Services, AltiResponse, Elevation, AutoCompleteResponse, SuggestedLocation, GetConfigResponse, Constraint, Format, Layer, Legend, Metadata, Originator, Service, Style, Territory, Thematic, TM, TMLimit, TMS, GeocodeResponse, GeocodedLocation, DirectGeocodedLocation, ReverseGeocodedLocation, IsoCurveResponse, RouteResponse, RouteInstruction, Error) { var scope = typeof window !== 'undefined' ? window : {}; var Gp = scope.Gp || { servicesVersion: '1.0.0-beta2', - servicesDate: '2016-04-22', + servicesDate: '2016-05-18', extend: function (strNS, value) { var parts = strNS.split('.'); var parent = this; @@ -7226,6 +7226,8 @@ Gp = function (Services, AltiResponse, Elevation, AutoCompleteResponse, Suggeste return this; } }; + Gp.extend('Protocols', {}); + Gp.extend('Protocols.XHR', XHR); Gp.extend('Services', Services); Gp.extend('Services.AltiResponse', AltiResponse); Gp.extend('Services.Alti.Elevation', Elevation); @@ -7255,7 +7257,7 @@ Gp = function (Services, AltiResponse, Elevation, AutoCompleteResponse, Suggeste Gp.extend('Error', Error); scope.Gp = Gp; return scope.Gp; -}(ServicesServices, ServicesAltiResponseModelAltiResponse, ServicesAltiResponseModelElevation, ServicesAutoCompleteResponseModelAutoCompleteResponse, ServicesAutoCompleteResponseModelSuggestedLocation, ServicesAutoConfResponseModelAutoConfResponse, ServicesAutoConfResponseModelConstraint, ServicesAutoConfResponseModelFormat, ServicesAutoConfResponseModelLayer, ServicesAutoConfResponseModelLegend, ServicesAutoConfResponseModelMetadata, ServicesAutoConfResponseModelOriginator, ServicesAutoConfResponseModelService, ServicesAutoConfResponseModelStyle, ServicesAutoConfResponseModelTerritory, ServicesAutoConfResponseModelThematic, ServicesAutoConfResponseModelTileMatrix, ServicesAutoConfResponseModelTileMatrixLimit, ServicesAutoConfResponseModelTileMatrixSet, ServicesGeocodeResponseModelGeocodeResponse, ServicesGeocodeResponseModelGeocodedLocation, ServicesGeocodeResponseModelDirectGeocodedLocation, ServicesGeocodeResponseModelReverseGeocodedLocation, ServicesProcessIsoCurveResponseModelProcessIsoCurveResponse, ServicesRouteResponseModelRouteResponse, ServicesRouteResponseModelRouteInstruction, ExceptionsErrorService); +}(ProtocolsXHR, ServicesServices, ServicesAltiResponseModelAltiResponse, ServicesAltiResponseModelElevation, ServicesAutoCompleteResponseModelAutoCompleteResponse, ServicesAutoCompleteResponseModelSuggestedLocation, ServicesAutoConfResponseModelAutoConfResponse, ServicesAutoConfResponseModelConstraint, ServicesAutoConfResponseModelFormat, ServicesAutoConfResponseModelLayer, ServicesAutoConfResponseModelLegend, ServicesAutoConfResponseModelMetadata, ServicesAutoConfResponseModelOriginator, ServicesAutoConfResponseModelService, ServicesAutoConfResponseModelStyle, ServicesAutoConfResponseModelTerritory, ServicesAutoConfResponseModelThematic, ServicesAutoConfResponseModelTileMatrix, ServicesAutoConfResponseModelTileMatrixLimit, ServicesAutoConfResponseModelTileMatrixSet, ServicesGeocodeResponseModelGeocodeResponse, ServicesGeocodeResponseModelGeocodedLocation, ServicesGeocodeResponseModelDirectGeocodedLocation, ServicesGeocodeResponseModelReverseGeocodedLocation, ServicesProcessIsoCurveResponseModelProcessIsoCurveResponse, ServicesRouteResponseModelRouteResponse, ServicesRouteResponseModelRouteInstruction, ExceptionsErrorService); /* END CODE */ return Gp; diff --git a/dist/GpServices.js b/dist/GpServices.js index a1f865f6..bc98d0d5 100644 --- a/dist/GpServices.js +++ b/dist/GpServices.js @@ -10,7 +10,7 @@ * copyright IGN * @author IGN * @version 1.0.0-beta2 - * @date 2016-04-22 + * @date 2016-05-18 * */ /*! @@ -30,10 +30,10 @@ root.Gp = factory(); } }(this, function() { -var log4js,loggerCfg,UtilsLoggerByDefault,UtilsMessagesResources,ExceptionsErrorService,UtilsHelper,promise,ProtocolsXHR,ProtocolsJSONP,ProtocolsProtocol,ServicesDefaultUrlService,ServicesCommonService,ServicesAltiRequestModelAltiRequest,ServicesAltiRequestModelAltiElevationRequest,ServicesAltiRequestModelAltiProfilRequest,ServicesAltiRequestAltiRequestREST,FormatsWPS,ServicesAltiRequestAltiRequestWPS,ServicesAltiRequestAltiRequestFactory,FormatsXML,ServicesAltiResponseModelAltiResponse,ServicesAltiResponseModelElevation,ServicesAltiFormatsAltiResponseReader,ServicesAltiResponseAltiResponseFactory,ServicesAltiAlti,ServicesAutoConfResponseModelAutoConfResponse,ServicesAutoConfResponseModelConstraint,ServicesAutoConfResponseModelFormat,ServicesAutoConfResponseModelLayer,ServicesAutoConfResponseModelLegend,ServicesAutoConfResponseModelMetadata,ServicesAutoConfResponseModelOriginator,ServicesAutoConfResponseModelService,ServicesAutoConfResponseModelStyle,ServicesAutoConfResponseModelTerritory,ServicesAutoConfResponseModelThematic,ServicesAutoConfResponseModelTileMatrixSet,ServicesAutoConfResponseModelTileMatrix,ServicesAutoConfResponseModelTileMatrixLimit,ServicesAutoConfFormatsAutoConfResponseReader,ServicesAutoConfResponseAutoConfResponseFactory,ServicesAutoConfAutoConf,FormatsXLSRequestHeader,FormatsXLSRequest,FormatsXLSAbstractService,FormatsXLS,FormatsXLSLocationUtilityServiceModelAddress,FormatsXLSLocationUtilityServiceGeocodeFilterExtension,FormatsXLSLocationUtilityServiceGeocodeRequest,FormatsXLSLocationUtilityServiceModelPosition,FormatsXLSLocationUtilityServiceModelPreference,FormatsXLSLocationUtilityServiceReverseGeocodeRequest,FormatsXLSLocationUtilityService,ServicesGeocodeRequestGeocodeLocation,ServicesGeocodeRequestModelStreetAddress,ServicesGeocodeRequestModelPositionOfInterest,ServicesGeocodeRequestModelCadastralParcel,ServicesGeocodeRequestModelAdministratif,ServicesGeocodeRequestDirectGeocodeRequestFactory,ServicesGeocodeResponseModelGeocodeResponse,ServicesGeocodeResponseModelGeocodedLocation,ServicesGeocodeResponseModelDirectGeocodedLocation,ServicesGeocodeFormatsDirectGeocodeResponseReader,ServicesGeocodeResponseDirectGeocodeResponseFactory,ServicesGeocodeGeocode,ServicesGeocodeRequestReverseGeocodeRequestFactory,ServicesGeocodeResponseModelReverseGeocodedLocation,ServicesGeocodeFormatsReverseGeocodeResponseReader,ServicesGeocodeResponseReverseGeocodeResponseFactory,ServicesGeocodeReverseGeocode,ServicesAutoCompleteResponseModelAutoCompleteResponse,ServicesAutoCompleteResponseModelSuggestedLocation,ServicesAutoCompleteResponseAutoCompleteResponseFactory,ServicesAutoCompleteAutoComplete,FormatsXLSRouteServiceModelRoutePlan,FormatsXLSRouteServiceDetermineRouteRequest,FormatsXLSRouteServiceRouteRequestExtension,FormatsXLSRouteService,ServicesRouteRequestRouteRequestOLS,ServicesRouteRequestModelRouteParamREST,ServicesRouteRequestRouteRequestREST,ServicesRouteRequestRouteRequestFactory,FormatsWKT,ServicesRouteResponseModelRouteResponse,ServicesRouteResponseModelRouteInstruction,ServicesRouteFormatsRouteResponseRESTReader,ServicesRouteFormatsRouteResponseOLSReader,ServicesRouteResponseRouteResponseFactory,ServicesRouteRoute,ServicesProcessIsoCurveRequestModelProcessIsoCurveParam,ServicesProcessIsoCurveRequestProcessIsoCurveRequest,ServicesProcessIsoCurveResponseModelProcessIsoCurveResponse,ServicesProcessIsoCurveFormatsProcessIsoCurveResponseReader,ServicesProcessIsoCurveResponseProcessIsoCurveResponseFactory,ServicesProcessIsoCurveProcessIsoCurve,ServicesServices,Gp;log4js=void 0,loggerCfg={loggers:[{root:!0,level:"all",appenders:[{type:"Console",layout:{type:"PatternLayout",pattern:"%d{yyyy-MM-dd HH:mm:ss} [%p] %c - %m%n"}}]}]},UtilsLoggerByDefault=function(e,t){var o={getLogger:function(o){e.load(t,function(e){if(e)throw e});var r=o||"default";return e.getLogger(r)}};return o}(log4js,loggerCfg),UtilsMessagesResources=function(){var e={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(e,t){if(!arguments)return"Message indefined !";var o=Array.prototype.slice.call(arguments),r=o.shift(),s=o,n=this[r];try{n=Array.isArray(s)&&s.length>0?n.replace("%var%",s.join(" - ")):n.replace("%var%","%var% (not specified)")}catch(i){}return n}};return e}(),ExceptionsErrorService=function(){function e(t){if(!(this instanceof e))throw new TypeError("ErrorService constructor cannot be called as a function.");var o=t;"string"==typeof t||t instanceof String?(this.message=t,this.status=-1,this.type=e.TYPE_UNKERR):(this.message=o.message||"undefined!?",this.type=o.type,this.status=o.status||-1),this.name="ErrorService",this.stack=(new Error).stack}return e.TYPE_SRVERR="SERVICE_ERROR",e.TYPE_USEERR="USAGE_ERROR",e.TYPE_UNKERR="UNKNOWN_ERROR",e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),e}(),UtilsHelper=function(){var e={normalyzeParameters:function(e){var t=null;if(e){var o=[];for(var r in e)if(e.hasOwnProperty(r)){var s=e[r];s||(s=""),o.push(r+"="+s)}t=o.join("&")}return t},normalyzeUrl:function(e,t,o){var r=e;if(e){var s=e.indexOf("?");-1===s&&(r+="?"),-1!==s&&s!==e.length-1&&(r+="&")}return t&&(r+="string"==typeof t?t:this.normalyzeParameters(t)),o&&(r=encodeURIComponent(r)),r},indent:function(e,t){var o=e||0;return new Array(o+1).join(" ")+t}};return e}(),function(){"use strict";function e(e){return"function"==typeof e||"object"==typeof e&&null!==e}function t(e){return"function"==typeof e}function o(e){return"object"==typeof e&&null!==e}function r(e){V=e}function s(e){Y=e}function n(){return function(){process.nextTick(u)}}function i(){return function(){k(u)}}function a(){var e=0,t=new W(u),o=document.createTextNode("");return t.observe(o,{characterData:!0}),function(){o.data=e=++e%2}}function c(){var e=new MessageChannel;return e.port1.onmessage=u,function(){e.port2.postMessage(0)}}function l(){return function(){setTimeout(u,1)}}function u(){for(var e=0;B>e;e+=2){var t=Q[e],o=Q[e+1];t(o),Q[e]=void 0,Q[e+1]=void 0}B=0}function p(){try{var e=require,t=e("vertx");return k=t.runOnLoop||t.runOnContext,i()}catch(o){return l()}}function h(){}function f(){return new TypeError("You cannot resolve a promise with itself")}function d(){return new TypeError("A promises callback cannot return that same promise.")}function g(e){try{return e.then}catch(t){return te.error=t,te}}function m(e,t,o,r){try{e.call(t,o,r)}catch(s){return s}}function R(e,t,o){Y(function(e){var r=!1,s=m(o,t,function(o){r||(r=!0,t!==o?E(e,o):y(e,o))},function(t){r||(r=!0,w(e,t))},"Settle: "+(e._label||" unknown promise"));!r&&s&&(r=!0,w(e,s))},e)}function v(e,t){t._state===Z?y(e,t._result):t._state===ee?w(e,t._result):A(t,void 0,function(t){E(e,t)},function(t){w(e,t)})}function S(e,o){if(o.constructor===e.constructor)v(e,o);else{var r=g(o);r===te?w(e,te.error):void 0===r?y(e,o):t(r)?R(e,o,r):y(e,o)}}function E(t,o){t===o?w(t,f()):e(o)?S(t,o):y(t,o)}function _(e){e._onerror&&e._onerror(e._result),P(e)}function y(e,t){e._state===$&&(e._result=t,e._state=Z,0!==e._subscribers.length&&Y(P,e))}function w(e,t){e._state===$&&(e._state=ee,e._result=t,Y(_,e))}function A(e,t,o,r){var s=e._subscribers,n=s.length;e._onerror=null,s[n]=t,s[n+Z]=o,s[n+ee]=r,0===n&&e._state&&Y(P,e)}function P(e){var t=e._subscribers,o=e._state;if(0!==t.length){for(var r,s,n=e._result,i=0;ii;i++)A(r.resolve(e[i]),void 0,t,o);return s}function N(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var o=new t(h);return E(o,e),o}function I(e){var t=this,o=new t(h);return w(o,e),o}function F(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function D(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function U(e){this._id=ce++,this._state=void 0,this._result=void 0,this._subscribers=[],h!==e&&(t(e)||F(),this instanceof U||D(),O(this,e))}function q(){var e;if("undefined"!=typeof global)e=global;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var o=e.Promise;(!o||"[object Promise]"!==Object.prototype.toString.call(o.resolve())||o.cast)&&(e.Promise=le)}var G;G=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var k,V,X,j=G,B=0,Y=({}.toString,function(e,t){Q[B]=e,Q[B+1]=t,B+=2,2===B&&(V?V(u):X())}),H="undefined"!=typeof window?window:void 0,K=H||{},W=K.MutationObserver||K.WebKitMutationObserver,z="undefined"!=typeof process&&"[object process]"==={}.toString.call(process),J="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,Q=new Array(1e3);X=z?n():W?a():J?c():void 0===H&&"function"==typeof require?p():l();var $=void 0,Z=1,ee=2,te=new T,oe=new T;b.prototype._validateInput=function(e){return j(e)},b.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},b.prototype._init=function(){this._result=new Array(this.length)};var re=b;b.prototype._enumerate=function(){for(var e=this,t=e.length,o=e.promise,r=e._input,s=0;o._state===$&&t>s;s++)e._eachEntry(r[s],s)},b.prototype._eachEntry=function(e,t){var r=this,s=r._instanceConstructor;o(e)?e.constructor===s&&e._state!==$?(e._onerror=null,r._settledAt(e._state,t,e._result)):r._willSettleAt(s.resolve(e),t):(r._remaining--,r._result[t]=e)},b.prototype._settledAt=function(e,t,o){var r=this,s=r.promise;s._state===$&&(r._remaining--,e===ee?w(s,o):r._result[t]=o),0===r._remaining&&y(s,r._result)},b.prototype._willSettleAt=function(e,t){var o=this;A(e,void 0,function(e){o._settledAt(Z,t,e)},function(e){o._settledAt(ee,t,e)})};var se=x,ne=L,ie=N,ae=I,ce=0,le=U;U.all=se,U.race=ne,U.resolve=ie,U.reject=ae,U._setScheduler=r,U._setAsap=s,U._asap=Y,U.prototype={constructor:U,then:function(e,t){var o=this,r=o._state;if(r===Z&&!e||r===ee&&!t)return this;var s=new this.constructor(h),n=o._result;if(r){var i=arguments[r-1];Y(function(){C(r,s,i,n)})}else A(o,s,e,t);return s},"catch":function(e){return this.then(null,e)}};var ue=q,pe={Promise:le,polyfill:ue};promise=function(){return pe}(),ue()}.call(this),ProtocolsXHR=function(e,t,o){var r={call:function(e){if(o.polyfill(),!e.url)throw new Error("missing parameter : url is not defined !");if(!e.method)throw new Error("missing parameter : method is not defined !");e.format||(e.format="text");var t={};switch(t.url=e.url,t.data=e.data?e.data:null,t.method=e.method,t.timeOut=e.timeOut||0,e.method){case"GET":break;case"POST":t.content=e.content?e.content:"application/x-www-form-urlencoded",t.headers=e.headers?e.headers:{referer:"http://localhost"};break;case"DELETE":case"PUT":throw new Error("HTTP method not yet supported !");default:throw new Error("HTTP method unknown !")}switch(e.format){case"text":this.__call(t).then(function(t){e.onResponse.call(this,t)})["catch"](function(t){e.onFailure.call(this,t)});break;case"json":this.__callJSON(t).then(function(t){e.onResponse.call(this,t)})["catch"](function(t){e.onFailure.call(this,t)});break;case"xml":this.__callXML(t).then(function(t){e.onResponse.call(this,t)})["catch"](function(t){e.onFailure.call(this,t)});break;default:throw new Error("This output Format is not yet supported !")}},__call:function(e){var o=new Promise(function(o,r){e.data&&"GET"==e.method&&(e.url=t.normalyzeUrl(e.url,e.data));var s=null;if(window.XDomainRequest){s=new XDomainRequest,s.open(e.method,e.url),s.overrideMimeType=e.content,e.timeOut>0&&(s.timeout=e.timeout),"GET"!==e.method&&s.setRequestHeader("Content-type",e.content),s.onerror=function(){r(new Error("Errors Occured on Http Request with XMLHttpRequest !"))},s.ontimeout=function(){r(new Error("TimeOut Occured on Http Request with XMLHttpRequest !"))},s.onload=function(){if(200==s.status)o(s.response);else{var e="Errors Occured on Http Request (status : '"+s.status+"' | response : '"+s.response+"')",t=s.status;r({message:e,status:t})}};var n=e.data&&"POST"==e.method?e.data:null;s.send(n)}else{if(!window.XMLHttpRequest)throw new Error("CORS not supported");s=new XMLHttpRequest,s.open(e.method,e.url,!0),s.overrideMimeType=e.content;var i=null;e.timeOut>0&&(i=window.setTimeout(function(){var e="TimeOut Occured on Http Request with XMLHttpRequest !";r({message:e,status:-1})},e.timeOut)),"GET"!==e.method&&s.setRequestHeader("Content-type",e.content),s.onerror=function(e){console.log(e),r(new Error("Errors Occured on Http Request with XMLHttpRequest !"))},s.ontimeout=function(){r(new Error("TimeOut Occured on Http Request with XMLHttpRequest !"))},s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status)window.clearTimeout(i),o(s.response);else{var e="Errors Occured on Http Request (status : '"+s.status+"' | response : '"+s.response+"')",t=s.status;r({message:e,status:t})}};var a=e.data&&"POST"==e.method?e.data:null;s.send(a)}});return o},__callJSON:function(e){return this.__call(e).then(JSON.parse)["catch"](function(t){throw console.log("_callJSON failed on : ",e.url,t),t})},__callXML:function(e){return this.__call(e).then(function(e){var t;if(window.DOMParser){var o=new DOMParser;t=o.parseFromString(e,"text/xml")}else t=new window.ActiveXObject("Microsoft.XMLDOM"),t.async=!1,t.loadXML(e);return t})["catch"](function(t){throw console.log("__callXML failed on : ",e.url,t),t})}};return r}(UtilsLoggerByDefault,UtilsHelper,promise),ProtocolsJSONP=function(e){var t={uuid:function(){var e=Math.floor(Date.now());return function(){return e++}}(),call:function(e){if(!e)throw new Error("missing parameter : options !");if(!e.url)throw new Error("missing parameter : options.url !");if(e.timeOut||(e.timeOut=0),!e.onResponse)throw new Error("missing parameter : options.onResponse !");var t="string"==typeof e.callbackSuffix?e.callbackSuffix:this.uuid(),o=!1,r=!1,s=e.url.indexOf("callback=");if(-1!=s){o=!0;var n=e.url.indexOf("&",s);-1===n&&(n=e.url.length);var i=e.url.substring(s+9,n);i&&(r=!0,e.callbackName=i)}if(!o){var a=e.url.indexOf("?");-1===a?e.url=e.url+"?callback=":a===e.url.length?e.url=e.url+"callback=":e.url=e.url+"&callback="}var c=e.callbackName?!0:r;if(r||(e.callbackName||(e.callbackName="callback",(t||""===t)&&(e.callbackName+=t)),e.url=e.url.replace("callback=","callback="+e.callbackName)),e.onTimeOut||(e.onTimeOut=function(){console.log("TimeOut while invoking url : "+e.url)}),!c){var l=this,u=null;e.timeOut>0&&(u=window.setTimeout(function(){window[e.callbackName]=function(){},e.onTimeOut(),l._deleteScript(t)},e.timeOut)),window[e.callbackName]=function(o){window.clearTimeout(u),e.onResponse(o),l._deleteScript(t)}}this._createScript(t,e.url)},_createScript:function(e,t){var o,r=document.getElementById("results"+e);o=document.createElement("script"),o.setAttribute("type","text/javascript"),o.setAttribute("src",t),o.setAttribute("charset","UTF-8"),o.setAttribute("id","results"+e),o.setAttribute("async","true");var s=document.documentElement||document.getElementsByTagName("head")[0];null===r?s.appendChild(o):s.replaceChild(o,r)},_deleteScript:function(e){var t=document.getElementById("results"+e);if(t){var o=t.parentNode||document.documentElement;if(!o)return;o.removeChild(t)}}};return t}(UtilsLoggerByDefault),ProtocolsProtocol=function(e,t,o){var r={send:function(r){var s=r||{method:"GET",protocol:"JSONP",timeOut:0,format:null,wrap:!0,nocache:!0,output:"json",callback:null,callbackSuffix:null};if("XHR"===r.protocol||"json"===r.format?s.wrap=!1:"JSONP"===r.protocol&&"xml"===r.format&&(s.wrap=!0),s.callback=("JSONP"==r.protocol,null),s.output=s.wrap?"json":null,s.wrap){var n={};n.output=s.output,n.callback=s.callback,delete n.callback,s.url=e.normalyzeUrl(r.url,n)}switch(s.protocol){case"XHR":"GET"===r.method&&r.nocache&&(s.url=e.normalyzeUrl(s.url,{t:(new Date).getTime()})),t.call(s);break;case"JSONP":s.data&&(s.url=e.normalyzeUrl(s.url,s.data)),o.call(s);break;default:throw new Error("protocol not supported (XHR|JSONP) !")}}};return r}(UtilsHelper,ProtocolsXHR,ProtocolsJSONP),ServicesDefaultUrlService=function(){var e="http://",t="wxs.ign.fr",o="%KEY%",r=e+t.concat("/",o),s=function(e){return this._key.replace(e?o:null,e)},n={Alti:{_key:{"elevation-json":r+"/alti/rest/elevation.json","elevation-xml":r+"/alti/rest/elevation.xml","profil-json":r+"/alti/rest/elevationLine.json","profil-xml":r+"/alti/rest/elevationLine.xml",wps:r+"/alti/wps"},url:function(e){return{"elevation-json":this._key["elevation-json"].replace(e?o:null,e),"elevation-xml":this._key["elevation-xml"].replace(e?o:null,e),"profil-json":this._key["profil-json"].replace(e?o:null,e),"profil-xml":this._key["profil-xml"].replace(e?o:null,e),wps:this._key.wps.replace(e?o:null,e)}}},ProcessIsoCurve:{_key:{"iso-json":r+"/isochrone/isochrone.json","iso-xml":r+"/isochrone/isochrone.xml"},url:function(e){return{"iso-json":this._key["iso-json"].replace(e?o:null,e),"iso-xml":this._key["iso-xml"].replace(e?o:null,e)}}},AutoComplete:{_key:r+"/ols/apis/completion",url:s},ReverseGeocode:{_key:r+"/geoportail/ols",url:s},AutoConf:{_key:{apiKey:r+"/autoconf",apiKeys:r+"/autoconf?keys=%KEYS%"},url:function(r){var s="";if(Array.isArray(r)&&r.length>0){s=r[0];for(var n=1;nt||t>e?this.positions:this.positions[e]},addPositions:function(e){for(var t=0;t",input:"__KEY__=__DATA__"},post:{value:'__IDENTIFIER____RAWDATAOUTPUT__',input:"__KEY____DATA__"}},namespaceByDefault:function(){var e=['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 e.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 e="";if("POST"==this.method)e=this.template.post.value;else{if("GET"!=this.method)return!1;e=this.template.get.value}return e=e.replace(/__SERVICE__/g,this.paramservice),e=e.replace(/__VERSION__/g,this.paramversion),e=e.replace(/__RAWDATAOUTPUT__/g,this.paramrawdataoutput),e=e.replace(/__IDENTIFIER__/g,this.paramidentifier),e=e.replace(/__REQUEST__/g,this.paramrequest),"POST"==this.method&&(e=e.replace(/__NAMESPACE__/g,this.namespaceByDefault),e=e.replace(/__SCHEMALOCATION__/g,this.schemaLocationByDefault)),(e=e.replace(//g,this.__addDataInputs()))?(this.requestString=e,!0):!1},__addDataInputs:function(){for(var e="GET"==this.method?this.template.get.input:this.template.post.input,t="GET"==this.method?";":"",o="",r=this,s=this.DataObject.getData(),n=0;ne;e+=2){var t=Q[e],o=Q[e+1];t(o),Q[e]=void 0,Q[e+1]=void 0}B=0}function p(){try{var e=require,t=e("vertx");return k=t.runOnLoop||t.runOnContext,i()}catch(o){return l()}}function h(){}function f(){return new TypeError("You cannot resolve a promise with itself")}function d(){return new TypeError("A promises callback cannot return that same promise.")}function g(e){try{return e.then}catch(t){return te.error=t,te}}function m(e,t,o,r){try{e.call(t,o,r)}catch(s){return s}}function R(e,t,o){Y(function(e){var r=!1,s=m(o,t,function(o){r||(r=!0,t!==o?E(e,o):y(e,o))},function(t){r||(r=!0,w(e,t))},"Settle: "+(e._label||" unknown promise"));!r&&s&&(r=!0,w(e,s))},e)}function v(e,t){t._state===Z?y(e,t._result):t._state===ee?w(e,t._result):A(t,void 0,function(t){E(e,t)},function(t){w(e,t)})}function S(e,o){if(o.constructor===e.constructor)v(e,o);else{var r=g(o);r===te?w(e,te.error):void 0===r?y(e,o):t(r)?R(e,o,r):y(e,o)}}function E(t,o){t===o?w(t,f()):e(o)?S(t,o):y(t,o)}function _(e){e._onerror&&e._onerror(e._result),P(e)}function y(e,t){e._state===$&&(e._result=t,e._state=Z,0!==e._subscribers.length&&Y(P,e))}function w(e,t){e._state===$&&(e._state=ee,e._result=t,Y(_,e))}function A(e,t,o,r){var s=e._subscribers,n=s.length;e._onerror=null,s[n]=t,s[n+Z]=o,s[n+ee]=r,0===n&&e._state&&Y(P,e)}function P(e){var t=e._subscribers,o=e._state;if(0!==t.length){for(var r,s,n=e._result,i=0;ii;i++)A(r.resolve(e[i]),void 0,t,o);return s}function N(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var o=new t(h);return E(o,e),o}function I(e){var t=this,o=new t(h);return w(o,e),o}function F(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function D(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function U(e){this._id=ce++,this._state=void 0,this._result=void 0,this._subscribers=[],h!==e&&(t(e)||F(),this instanceof U||D(),O(this,e))}function q(){var e;if("undefined"!=typeof global)e=global;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var o=e.Promise;(!o||"[object Promise]"!==Object.prototype.toString.call(o.resolve())||o.cast)&&(e.Promise=le)}var G;G=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var k,V,X,j=G,B=0,Y=({}.toString,function(e,t){Q[B]=e,Q[B+1]=t,B+=2,2===B&&(V?V(u):X())}),H="undefined"!=typeof window?window:void 0,K=H||{},W=K.MutationObserver||K.WebKitMutationObserver,z="undefined"!=typeof process&&"[object process]"==={}.toString.call(process),J="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,Q=new Array(1e3);X=z?n():W?a():J?c():void 0===H&&"function"==typeof require?p():l();var $=void 0,Z=1,ee=2,te=new T,oe=new T;x.prototype._validateInput=function(e){return j(e)},x.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},x.prototype._init=function(){this._result=new Array(this.length)};var re=x;x.prototype._enumerate=function(){for(var e=this,t=e.length,o=e.promise,r=e._input,s=0;o._state===$&&t>s;s++)e._eachEntry(r[s],s)},x.prototype._eachEntry=function(e,t){var r=this,s=r._instanceConstructor;o(e)?e.constructor===s&&e._state!==$?(e._onerror=null,r._settledAt(e._state,t,e._result)):r._willSettleAt(s.resolve(e),t):(r._remaining--,r._result[t]=e)},x.prototype._settledAt=function(e,t,o){var r=this,s=r.promise;s._state===$&&(r._remaining--,e===ee?w(s,o):r._result[t]=o),0===r._remaining&&y(s,r._result)},x.prototype._willSettleAt=function(e,t){var o=this;A(e,void 0,function(e){o._settledAt(Z,t,e)},function(e){o._settledAt(ee,t,e)})};var se=b,ne=L,ie=N,ae=I,ce=0,le=U;U.all=se,U.race=ne,U.resolve=ie,U.reject=ae,U._setScheduler=r,U._setAsap=s,U._asap=Y,U.prototype={constructor:U,then:function(e,t){var o=this,r=o._state;if(r===Z&&!e||r===ee&&!t)return this;var s=new this.constructor(h),n=o._result;if(r){var i=arguments[r-1];Y(function(){C(r,s,i,n)})}else A(o,s,e,t);return s},"catch":function(e){return this.then(null,e)}};var ue=q,pe={Promise:le,polyfill:ue};promise=function(){return pe}(),ue()}.call(this),ProtocolsXHR=function(e,t,o){var r={call:function(e){if(o.polyfill(),!e.url)throw new Error("missing parameter : url is not defined !");if(!e.method)throw new Error("missing parameter : method is not defined !");e.format||(e.format="text");var t={};switch(t.url=e.url,t.data=e.data?e.data:null,t.method=e.method,t.timeOut=e.timeOut||0,e.method){case"GET":break;case"POST":t.content=e.content?e.content:"application/x-www-form-urlencoded",t.headers=e.headers?e.headers:{referer:"http://localhost"};break;case"DELETE":case"PUT":throw new Error("HTTP method not yet supported !");default:throw new Error("HTTP method unknown !")}switch(e.format){case"text":this.__call(t).then(function(t){e.onResponse.call(this,t)})["catch"](function(t){e.onFailure.call(this,t)});break;case"json":this.__callJSON(t).then(function(t){e.onResponse.call(this,t)})["catch"](function(t){e.onFailure.call(this,t)});break;case"xml":this.__callXML(t).then(function(t){e.onResponse.call(this,t)})["catch"](function(t){e.onFailure.call(this,t)});break;default:throw new Error("This output Format is not yet supported !")}},__call:function(e){var o=new Promise(function(o,r){e.data&&"GET"==e.method&&(e.url=t.normalyzeUrl(e.url,e.data));var s=null;if(window.XDomainRequest){s=new XDomainRequest,s.open(e.method,e.url),s.overrideMimeType=e.content,e.timeOut>0&&(s.timeout=e.timeout),"GET"!==e.method&&s.setRequestHeader("Content-type",e.content),s.onerror=function(){r(new Error("Errors Occured on Http Request with XMLHttpRequest !"))},s.ontimeout=function(){r(new Error("TimeOut Occured on Http Request with XMLHttpRequest !"))},s.onload=function(){if(200==s.status)o(s.response);else{var e="Errors Occured on Http Request (status : '"+s.status+"' | response : '"+s.response+"')",t=s.status;r({message:e,status:t})}};var n=e.data&&"POST"==e.method?e.data:null;s.send(n)}else{if(!window.XMLHttpRequest)throw new Error("CORS not supported");s=new XMLHttpRequest,s.open(e.method,e.url,!0),s.overrideMimeType=e.content;var i=null;e.timeOut>0&&(i=window.setTimeout(function(){var e="TimeOut Occured on Http Request with XMLHttpRequest !";r({message:e,status:-1})},e.timeOut)),"GET"!==e.method&&s.setRequestHeader("Content-type",e.content),s.onerror=function(e){console.log(e),r(new Error("Errors Occured on Http Request with XMLHttpRequest !"))},s.ontimeout=function(){r(new Error("TimeOut Occured on Http Request with XMLHttpRequest !"))},s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status)window.clearTimeout(i),o(s.response);else{var e="Errors Occured on Http Request (status : '"+s.status+"' | response : '"+s.response+"')",t=s.status;r({message:e,status:t})}};var a=e.data&&"POST"==e.method?e.data:null;s.send(a)}});return o},__callJSON:function(e){return this.__call(e).then(JSON.parse)["catch"](function(t){throw console.log("_callJSON failed on : ",e.url,t),t})},__callXML:function(e){return this.__call(e).then(function(e){var t;if(window.DOMParser){var o=new DOMParser;t=o.parseFromString(e,"text/xml")}else t=new window.ActiveXObject("Microsoft.XMLDOM"),t.async=!1,t.loadXML(e);return t})["catch"](function(t){throw console.log("__callXML failed on : ",e.url,t),t})}};return r}(UtilsLoggerByDefault,UtilsHelper,promise),UtilsMessagesResources=function(){var e={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(e,t){if(!arguments)return"Message indefined !";var o=Array.prototype.slice.call(arguments),r=o.shift(),s=o,n=this[r];try{n=Array.isArray(s)&&s.length>0?n.replace("%var%",s.join(" - ")):n.replace("%var%","%var% (not specified)")}catch(i){}return n}};return e}(),ExceptionsErrorService=function(){function e(t){if(!(this instanceof e))throw new TypeError("ErrorService constructor cannot be called as a function.");var o=t;"string"==typeof t||t instanceof String?(this.message=t,this.status=-1,this.type=e.TYPE_UNKERR):(this.message=o.message||"undefined!?",this.type=o.type,this.status=o.status||-1),this.name="ErrorService",this.stack=(new Error).stack}return e.TYPE_SRVERR="SERVICE_ERROR",e.TYPE_USEERR="USAGE_ERROR",e.TYPE_UNKERR="UNKNOWN_ERROR",e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),e}(),ProtocolsJSONP=function(e){var t={uuid:function(){var e=Math.floor(Date.now());return function(){return e++}}(),call:function(e){if(!e)throw new Error("missing parameter : options !");if(!e.url)throw new Error("missing parameter : options.url !");if(e.timeOut||(e.timeOut=0),!e.onResponse)throw new Error("missing parameter : options.onResponse !");var t="string"==typeof e.callbackSuffix?e.callbackSuffix:this.uuid(),o=!1,r=!1,s=e.url.indexOf("callback=");if(-1!=s){o=!0;var n=e.url.indexOf("&",s);-1===n&&(n=e.url.length);var i=e.url.substring(s+9,n);i&&(r=!0,e.callbackName=i)}if(!o){var a=e.url.indexOf("?");-1===a?e.url=e.url+"?callback=":a===e.url.length?e.url=e.url+"callback=":e.url=e.url+"&callback="}var c=e.callbackName?!0:r;if(r||(e.callbackName||(e.callbackName="callback",(t||""===t)&&(e.callbackName+=t)),e.url=e.url.replace("callback=","callback="+e.callbackName)),e.onTimeOut||(e.onTimeOut=function(){console.log("TimeOut while invoking url : "+e.url)}),!c){var l=this,u=null;e.timeOut>0&&(u=window.setTimeout(function(){window[e.callbackName]=function(){},e.onTimeOut(),l._deleteScript(t)},e.timeOut)),window[e.callbackName]=function(o){window.clearTimeout(u),e.onResponse(o),l._deleteScript(t)}}this._createScript(t,e.url)},_createScript:function(e,t){var o,r=document.getElementById("results"+e);o=document.createElement("script"),o.setAttribute("type","text/javascript"),o.setAttribute("src",t),o.setAttribute("charset","UTF-8"),o.setAttribute("id","results"+e),o.setAttribute("async","true");var s=document.documentElement||document.getElementsByTagName("head")[0];null===r?s.appendChild(o):s.replaceChild(o,r)},_deleteScript:function(e){var t=document.getElementById("results"+e);if(t){var o=t.parentNode||document.documentElement;if(!o)return;o.removeChild(t)}}};return t}(UtilsLoggerByDefault),ProtocolsProtocol=function(e,t,o){var r={send:function(r){var s=r||{method:"GET",protocol:"JSONP",timeOut:0,format:null,wrap:!0,nocache:!0,output:"json",callback:null,callbackSuffix:null};if("XHR"===r.protocol||"json"===r.format?s.wrap=!1:"JSONP"===r.protocol&&"xml"===r.format&&(s.wrap=!0),s.callback=("JSONP"==r.protocol,null),s.output=s.wrap?"json":null,s.wrap){var n={};n.output=s.output,n.callback=s.callback,delete n.callback,s.url=e.normalyzeUrl(r.url,n)}switch(s.protocol){case"XHR":"GET"===r.method&&r.nocache&&(s.url=e.normalyzeUrl(s.url,{t:(new Date).getTime()})),t.call(s);break;case"JSONP":s.data&&(s.url=e.normalyzeUrl(s.url,s.data)),o.call(s);break;default:throw new Error("protocol not supported (XHR|JSONP) !")}}};return r}(UtilsHelper,ProtocolsXHR,ProtocolsJSONP),ServicesDefaultUrlService=function(){var e="http://",t="wxs.ign.fr",o="%KEY%",r=e+t.concat("/",o),s=function(e){return this._key.replace(e?o:null,e)},n={Alti:{_key:{"elevation-json":r+"/alti/rest/elevation.json","elevation-xml":r+"/alti/rest/elevation.xml","profil-json":r+"/alti/rest/elevationLine.json","profil-xml":r+"/alti/rest/elevationLine.xml",wps:r+"/alti/wps"},url:function(e){return{"elevation-json":this._key["elevation-json"].replace(e?o:null,e),"elevation-xml":this._key["elevation-xml"].replace(e?o:null,e),"profil-json":this._key["profil-json"].replace(e?o:null,e),"profil-xml":this._key["profil-xml"].replace(e?o:null,e),wps:this._key.wps.replace(e?o:null,e)}}},ProcessIsoCurve:{_key:{"iso-json":r+"/isochrone/isochrone.json","iso-xml":r+"/isochrone/isochrone.xml"},url:function(e){return{"iso-json":this._key["iso-json"].replace(e?o:null,e),"iso-xml":this._key["iso-xml"].replace(e?o:null,e)}}},AutoComplete:{_key:r+"/ols/apis/completion",url:s},ReverseGeocode:{_key:r+"/geoportail/ols",url:s},AutoConf:{_key:{apiKey:r+"/autoconf",apiKeys:r+"/autoconf?keys=%KEYS%"},url:function(r){var s="";if(Array.isArray(r)&&r.length>0){s=r[0];for(var n=1;nt||t>e?this.positions:this.positions[e]},addPositions:function(e){for(var t=0;t",input:"__KEY__=__DATA__"},post:{value:'__IDENTIFIER____RAWDATAOUTPUT__',input:"__KEY____DATA__"}},namespaceByDefault:function(){var e=['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 e.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 e="";if("POST"==this.method)e=this.template.post.value;else{if("GET"!=this.method)return!1;e=this.template.get.value}return e=e.replace(/__SERVICE__/g,this.paramservice),e=e.replace(/__VERSION__/g,this.paramversion),e=e.replace(/__RAWDATAOUTPUT__/g,this.paramrawdataoutput),e=e.replace(/__IDENTIFIER__/g,this.paramidentifier),e=e.replace(/__REQUEST__/g,this.paramrequest),"POST"==this.method&&(e=e.replace(/__NAMESPACE__/g,this.namespaceByDefault),e=e.replace(/__SCHEMALOCATION__/g,this.schemaLocationByDefault)),(e=e.replace(//g,this.__addDataInputs()))?(this.requestString=e,!0):!1},__addDataInputs:function(){for(var e="GET"==this.method?this.template.get.input:this.template.post.input,t="GET"==this.method?";":"",o="",r=this,s=this.DataObject.getData(),n=0;n0)for(var a=r.getElementsByTagName("parsererror"),c=0;c0){var o=n(e);t.attributes=o}if(e.hasChildNodes())for(var r,i={},a=e.childNodes,c=0;c0){for(var t={},o=e.attributes,r=0;r0){for(var t={},o=e.attributes,r=0;r0){var t=g(e);for(var o in t)if(t.hasOwnProperty(o)){if("version"===o&&t.version!==S.VERSION)return void console.log("[AutoConfResponseReader] autoconf version is not the expected one : there may be errors in parsing");if("xmlns"===o){if(t[o]!==S.NAMESPACES.xmlns)return void console.log("[AutoConfResponseReader] autoconf response default namespace is not the expected one");continue}var r=o.split(":")[0],s=o.split(":")[1];if("xmlns"===r&&s&&S.NAMESPACES[s]&&S.NAMESPACES[s]!==t[o])return void console.log("[AutoConfResponseReader] autoconf response "+o+" namespace is not the expected one");if("schemaLocation"===s&&t[o]!==S.SCHEMALOCATION[0]&&t[o]!==S.SCHEMALOCATION[1])return void console.log("[AutoConfResponseReader] autoconf response schema location is not the expected one")}}}var S={};return S.VERSION="1.1.0",S.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"},S.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"],S.DEFAULTPREFIX="context",S.READERS={context:{ViewContext:function(e){v(e);var o=new t;return m(e,o),o},Title:function(e,t){t&&t.generalOptions?t.generalOptions.title=R(e):t&&t.lyr&&(t.lyr.title=R(e))},Abstract:function(e,t){t&&t.lyr&&(t.lyr.description=R(e))},Server:function(e,t){var o=e.getAttribute("service"),r=e.getAttribute("title"),s=e.getAttribute("version");if(o)if(t&&t.services&&"object"==typeof t.services&&!t.services[o]){var n=new c;n.title=r,n.version=s,m(e,n),t.services[o]=n}else t&&t.lyr&&(t.lyr.serviceParams||(t.lyr.serviceParams={}),t.lyr.serviceParams.id=o,t.lyr.serviceParams.version=s)},OnlineResource:function(e,t){t&&t.hasOwnProperty("serverUrl")&&(t.serverUrl=e.getAttribute("xlink:href"))},LayerList:function(e,t){if(m(e,t),t&&t.layers&&t.generalOptions&&t.services)for(var o in t.layers)if(t.layers.hasOwnProperty(o)){var r=t.layers[o],s=r.apiKeys;if(s&&Array.isArray(s))for(var n=0;n0?this.options.serverUrl=o.apiKeys:this.options.serverUrl=o.apiKey}"XHR"===this.options.protocol&&"POST"===this.options.httpMethod&&(this.options.httpMethod="GET"),this.options.outputFormat="xml"}return a.prototype=Object.create(n.prototype,{}),a.prototype.constructor=a,a.prototype.buildRequest=function(e,t){var o="undefined"!=typeof window?window:{};if(o.Gp&&o.Gp.Config&&o.Gp.Config.generalOptions&&o.Gp.Config.layers&&o.Gp.Config.generalOptions.apiKeys[this.options.apiKey]){if(!this.options.layerId)return void this.options.onSuccess.call(this,o.Gp.Config);if(o.Gp.Config.layers[this.options.layerId]&&o.Gp.Config.layers[this.options.layerId].aggregatedLayers)return void this.options.onSuccess.call(this,o.Gp.Config)}this.request="";var s;s=-1===this.options.serverUrl.indexOf("http://")?!0:!1,!s&&this.layerId&&(this.request=r.normalyzeParameters({layerId:this.layerId})),t.call(this,this.request)},a.prototype.analyzeResponse=function(e,r){if(this.response){var s={layerId:this.options.layerId,response:this.response,rawResponse:this.options.rawResponse,onSuccess:r,onError:e,scope:this};i.build(s)}else e.call(this,new o(t.getMessage("SERVICE_RESPONSE_EMPTY")))},a}(UtilsLoggerByDefault,UtilsMessagesResources,ExceptionsErrorService,UtilsHelper,ServicesDefaultUrlService,ServicesCommonService,ServicesAutoConfResponseAutoConfResponseFactory),FormatsXLSRequestHeader=function(e){function t(e){if(!(this instanceof t))throw new TypeError("RequestHeader constructor cannot be called as a function.");this.options=e||{srsName:"EPSG:4326"};for(var o in e)e.hasOwnProperty(o)&&(this.options[o]=e[o])}return t.prototype={requestString:null,template:'',constructor:t,toString:function(){var e=null;return e=this.template,e=e.replace(/__SRSNAME__/g,this.options.srsName),this.requestString=e,this.requestString}},t}(UtilsLoggerByDefault),FormatsXLSRequest=function(e){function t(e){if(!(this instanceof t))throw new TypeError("Request constructor cannot be called as a function.");this.options=e||{maximumResponses:25,methodName:null,version:"1.2"};for(var o in e)e.hasOwnProperty(o)&&(this.options[o]=e[o])}return t.prototype={requestString:null,template:'',constructor:t,guid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,o="x"===e?t:3&t|8;return o.toString(16)})},toString:function(){var e=null;return e=this.template,e=e.replace(/__MAXRESPONSES__/g,this.options.maximumResponses),e=e.replace(/__METHODNAME__/g,this.options.methodName),e=e.replace(/__UUID__/g,this.guid()),e=e.replace(/__VERSION__/g,this.options.version),this.requestString=e,this.requestString}},t}(UtilsLoggerByDefault),FormatsXLSAbstractService=function(e){function t(e){if(!(this instanceof t))throw new TypeError("AbstractService constructor cannot be called as a function.");this.options=e||{};for(var o in e)e.hasOwnProperty(o)&&(this.options[o]=e[o])}return t.prototype={strRequest:null,oRequest:null,oFilter:null,constructor:t,addRequest:function(e){},addFilter:function(e){},toString:function(){}},t}(UtilsLoggerByDefault),FormatsXLS=function(e,t,o,r){function s(e){if(!(this instanceof s))throw new TypeError("XLS constructor cannot be called as a function.");this.options={srsName:"EPSG:4326",maximumResponses:25};for(var t in e)e.hasOwnProperty(t)&&e[t]&&(this.options[t]=e[t])}return s.VERSION="1.2",s.prototype={requestString:null,namespace:!1,oService:null,constructor:s,template:'\n\n__REQUESTHEADER__\n__REQUEST__\n\n',namespaceByDefault:function(){var e=['xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"','xmlns:xls="http://www.opengis.net/xls"','xmlns:gml="http://www.opengis.net/gml"'];return e.join(" ")},schemaLocationByDefault:function(){return'xsi:schemaLocation="http://www.opengis.net/xls http://schemas.opengis.net/ols/1.2/olsAll.xsd"'},setService:function(e){e&&e instanceof r&&(this.oService=e)},getService:function(){return this.oService}},s.prototype.addNamespace=function(e,t){for(var o=e.key,r=!1,s=this.namespaceByDefault().split(" "),n=0;n])/g,u="<"+o+":$1",t=t.replace(l,u),l=/<\/(\w+[\s>])/g,u="/g,this.getService().toString())),r?(this.namespace&&(r=this.addNamespace({key:"xls",url:"http://www.opengis.net/xls"},r)),this.requestString=r,this.requestString):void 0},s}(UtilsLoggerByDefault,FormatsXLSRequestHeader,FormatsXLSRequest,FormatsXLSAbstractService),FormatsXLSLocationUtilityServiceModelAddress=function(e,t){function o(e){if(!(this instanceof o))throw new TypeError("Address constructor cannot be called as a function.");if(this.options=e||{location:{},type:["StreetAddress"],filter:{}},!e.location)throw new Error("l'option 'location' n'est pas renseignée !");for(var t in e)e.hasOwnProperty(t)&&(this.options[t]=e[t])}return o.prototype={constructor:o,requestString:null,template:{address:'
__LOCATION____PLACE____POSTALCODE____ENVELOPE__
',location:{freeFormAddress:"__FREEFORMADDRESSVALUE__",streetAddress:{container:"__STREET____BUILDING__",building:'',street:"__STREETVALUE__"}},place:'__PLACEVALUE__',postalCode:"__POSTALCODEVALUE__",envelope:"__LEFT__ __BOTTOM____RIGHT__ __TOP__"}},o.prototype.toString=function(){var e=null;if(e=this.template.address,e=e.replace(/__COUNTRYCODE__/g,this.options.type),"string"==typeof this.options.location){var t=this.template.location.freeFormAddress;t=t.replace(/__FREEFORMADDRESSVALUE__/g,this.options.location),e=e.replace(/__LOCATION__/g,t)}else{var o="",r="";this.options.location.number&&(o=this.template.location.streetAddress.building,o=o.replace(/__BUILDINGVALUE__/g,this.options.location.number)),this.options.location.street&&(r=this.template.location.streetAddress.street,r=r.replace(/__STREETVALUE__/g,this.options.location.street));var s=this.template.location.streetAddress.container;s=s.replace(/__STREET__/g,r),s=s.replace(/__BUILDING__/g,o),e=e.replace(/__LOCATION__/g,s)}var n="";this.options.location.postalCode&&(n=this.template.postalCode,n=n.replace(/__POSTALCODEVALUE__/g,this.options.location.postalCode));var i="";if(this.options.filter){var a=this.options.filter.bbox;a&&(i=this.template.envelope,i=i.replace(/__LEFT__/g,a.left),i=i.replace(/__BOTTOM__/g,a.bottom),i=i.replace(/__RIGHT__/g,a.right),i=i.replace(/__TOP__/g,a.top))}var c=[],l="";if(this.options.filter){var u=this.options.filter;for(var p in u)"bbox"!==p&&(l=this.template.place,l=l.replace(/__PLACETYPE__/g,p),l=l.replace(/__PLACEVALUE__/g,u[p]),c.push(l))}var h="";return this.options.location.city&&(h=this.template.place,h=h.replace(/__PLACETYPE__/g,"Municipality"),h=h.replace(/__PLACEVALUE__/g,this.options.location.city),c.push(h)),e=e.replace(/__POSTALCODE__/g,n),e=e.replace(/__PLACE__/g,c.join("\n")),e=e.replace(/__ENVELOPE__/g,i),this.requestString=e,this.requestString},o}(Gp,UtilsLoggerByDefault),FormatsXLSLocationUtilityServiceGeocodeFilterExtension=function(e){function t(){if(!(this instanceof t))throw new TypeError("GeocodeFilterExtension constructor cannot be called as a function.");this.filters=[]}return t.prototype={constructor:t,addFilterExtensions:function(e){e&&this.filters.push(e)},getNames:function(){var e=[];for(var t in this.filters)e.push(this.filters[t].CLASSNAME);return e},getFilter:function(e){var t=null;for(var o in this.filters)this.filters[o].CLASSNAME==e&&(t=this.filters[o]);return t},getFilters:function(){return this.filters},getAttributs:function(e){var t=[];for(var o in this.filters)this.filters[o].CLASSNAME==e&&(t=this.filters[o].attributesList);return t},setPlaceAttributs:function(e,t){var o=this.getFilter(e),r=this.getAttributs(e);for(var s in r){var n=r[s];t[n]&&(o.placeAttributes[n]=t[n])}},getPlaceAttributs:function(e){var t={};for(var o in this.filters)this.filters[o].CLASSNAME==e&&(t=this.filters[o].placeAttributes);return t}},t}(UtilsLoggerByDefault),FormatsXLSLocationUtilityServiceGeocodeRequest=function(e,t,o){function r(e){if(!(this instanceof r))throw new TypeError("GeocodeRequest constructor cannot be called as a function.");this.options=e||{};for(var t in e)e.hasOwnProperty(t)&&(this.options[t]=e[t]);this.CLASSNAME="GeocodeRequest"}return r.prototype={strRequest:null,oAddress:null,oFilter:null,template:'__ADDRESS__',addAddress:function(e){e instanceof t&&(this.oAddress=e)},addFilter:function(e){e instanceof o&&(this.oFilter=e)},constructor:r,toString:function(){var e="";if(e=this.template,!this.oAddress){var o={};if(o.location=this.options.location,o.type=this.options.filterOptions.type||["StreetAddress"],o.filter=this.options.filterOptions,delete o.filter.type,this.oFilter){o.filter={};for(var r in o.type){var s=o.type[r],n=this.oFilter.getFilter(s);if(n){for(var i=this.options.filterOptions,a=n.attributesList,c=0;c__GMLPOINT____GMLFILTER__",gml:{point:'__X__ __Y__',pos:null,filter:{bbox:'__LEFT__ __BOTTOM____RIGHT__ __TOP__',circle:'__X__ __Y____RADIUS__',polygon:'__XY__',multipolygon:null}}}},t.prototype.toString=function(){var e=this.template.position,t=this.template.gml.point;t=t.replace(/__X__/g,this.options.position.x),t=t.replace(/__Y__/g,this.options.position.y);var o="";if(this.options.filter){var r=this.options.filter;for(var s in r)switch(s){case"circle":o=this.template.gml.filter[s],o=o.replace(/__X__/g,r[s].x),o=o.replace(/__Y__/g,r[s].y),o=o.replace(/__RADIUS__/g,r[s].radius);break;case"bbox":o=this.template.gml.filter[s],o=o.replace(/__LEFT__/g,r[s].left),o=o.replace(/__BOTTOM__/g,r[s].bottom),o=o.replace(/__RIGHT__/g,r[s].right),o=o.replace(/__TOP__/g,r[s].top);break;case"polygon":o=this.template.gml.filter[s];for(var n="",i=r[s],a=0;a__TYPE__"},t.prototype.toString=function(){var e=[],t="";for(var o in this.type)t=this.template,t=t.replace(/__TYPE__/g,this.type[o]),e.push(t);return this.strRequest=e.join("\n"),this.strRequest},t}(UtilsLoggerByDefault),FormatsXLSLocationUtilityServiceReverseGeocodeRequest=function(e,t,o){function r(e){if(!(this instanceof r))throw new TypeError("ReverseGeocodeRequest constructor cannot be called as a function.");this.options=e||{};for(var t in e)e.hasOwnProperty(t)&&(this.options[t]=e[t]);this.CLASSNAME="ReverseGeocodeRequest"}return r.prototype={strRequest:null,oPosition:null,oPreference:null,constructor:r,template:'__POSITION____PREFERENCE__',addPosition:function(e){e instanceof t&&(this.oPosition=e)},addPreferences:function(e){e instanceof o&&(this.oPreference=e)},toString:function(){var e="";if(e=this.template,!this.oPreference&&(this.oPreference=new o(this.options.filterOptions.type||["StreetAddress"]),!this.oPreference))throw new Error("Les preferences ne sont pas definies !?");if(e=e.replace(/__PREFERENCE__/g,this.oPreference.toString()),!this.oPosition){var r={position:this.options.position,filter:{}};if(this.options.filterOptions&&(r.filter=this.options.filterOptions,delete r.filter.type),this.oPosition=new t(r),!this.oPosition)throw new Error("La position et ses filtres ne sont pas definis !?")}return e=e.replace(/__POSITION__/g,this.oPosition.toString()),e=e.replace(/__RETURNFREEFORM__/g,this.options.returnFreeForm?"true":"false"),this.strRequest=e,this.strRequest}},r}(UtilsLoggerByDefault,FormatsXLSLocationUtilityServiceModelPosition,FormatsXLSLocationUtilityServiceModelPreference),FormatsXLSLocationUtilityService=function(e,t,o,r,s){function n(e){if(!(this instanceof n))throw new TypeError("LocationUtilityService constructor cannot be called as a function.");this.CLASSNAME="LocationUtilityService",this.CLASSTYPE=null,t.apply(this,arguments),this.options&&(this.CLASSTYPE=this.options.location?"GeocodeRequest":this.options.position?"ReverseGeocodeRequest":null)}return n.prototype=Object.create(t.prototype,{}),n.prototype.constructor=n,n.prototype.addRequest=function(e){switch(this.CLASSTYPE=e.CLASSNAME,this.CLASSTYPE){case"GeocodeRequest":case"ReverseGeocodeRequest":this.oRequest=e;break;default:throw new Error("Ce n'est pas un objet de type 'LUS Request' !?")}},n.prototype.addFilter=function(e){e instanceof s&&(this.oFilter=e)},n.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 e={location:this.options.location,returnFreeForm:this.options.returnFreeForm,filterOptions:this.options.filterOptions||{}};this.oRequest=new o(e),this.oFilter&&this.oRequest.addFilter(this.oFilter)}else if("ReverseGeocodeRequest"===this.CLASSTYPE){var t={position:this.options.position,returnFreeForm:this.options.returnFreeForm,filterOptions:this.options.filterOptions||{}};this.oRequest=new r(t)}}if(!this.oRequest)throw new Error("Type de Geocodage indefini !");return this.strRequest=this.oRequest.toString(),this.strRequest},n}(UtilsLoggerByDefault,FormatsXLSAbstractService,FormatsXLSLocationUtilityServiceGeocodeRequest,FormatsXLSLocationUtilityServiceReverseGeocodeRequest,FormatsXLSLocationUtilityServiceGeocodeFilterExtension),ServicesGeocodeRequestGeocodeLocation=function(){function e(){if(!(this instanceof e))throw new TypeError("GeocodeLocation constructor cannot be called as a function.");this.placeAttributes={},this.attributesList=[],this.serviceAttributes=[]}return e.prototype={constructor:e},e}(),ServicesGeocodeRequestModelStreetAddress=function(e){function t(){if(!(this instanceof t))throw new TypeError("StreetAddress constructor cannot be called as a function.");e.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 t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t}(ServicesGeocodeRequestGeocodeLocation),ServicesGeocodeRequestModelPositionOfInterest=function(e){function t(){if(!(this instanceof t))throw new TypeError("PositionOfInterest constructor cannot be called as a function.");e.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 t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t}(ServicesGeocodeRequestGeocodeLocation),ServicesGeocodeRequestModelCadastralParcel=function(e){function t(){if(!(this instanceof t))throw new TypeError("CadastralParcel constructor cannot be called as a function.");e.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 t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t}(ServicesGeocodeRequestGeocodeLocation),ServicesGeocodeRequestModelAdministratif=function(e){function t(){if(!(this instanceof t))throw new TypeError("Administratif constructor cannot be called as a function.");e.apply(this,arguments),this.CLASSNAME="Administratif",this.attributesList=["bbox","prefecture","inseeRegion","inseeDepartment","municipality"],this.serviceAttributes=["bbox","Prefecture","InseeRegion","InseeDepartement","Municipality"]}return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t}(ServicesGeocodeRequestGeocodeLocation),ServicesGeocodeRequestDirectGeocodeRequestFactory=function(e,t,o,r,s,n,i,a){var c={build:function(e){var c=null,l=new r;l.addFilterExtensions(new a),l.addFilterExtensions(new s),l.addFilterExtensions(new n),l.addFilterExtensions(new i);var u=new o({location:e.location,returnFreeForm:e.returnFreeForm,filterOptions:e.filterOptions});u.addFilter(l);var p=new t({srsName:e.srs,maximumResponses:e.maximumResponses});if(p.namespace=!0,p.setService(u),c=p.build(),"GET"==e.httpMethod){var h="qxml="+encodeURIComponent(c).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");c=h}return c}};return c}(UtilsLoggerByDefault,FormatsXLS,FormatsXLSLocationUtilityService,FormatsXLSLocationUtilityServiceGeocodeFilterExtension,ServicesGeocodeRequestModelStreetAddress,ServicesGeocodeRequestModelPositionOfInterest,ServicesGeocodeRequestModelCadastralParcel,ServicesGeocodeRequestModelAdministratif),ServicesGeocodeResponseModelGeocodeResponse=function(){function e(){if(!(this instanceof e))throw new TypeError("GeocodeResponse constructor cannot be called as a function.");this.locations=[]}return e.prototype={constructor:e},e}(),ServicesGeocodeResponseModelGeocodedLocation=function(){function e(){if(!(this instanceof e))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 e.prototype={constructor:e},e}(),ServicesGeocodeResponseModelDirectGeocodedLocation=function(e){function t(){if(!(this instanceof t))throw new TypeError("DirectGeocodedLocation constructor cannot be called as a function.");e.apply(this,arguments),this.CLASSNAME="DirectGeocodedLocation",this.accuracy=null}return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t}(ServicesGeocodeResponseModelGeocodedLocation),ServicesGeocodeFormatsDirectGeocodeResponseReader=function(e,t,o,r,s){function n(e){if(e.attributes.length>0){for(var t={},o=e.attributes,r=0;r0){var t=n(e);for(var o in t)if(t.hasOwnProperty(o)){if("version"===o&&t.version!==l.VERSION)return void console.log("[DirectGeocodeResponseReader] geocode version is not the expected one : there may be errors in parsing");if("xmlns"===o){if(t[o]!==l.NAMESPACES[l.DEFAULTPREFIX])return void console.log("[DirectGeocodeResponseReader] geocode response default namespace is not the expected one");continue}var r=o.split(":")[0],s=o.split(":")[1];if("xmlns"===r&&s&&l.NAMESPACES[s]&&l.NAMESPACES[s]!==t[o])return void console.log("[DirectGeocodeResponseReader] geocode response "+o+" namespace is not the expected one");if("schemaLocation"===s&&l.SCHEMALOCATION!==t[o])return void console.log("[DirectGeocodeResponseReader] geocode response schema location is not the expected one")}}}var l={};return l.VERSION="1.2",l.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"},l.SCHEMALOCATION="http://wxs.ign.fr/schemas/olsAll.xsd",l.DEFAULTPREFIX="xls",l.READERS={xls:{XLS:function(e){var t=new r;return c(e),i(e,t),t},GeocodedAddress:function(e,t){var o=new s;i(e,o),t&&Array.isArray(t.locations)&&t.locations.push(o)},GeocodeMatchCode:function(e,t){var o=e.getAttribute("accuracy");o&&t&&(t.accuracy=parseFloat(o));var r=e.getAttribute("matchType");r&&t&&(t.matchType=r)},Address:function(e,t){var o=e.getAttribute("countryCode");t&&o&&(t.type=o),i(e,t)},freeFormAddress:function(e,t){t&&t.hasOwnProperty("placeAttributes")&&(t.placeAttributes.freeform=a(e))},Building:function(e,t){var o=e.getAttribute("number");t&&t.hasOwnProperty("placeAttributes")&&(o?t.placeAttributes.number=o:e.getAttribute("buildingName")?t.placeAttributes.number=e.getAttribute("buildingName"):e.getAttribute("subdivision")&&(t.placeAttributes.number=e.getAttribute("subdivision")))},Street:function(e,t){t&&t.hasOwnProperty("placeAttributes")&&("StreetAddress"===t.type?t.placeAttributes.street=a(e):"CadastralParcel"===t.type&&(t.placeAttributes.cadastralParcel=a(e)))},Place:function(e,t){var o=e.getAttribute("type"),r=a(e);if(t&&t.hasOwnProperty("placeAttributes"))if("Municipality"===o)t.placeAttributes.municipality=r;else if("Bbox"===o){var s=r.split(";");4===s.length&&(t.placeAttributes.bbox={left:parseFloat(s[0]),right:parseFloat(s[2]),top:parseFloat(s[1]),bottom:parseFloat(s[3])})}else"Commune"===o?t.placeAttributes.commune=r:"Departement"===o?t.placeAttributes.department=r:"INSEE"===o?t.placeAttributes.insee=r:"Qualite"===o?t.placeAttributes.quality=r:"Territoire"===o?t.placeAttributes.territory=r:"ID"===o?t.placeAttributes.ID=r:"ID_TR"===o?t.placeAttributes.IDTR=r:"Importance"===o?t.placeAttributes.importance=parseInt(r,10):"Nature"===o?t.placeAttributes.nature=r:"Numero"===o?t.placeAttributes.number=r:"Feuille"===o?t.placeAttributes.sheet=r:"Section"===o?t.placeAttributes.section=r:"CommuneAbsorbee"===o?t.placeAttributes.absorbedCity=r:"Arrondissement"===o?r&&(t.placeAttributes.arrondissement=r):"Type"===o?t.placeAttributes.origin=r:"Prefecture"===o?t.placeAttributes.prefecture=r:"InseeRegion"===o?t.placeAttributes.inseeRegion=r:"InseeDepartment"===o&&(t.placeAttributes.inseeDepartment=r)},PostalCode:function(e,t){t&&t.hasOwnProperty("placeAttributes")&&(t.placeAttributes.postalCode=a(e))},Error:function(e){var r=e.getAttribute("message"),s=e.getAttribute("errorCode"),n=t.getMessage("SERVICE_RESPONSE_EXCEPTION","("+s+") : "+r);throw new o({message:n,type:o.TYPE_SRVERR})}},gml:{pos:function(e,t){var o=a(e);t&&o&&(t.position={x:parseFloat(o.split(" ")[0]),y:parseFloat(o.split(" ")[1])})}},ExceptionReport:function(e){var t={};if(e.hasChildNodes())for(var o,r=e.childNodes,s=0;s0){for(var t={},o=e.attributes,r=0;r0){var t=n(e);for(var o in t)if(t.hasOwnProperty(o)){if("version"===o&&t.version!==l.VERSION)return void console.log("[ReverseGeocodeResponseReader] geocode version is not the expected one : there may be errors in parsing");if("xmlns"===o){if(t[o]!==l.NAMESPACES[l.DEFAULTPREFIX])return void console.log("[ReverseGeocodeResponseReader] geocode response default namespace is not the expected one");continue}var r=o.split(":")[0],s=o.split(":")[1];if("xmlns"===r&&s&&l.NAMESPACES[s]&&l.NAMESPACES[s]!==t[o])return void console.log("[ReverseGeocodeResponseReader] geocode response "+o+" namespace is not the expected one");if("schemaLocation"===s&&l.SCHEMALOCATION!==t[o])return void console.log("[ReverseGeocodeResponseReader] geocode response schema location is not the expected one")}}}var l={};return l.VERSION="1.2",l.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"},l.SCHEMALOCATION="http://wxs.ign.fr/schemas/olsAll.xsd",l.DEFAULTPREFIX="xls",l.READERS={xls:{XLS:function(e){var t=new r;return c(e),i(e,t),t},ReverseGeocodedLocation:function(e,t){var o=new s;i(e,o),t&&Array.isArray(t.locations)&&t.locations.push(o)},Address:function(e,t){var o=e.getAttribute("countryCode");t&&o&&(t.type=o),i(e,t)},Building:function(e,t){var o=e.getAttribute("number");t&&t.hasOwnProperty("placeAttributes")&&(o?t.placeAttributes.number=o:e.getAttribute("buildingName")?t.placeAttributes.number=e.getAttribute("buildingName"):e.getAttribute("subdivision")&&(t.placeAttributes.number=e.getAttribute("subdivision")))},Street:function(e,t){"StreetAddress"===t.type?t.placeAttributes.street=a(e):"CadastralParcel"===t.type&&(t.placeAttributes.cadastralParcel=a(e))},Place:function(e,t){var o=e.getAttribute("type"),r=a(e);if(t&&t.hasOwnProperty("placeAttributes"))if("Municipality"===o)t.placeAttributes.municipality=r;else if("Bbox"===o){var s=r.split(";");4===s.length&&(t.placeAttributes.bbox={left:parseFloat(s[0]),right:parseFloat(s[2]),top:parseFloat(s[1]),bottom:parseFloat(s[3])})}else"Commune"===o?t.placeAttributes.commune=r:"Departement"===o?t.placeAttributes.department=r:"INSEE"===o?t.placeAttributes.insee=r:"Qualite"===o?t.placeAttributes.quality=r:"Territoire"===o?t.placeAttributes.territory=r:"ID"===o?t.placeAttributes.ID=r:"ID_TR"===o?t.placeAttributes.IDTR=r:"Importance"===o?t.placeAttributes.importance=parseInt(r,10):"Nature"===o?t.placeAttributes.nature=r:"Numero"===o?t.placeAttributes.number=r:"Feuille"===o?t.placeAttributes.sheet=r:"Section"===o?t.placeAttributes.section=r:"CommuneAbsorbee"===o?t.placeAttributes.absorbedCity=r:"Arrondissement"===o?r&&(t.placeAttributes.arrondissement=r):"Type"===o?t.placeAttributes.origin=r:"Prefecture"===o?t.placeAttributes.prefecture=r:"InseeRegion"===o?t.placeAttributes.inseeRegion=r:"InseeDepartment"===o&&(t.placeAttributes.inseeDepartment=r)},PostalCode:function(e,t){t&&t.hasOwnProperty("placeAttributes")&&(t.placeAttributes.postalCode=a(e))},SearchCentreDistance:function(e,t){t&&(t.searchCenterDistance=parseFloat(e.getAttribute("value")))},Error:function(e){var r=e.getAttribute("message"),s=e.getAttribute("errorCode"),n=t.getMessage("SERVICE_RESPONSE_EXCEPTION","("+s+") : "+r);throw new o({message:n,type:o.TYPE_SRVERR})}},gml:{pos:function(e,t){var o=a(e);t&&o&&(t.position={x:parseFloat(o.split(" ")[0]),y:parseFloat(o.split(" ")[1])})}},xlsext:{ExtendedGeocodeMatchCode:function(e,t){t&&(t.matchType=a(e))}},ExceptionReport:function(e){var t={};if(e.hasChildNodes())for(var o,r=e.childNodes,s=0;s__ROUTEPREFERENCE____GRAPH____WAYPOINTLIST____AVOIDLIST__",routePreference:"__VALUEROUTEPREFERENCE__",graph:'',wayPointList:{container:"__STARTPOINT____VIAPOINT____ENDPOINT__",point:'__X__ __Y__',startPoint:"__POINT__",endPoint:"__POINT__",viaPoint:"__POINT__"},avoidList:{container:"__AVOIDFEATURE__",avoidFeature:"__VALUEAVOIDFEATURE__"}},toString:function(){var e="";if(e=this.template.routePlan,this.options.routePreference){var t=this.template.routePreference;t=t.replace(/__VALUEROUTEPREFERENCE__/,this.options.routePreference),e=e.replace(/__ROUTEPREFERENCE__/g,t)}if(e=e.replace(/__ROUTEPREFERENCE__/g,""),this.options.avoidFeature){for(var o=this.template.avoidList.container,r=[],s=0;s__ROUTEPLAN____ROUTEINSTRUCTIONREQUEST____ROUTEGEOMETRYREQUEST____ROUTEMAPREQUEST__',routeInstructionRequest:'',routeGeometryRequest:"",routeMapRequest:""},addRoute:function(e){e instanceof t&&(this.oRoutePlan=e)},constructor:o,toString:function(){var e="";if(e=this.template.determineRouteRequest,e=e.replace(/__DISTANCEUNIT__/g,this.options.distanceUnit||"KM"),!this.oRoutePlan){var o=this.options.route;if(this.oRoutePlan=new t(o),!this.oRoutePlan)throw new Error("La construction du calcul d'initineraire n'est pas correctement definie !?")}e=e.replace(/__ROUTEPLAN__/g,this.oRoutePlan.toString());var r=this.template.routeInstructionRequest;r=r.replace(/__PROVIDEGEOMETRY__/g,this.options.provideGeometry||!1),r=r.replace(/__PROVIDEBBOX__/g,this.options.provideBoundingBox||!1),e=e.replace(/__ROUTEINSTRUCTIONREQUEST__/g,r);var s=this.template.routeGeometryRequest;e=e.replace(/__ROUTEGEOMETRYREQUEST__/g,s);var n=this.template.routeMapRequest;return e=e.replace(/__ROUTEMAPREQUEST__/g,n),this.strRequest=e,this.strRequest}},o}(UtilsLoggerByDefault,FormatsXLSRouteServiceModelRoutePlan),FormatsXLSRouteServiceRouteRequestExtension=void 0,FormatsXLSRouteService=function(e,t,o,r){function s(e){if(!(this instanceof s))throw new TypeError("RouteService constructor cannot be called as a function.");this.CLASSNAME="RouteService",this.CLASSTYPE="RouteRequest",t.apply(this,arguments)}return s.prototype=Object.create(t.prototype,{}),s.prototype.constructor=s,s.prototype.addRequest=function(e){if("DetermineRouteRequest"!==e.CLASSNAME)throw new Error("Ce n'est pas un objet de type 'Route Request' !?");this.oRequest=e},s.prototype.addFilter=function(e){e instanceof r&&(this.oFilter=e)},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("RouteRequest"===this.CLASSTYPE){var e={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 o(e),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},s}(UtilsLoggerByDefault,FormatsXLSAbstractService,FormatsXLSRouteServiceDetermineRouteRequest,FormatsXLSRouteServiceRouteRequestExtension),ServicesRouteRequestRouteRequestOLS=function(e,t,o){var r={build:function(e){var r=null,s={startPoint:e.startPoint,endPoint:e.endPoint,viaPoint:e.viaPoints,provideBoundingBox:e.provideBbox,avoidFeature:e.exclusions,expectedStartTime:e.expectedStartTime,distanceUnit:e.distanceUnit,graph:e.graph,provideGeometry:e.geometryInInstructions,routePreference:e.routePreference},n=new o(s),i=new t({srsName:e.srs,maximumResponses:e.maximumResponses});if(i.namespace=!0,i.setService(n),r=i.build(),"GET"==e.httpMethod){var a="qxml="+encodeURIComponent(r).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");r=a}return r}};return r}(UtilsLoggerByDefault,FormatsXLS,FormatsXLSRouteService),ServicesRouteRequestModelRouteParamREST=function(e){function t(e){if(!(this instanceof t))throw new TypeError("RouteParamREST constructor cannot be called as a function.");if(this.options=e||{},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 o=this.options.routePreference;switch(o){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 t.CLASSNAME="RouteParamREST",t.prototype={constructor:t,getWaypoints:function(){if(this.waypoints){for(var e=[],t=0;t\n\n__ID__ \n __X__\n __Y__\n \n __SRS__\n __GRAPHNAME__\n__PROFIL____EXCLUSIONS__ __METHOD__\n__TIME____DISTANCE__ __REVERSE__\n __SMOOTHING__\n __HOLES__\n',id:" __IDVALUE__\n",profil:" __PROFILID__\n __PROFILNAME__\n",exclusions:{container:" \n__EXCLUSIONFEATURE__\n \n",feature:" __EXCLUSIONVALUE__"},time:" \n",distance:" __DISTANCEVALUE__\n"},processRequestString:function(){var e="";switch(this.mode){case"GET":var t=new o(this.settings),r=t.getParams();for(var s in r)e&&(e+="&"),e+=r[s].k+"="+r[s].v;break;case"POST":if(e=this.template.container,e=e.replace(/__ID__/g,""),e=e.replace(/__PROFIL__/g,""),e=e.replace(/__X__/g,this.settings.position.x),e=e.replace(/__Y__/g,this.settings.position.y),e=e.replace(/__GRAPHNAME__/g,this.settings.graph),e=e.replace(/__SRS__/g,this.settings.srs),e=e.replace(/__SMOOTHING__/g,this.settings.smoothing),e=e.replace(/__HOLES__/g,this.settings.holes),e=e.replace(/__REVERSE__/g,this.settings.reverse),this.settings.exclusions){for(var n=this.template.exclusions.container,i=[],a=0;an;n++){"undefined"==typeof s[r[n]]&&(s[r[n]]={});var i=o-1;n===i&&(s[r[n]]=t),s=s[r[n]]}return this}};return C.extend("Services",e),C.extend("Services.AltiResponse",t),C.extend("Services.Alti.Elevation",o),C.extend("Services.AutoCompleteResponse",r),C.extend("Services.AutoComplete.SuggestedLocation",s),C.extend("Services.GetConfigResponse",n),C.extend("Services.Config.Constraint",i),C.extend("Services.Config.Format",a),C.extend("Services.Config.Layer",c),C.extend("Services.Config.Legend",l),C.extend("Services.Config.Metadata",u),C.extend("Services.Config.Originator",p),C.extend("Services.Config.Service",h),C.extend("Services.Config.Style",f),C.extend("Services.Config.Territory",d),C.extend("Services.Config.Thematic",s),C.extend("Services.Config.TileMatrix",m),C.extend("Services.Config.TileMatrixLimit",R),C.extend("Services.Config.TileMatrixSet",v),C.extend("Services.GeocodeResponse",S),C.extend("Services.Geocode.GeocodedLocation",E),C.extend("Services.Geocode.DirectGeocodedLocation",_),C.extend("Services.Geocode.ReverseGeocodedLocation",y),C.extend("Services.IsoCurveResponse",w),C.extend("Services.RouteResponse",A),C.extend("Services.Route.RouteInstruction",P),C.extend("Error",T),M.Gp=C,M.Gp}(ServicesServices,ServicesAltiResponseModelAltiResponse,ServicesAltiResponseModelElevation,ServicesAutoCompleteResponseModelAutoCompleteResponse,ServicesAutoCompleteResponseModelSuggestedLocation,ServicesAutoConfResponseModelAutoConfResponse,ServicesAutoConfResponseModelConstraint,ServicesAutoConfResponseModelFormat,ServicesAutoConfResponseModelLayer,ServicesAutoConfResponseModelLegend,ServicesAutoConfResponseModelMetadata,ServicesAutoConfResponseModelOriginator,ServicesAutoConfResponseModelService,ServicesAutoConfResponseModelStyle,ServicesAutoConfResponseModelTerritory,ServicesAutoConfResponseModelThematic,ServicesAutoConfResponseModelTileMatrix,ServicesAutoConfResponseModelTileMatrixLimit,ServicesAutoConfResponseModelTileMatrixSet,ServicesGeocodeResponseModelGeocodeResponse,ServicesGeocodeResponseModelGeocodedLocation,ServicesGeocodeResponseModelDirectGeocodedLocation,ServicesGeocodeResponseModelReverseGeocodedLocation,ServicesProcessIsoCurveResponseModelProcessIsoCurveResponse,ServicesRouteResponseModelRouteResponse,ServicesRouteResponseModelRouteInstruction,ExceptionsErrorService); +if(null==e.endPoint.x)throw new Error(t.getMessage("PARAM_MISSING","endPoint.x"));if(null==e.endPoint.y)throw new Error(t.getMessage("PARAM_MISSING","endPoint.y"));if(this.options.api="string"==typeof e.api?e.api.toUpperCase():"REST",this.options.outputFormat="string"==typeof e.outputFormat?e.outputFormat.toLowerCase():"json",this.options.startPoint=e.startPoint,this.options.endPoint=e.endPoint,this.options.viaPoints=e.viaPoints||null,this.options.exclusions=e.exclusions||null,this.options.routePreference=e.routePreference||"fastest",this.options.graph=e.graph||"Voiture",this.options.geometryInInstructions=e.geometryInInstructions||!1,this.options.provideBbox=e.provideBbox||!0,this.options.distanceUnit=e.distanceUnit||"km",this.options.expectedStartTime=null,this.options.srs=e.srs||"EPSG:4326",this.options.api="REST","XHR"===this.options.protocol&&(this.options.httpMethod="GET"),!this.options.serverUrl){var o=s.Route.url(this.options.apiKey),n=null;switch(this.options.api){case"OLS":n=o.ols;break;case"REST":var i="route-"+this.options.outputFormat;n=o[i];break;default:throw new Error(t.getMessage("PARAM_UNKNOWN","api"))}if(!n)throw new Error("Url by default not found !");this.options.serverUrl=n}var c=this.options.serverUrl.lastIndexOf(".");if(-1!==c){var l=this.options.serverUrl.substring(c+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(r.prototype,{}),a.prototype.constructor=a,a.prototype.buildRequest=function(e,r){var s={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=n.build(s),this.request?r.call(this,this.request):e.call(this,new o(t.getMessage("SERVICE_REQUEST_BUILD")))},a.prototype.analyzeResponse=function(e,r){if(this.response){var s={distanceUnit:this.options.distanceUnit,response:this.response,outputFormat:this.options.outputFormat,api:this.options.api,rawResponse:this.options.rawResponse,onError:e,onSuccess:r,scope:this};i.build(s)}else e.call(this,new o(t.getMessage("SERVICE_RESPONSE_EMPTY")))},a}(UtilsLoggerByDefault,UtilsMessagesResources,ExceptionsErrorService,ServicesCommonService,ServicesDefaultUrlService,ServicesRouteRequestRouteRequestFactory,ServicesRouteResponseRouteResponseFactory),ServicesProcessIsoCurveRequestModelProcessIsoCurveParam=function(e){function t(e){if(!(this instanceof t))throw new TypeError("ProcessIsoCurveParam constructor cannot be called as a function.");this.options=e||{},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 o=this.options.method;switch(o){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 t.CLASSNAME="ProcessIsoCurveParam",t.prototype={constructor:t,getLocation:function(){return this.location.x+","+this.location.y},getExclusions:function(){return this.exclusions.join(";")}},t.prototype.getParams=function(){var e=[];return e.push({k:"location",v:this.getLocation()}),e.push({k:"smoothing",v:this.smoothing}),e.push({k:"holes",v:this.holes}),e.push({k:"reverse",v:this.reverse}),e.push({k:"method",v:this.method}),this.time&&e.push({k:"time",v:this.time}),this.distance&&e.push({k:"distance",v:this.distance}),e.push({k:"graphName",v:this.graphName}),this.exclusions&&e.push({k:"exclusions",v:this.getExclusions()}),this.srs&&e.push({k:"srs",v:this.srs}),e},t}(UtilsLoggerByDefault),ServicesProcessIsoCurveRequestProcessIsoCurveRequest=function(e,t,o){function r(e){if(!(this instanceof r))throw new TypeError("ProcessIsoCurveRequest constructor cannot be called as a function.");if(!e)throw new Error(t.getMessage("PARAM_EMPTY","options"));this.settings=e,this.mode=this.settings.httpMethod||"GET"}return r.prototype={requestString:null,constructor:r,template:{container:'\n\n__ID__ \n __X__\n __Y__\n \n __SRS__\n __GRAPHNAME__\n__PROFIL____EXCLUSIONS__ __METHOD__\n__TIME____DISTANCE__ __REVERSE__\n __SMOOTHING__\n __HOLES__\n',id:" __IDVALUE__\n",profil:" __PROFILID__\n __PROFILNAME__\n",exclusions:{container:" \n__EXCLUSIONFEATURE__\n \n",feature:" __EXCLUSIONVALUE__"},time:" \n",distance:" __DISTANCEVALUE__\n"},processRequestString:function(){var e="";switch(this.mode){case"GET":var t=new o(this.settings),r=t.getParams();for(var s in r)e&&(e+="&"),e+=r[s].k+"="+r[s].v;break;case"POST":if(e=this.template.container,e=e.replace(/__ID__/g,""),e=e.replace(/__PROFIL__/g,""),e=e.replace(/__X__/g,this.settings.position.x),e=e.replace(/__Y__/g,this.settings.position.y),e=e.replace(/__GRAPHNAME__/g,this.settings.graph),e=e.replace(/__SRS__/g,this.settings.srs),e=e.replace(/__SMOOTHING__/g,this.settings.smoothing),e=e.replace(/__HOLES__/g,this.settings.holes),e=e.replace(/__REVERSE__/g,this.settings.reverse),this.settings.exclusions){for(var n=this.template.exclusions.container,i=[],a=0;an;n++){"undefined"==typeof s[r[n]]&&(s[r[n]]={});var i=o-1;n===i&&(s[r[n]]=t),s=s[r[n]]}return this}};return O.extend("Protocols",{}),O.extend("Protocols.XHR",e),O.extend("Services",t),O.extend("Services.AltiResponse",o),O.extend("Services.Alti.Elevation",r),O.extend("Services.AutoCompleteResponse",s),O.extend("Services.AutoComplete.SuggestedLocation",n),O.extend("Services.GetConfigResponse",i),O.extend("Services.Config.Constraint",a),O.extend("Services.Config.Format",c),O.extend("Services.Config.Layer",l),O.extend("Services.Config.Legend",u),O.extend("Services.Config.Metadata",p),O.extend("Services.Config.Originator",h),O.extend("Services.Config.Service",f),O.extend("Services.Config.Style",d),O.extend("Services.Config.Territory",g),O.extend("Services.Config.Thematic",n),O.extend("Services.Config.TileMatrix",R),O.extend("Services.Config.TileMatrixLimit",v),O.extend("Services.Config.TileMatrixSet",S),O.extend("Services.GeocodeResponse",E),O.extend("Services.Geocode.GeocodedLocation",_),O.extend("Services.Geocode.DirectGeocodedLocation",y),O.extend("Services.Geocode.ReverseGeocodedLocation",w),O.extend("Services.IsoCurveResponse",A),O.extend("Services.RouteResponse",P),O.extend("Services.Route.RouteInstruction",T),O.extend("Error",M),C.Gp=O,C.Gp}(ProtocolsXHR,ServicesServices,ServicesAltiResponseModelAltiResponse,ServicesAltiResponseModelElevation,ServicesAutoCompleteResponseModelAutoCompleteResponse,ServicesAutoCompleteResponseModelSuggestedLocation,ServicesAutoConfResponseModelAutoConfResponse,ServicesAutoConfResponseModelConstraint,ServicesAutoConfResponseModelFormat,ServicesAutoConfResponseModelLayer,ServicesAutoConfResponseModelLegend,ServicesAutoConfResponseModelMetadata,ServicesAutoConfResponseModelOriginator,ServicesAutoConfResponseModelService,ServicesAutoConfResponseModelStyle,ServicesAutoConfResponseModelTerritory,ServicesAutoConfResponseModelThematic,ServicesAutoConfResponseModelTileMatrix,ServicesAutoConfResponseModelTileMatrixLimit,ServicesAutoConfResponseModelTileMatrixSet,ServicesGeocodeResponseModelGeocodeResponse,ServicesGeocodeResponseModelGeocodedLocation,ServicesGeocodeResponseModelDirectGeocodedLocation,ServicesGeocodeResponseModelReverseGeocodedLocation,ServicesProcessIsoCurveResponseModelProcessIsoCurveResponse,ServicesRouteResponseModelRouteResponse,ServicesRouteResponseModelRouteInstruction,ExceptionsErrorService); return Gp; })); diff --git a/src/Gp.js b/src/Gp.js index 1702e235..ff4c43a5 100644 --- a/src/Gp.js +++ b/src/Gp.js @@ -1,4 +1,7 @@ define([ + // Protocols + "Protocols/XHR", + // Services "Services/Services", // Alti Rseponses "Services/Alti/Response/model/AltiResponse", @@ -36,6 +39,9 @@ define([ ], function ( + // XHR stuff + XHR, + // Services Services, // Alti Responses AltiResponse, Elevation, @@ -97,6 +103,8 @@ define([ }; // on declare les ns dan root global + Gp.extend("Protocols", {}); + Gp.extend("Protocols.XHR", XHR); Gp.extend("Services", Services); // Export Alti Gp.extend("Services.AltiResponse", AltiResponse);