Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | 2x 2x 2x 2x 2x 1x 2x 2x 2x 2x 2x 16x 16x 14x 16x 2x 2x 2x | import Logger from "../../../Utils/LoggerByDefault"; import _ from "../../../Utils/MessagesResources"; import RouteParamREST from "./model/RouteParamREST"; /** * @classdesc * Classe de gestion des requêtes de type REST sur le service de calcul d'itineraire * (uniquement en GET) * * @constructor * @alias Gp.Services.Route.Request.RouteRequestREST * @param {Object} options - options definies dans le composant Route * * @example * var options = { * (...) * }; * * @private */ function RouteRequestREST (options) { this.logger = Logger.getLogger("RouteRequestREST"); this.logger.trace("[Constructeur RouteRequestREST ()]"); Iif (!(this instanceof RouteRequestREST)) { throw new TypeError("RouteRequestREST constructor cannot be called as a function."); } // existance des options Iif (!options) { throw new Error(_.getMessage("PARAM_EMPTY", "options")); } /** liste des options */ this.settings = options; } RouteRequestREST.prototype = { /** * @lends module:RouteRequestREST# */ /** * request * @type {String} */ requestString : null, /** * Constructeur (alias) */ constructor : RouteRequestREST, /** * Construction de la requête. * * @example * // GET out : origin=2.416907353809513,48.8465772142297&destination=2.4248037771493673,48.84591353161838 * // POST out : Not yet supported method POST ! * @returns {String} request */ processRequestString : function () { // INFO // construction simple sans template..., // mais en attendant que les services soient fixés, on taggue ce composant en mode PROTOTYPE ! this.logger.warn(" PROTOTYPE !"); // Mapping des options avec le service de l'API REST var oParams = new RouteParamREST(this.settings); var params = oParams.getParams(); var request = ""; for (var i = 0; i < params.length; i++) { var o = params[i]; if (request) { request += "&"; } request += o.k + "=" + o.v; } // Exemple : // http://wxs.ign.fr/KEY/itineraire/rest/route.json? // origin=& // destination=& // waypoints=& // method=DISTANCE& // graph=Pieton& // graphName=Pieton& // exclusions=& // tolerance=10& // srs= this.logger.trace(request); this.requestString = request; return this.requestString; } }; export default RouteRequestREST; |