Tagged: 

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #10459

    Michel Castaño
    Keymaster

    1. Organize your points starting with departure point, ending with arrival point and with checkpoints in between as in the example below:

     

    2. Send them to google API to obtain a polyline between them:
    https://maps.googleapis.com/maps/api/js/DirectionsService.Route?5m4&1m3&1m2&1d-33.3089255&2d-70.7204965&5m4&1m3&1m2&1d-33.562885&2d-70.624062&5m4&1m3&1m2&1d-33.567043&2d-70.672501&5m4&1m3&1m2&1d-33.526806&2d-70.610039&5m4&1m3&1m2&1d-33.594982&2d-70.70269&5m4&1m3&1m2&1d-33.585438&2d-70.628098&5m4&1m3&1m2&1d-33.596413&2d-70.705208&5m4&1m3&1m2&1d-33.51741&2d-70.681351&5m4&1m3&1m2&1d-33.515694&2d-70.658295&5m4&1m3&1m2&1d-33.615452&2d-70.70726&5m4&1m3&1m2&1d-33.53669&2d-70.664352&5m4&1m3&1m2&1d-33.499542&2d-70.688522&5m4&1m3&1m2&1d-33.545845&2d-70.64592&5m4&1m3&1m2&1d-33.4102076&2d-70.5709049&6e0&8b0&12sen-US&23e1&callback=_xdc_._5k7kiu&key=AIzaSyCLxGH4wE1TwxdiLTGnssqi0WRGZml0a8w&token=204

     

    3. Obtain the polyline from the response to the GET above:
    “overview_polyline” : {
    “points” : “rshjEdrsnLnHhW_UbNul@zRc@wDlEpIcFbAbR{KhuBkt@hvCubAxmC}~@tt@iXlRqFHnDzWtLvXrK|[rK|HyCtkAqf@nu@{Nz@eCby@hG|nAe@dc@Trl@_OzZkGni@Sv^iAbPaJrNoCrf@fMdsCtcAhg@SxSlHzJhHkCw@nHqVnYcb@ze@grAv\\y~AxRuwAdOekBfCiDpI_At[_Dly@}KxD}@eCeRoAmKNaLdJoApKqAjA|LvOe@bAWwE|s@iMfmBiIpeAaBvQBlJbp@zK}xAoXci@wIdAgPuFk@iVyFiNgBuLsEvB{UpAkOjLotAHsjAaFuu@{Foq@m_@eYuj@a\\}@wOfAbLaGfLkG~LfABEfGzBdClTVnUZz\\vBnJlN~KdvAaCv|@gKdvA{^dCcUt|@k@uAOnEv_@rOVxSliAb{BdMlKp\\t@hpCvVfNnClCyAjOupAVwBvGkAjHvAdIpBs@nGuTiFyBeIl@}El@iFvEsWtCcSdCqq@cCyKnDuLhIwl@fOy_ChEqrAnCsw@bFeE~MOhCk@iVL_X@mAmQmAcVe@eIsDgBi@fB_Pr@yLhAt@jLzDk@dcAgFLg@bHOG|Do@tQu@dTi@vOu@|TwApd@_Ln|B{PjnAn@vg@sHdl@mFt^{BlJjVzFrNnDvGBaAbG_AnGyEmAaJ{BeMsCsKwCuGlVoIbk@yAuCe|BySgVi[aXog@{k@agAanAwl@oa@eQoMoF{IbMgJvRvCiLhP{Qif@wSwOeHxGe\\vIaa@rDwOyKmB_G~J{Gj\\uEpTnCnG{@zEv@dF|FtBpK|Drt@nX~l@jV|}@|_@vlAlwBvNvYdVnCtzBzQfbCbQ|a@zBxXw@xGuCjNeD|@eWvCuJbCyJ_BxF{DlNAdBuBvWai@xBqaBgH}sCaTq{@wHyQkOi_@ms@mi@{dAkR{Nuj@iV{L}FvJod@fFhArIk@tHi\\|AWmA~LmEnU_ZppAsl@~xA{SxXsL|Cgh@gQwr@g\\sEgBvBeJb@eMcRkHbVhJJnDvEc@bC{JjLjEvNvFn\\jMYhMdNjIbHcDjXcu@~c@yzAvTwhAbL}eAzDcb@jFqBdQtBnHx@oDdAlAeTpAeQr@kJuCeEeSBsAuI|Bob@eJanAoC{Y{FkIu{@qf@c^wTqKcPmc@uZcWaSug@uEaf@mNmc@kUej@wSym@_I_BsWuj@qPk_@{Eoc@|EalArMoXxAsOhC{HlHaPxNaIdAiKsJmJmP_F{U}ZdHoEx@eDeEcAuE”
    },

     

    4. Create a payload with the points. and with the polyline created above:
    {
    “color”: “#CD0A0A”,
    “description”: “Recorrido farmacias”,
    “checkpoints”: [
    {
    “name”: “CD MEDIVEN”,
    “buffer”: 50,
    “lat”: -33.3089255,
    “lon”: -70.7204965
    },
    {
    “name”: “FARMACIA GABRIELA”,
    “buffer”: 50,
    “lat”: -33.562885,
    “lon”: -70.624062
    },
    {
    “name”: “FARMACIA SANTA ANITA”,
    “buffer”: 50,
    “lat”: -33.567043,
    “lon”: -70.672501
    },
    {
    “name”: “FARMACIA BUENA SALUD LOCAL 1”,
    “buffer”: 50,
    “lat”: -33.526806,
    “lon”: -70.610039
    },
    {
    “name”: “FARMACIA LOS ROBLES LOCAL N° 1”,
    “buffer”: 50,
    “lat”: -33.594982,
    “lon”: -70.70269
    },
    {
    “name”: “FARMACIA CURMAN LOCAL Nº 1”,
    “buffer”: 50,
    “lat”: -33.585438,
    “lon”: -70.628098
    },
    {
    “name”: “FARMACIA LIFEPHARMACY”,
    “buffer”: 50,
    “lat”: -33.596413,
    “lon”: -70.705208
    },
    {
    “name”: “FARMACIA LA ERA ARCAYA”,
    “buffer”: 50,
    “lat”: -33.51741,
    “lon”: -70.681351
    },
    {
    “name”: “FARMACIA C.A LOCAL N° 4 (LA CISTERNA)”,
    “buffer”: 50,
    “lat”: -33.515694,
    “lon”: -70.658295
    },
    {
    “name”: “FARMACIAS ALEM”,
    “buffer”: 50,
    “lat”: -33.615452,
    “lon”: -70.70726
    },
    {
    “name”: “FARMACIA BIENESTAR (LA CISTERNA)”,
    “buffer”: 50,
    “lat”: -33.53669,
    “lon”: -70.664352
    },
    {
    “name”: “FARMACIA CARDENAL CARO”,
    “buffer”: 50,
    “lat”: -33.499542,
    “lon”: -70.688522
    },
    {
    “name”: “FARMACIAS 24 LOCAL N° 2”,
    “buffer”: 50,
    “lat”: -33.545845,
    “lon”: -70.64592
    },
    {
    “name”: “EJEMPLO TERMINO”,
    “buffer”: 50,
    “lat”: -33.4102076,
    “lon”: -70.5709049
    }
    ],
    “schedules”: [
    {
    “active”: true,
    “timezone”: “America/Mexico_City”,
    “repeat”: “Fri”,
    “valid_until”: “2020-06-26T23:59:59”,
    “checkpoints”: [
    {
    “max_duration”: 0,
    “min_duration”: 0,
    “optional”: false,
    “time”: “12:30”
    },
    {
    “max_duration”: 0,
    “min_duration”: 0,
    “optional”: false,
    “time”: null
    },
    {
    “max_duration”: 0,
    “min_duration”: 0,
    “optional”: false,
    “time”: null
    },
    {
    “max_duration”: 0,
    “min_duration”: 0,
    “optional”: false,
    “time”: null
    },
    {
    “max_duration”: 0,
    “min_duration”: 0,
    “optional”: false,
    “time”: null
    },
    {
    “max_duration”: 0,
    “min_duration”: 0,
    “optional”: false,
    “time”: null
    },
    {
    “max_duration”: 0,
    “min_duration”: 0,
    “optional”: false,
    “time”: null
    },
    {
    “max_duration”: 0,
    “min_duration”: 0,
    “optional”: false,
    “time”: null
    },
    {
    “max_duration”: 0,
    “min_duration”: 0,
    “optional”: false,
    “time”: null
    },
    {
    “max_duration”: 0,
    “min_duration”: 0,
    “optional”: false,
    “time”: null
    },
    {
    “max_duration”: 0,
    “min_duration”: 0,
    “optional”: false,
    “time”: null
    },
    {
    “max_duration”: 0,
    “min_duration”: 0,
    “optional”: false,
    “time”: null
    },
    {
    “max_duration”: 0,
    “min_duration”: 0,
    “optional”: false,
    “time”: null
    },
    {
    “max_duration”: 0,
    “min_duration”: 0,
    “optional”: false,
    “time”: “13:30”
    }
    ]
    }
    ],
    “active”: true,
    “path”: {
    “buffer”: 50,
    “encoding”: “rshjEdrsnLnHhW_UbNul@zRc@wDlEpIcFbAbR{KbqMiqElRqFtz@x^|[rKruAkk@nu@{Nz@eCby@hG|nAe@dc@Trl@_OzZkGni@Sv^iAbPaJrNoCrf@fMhpEdaBzJhHkCw@nHqVnYcb@ze@grAv\\y~AxRuwAdOekBfCiDtB}RxD}@uEs^NaLdJoApKqAjA|LvOe@bAWk^vhFaBvQBlJbp@zK}xAoXci@wIdAgPim@mKuLsEtRw{BHsjAaFuu@{Foq@ckAgv@}@wOfAbLaGfLkG~LAhJzBdC|j@r@z\\vBnJlN~KdvAaCv|@gKdvA{^dCcUt|@k@uAxo@bVVxSliAb{BdMlKzmDlXfNnClCyAjOupAVwBvGkApRhEs@nGuTiFyBeIrH{e@tCcSdCqq@cCyKnDuLhIwl@pUksEnCsw@bFeE~MOhCk@iVL_X@aEwr@sDgBiq@zCyLhAt@jLzDk@fpAoGbHOeHyB_Ln|B{PjnAn@vg@aPzkA{BlJ~e@jLvGBaAbG_AnGa_@}IsKwCuGlVoIbk@yAuCe|BySio@ycA{k@agAqpB}~@oMoF{IbMgJvRvCiLhP{Qif@wSwOeHpRg~@rDwOyKmB_G~J{Gj\\uEpTrAjNv@dFbwBny@|}@|_@vlAlwBvNvYbuGnh@|a@zBra@mEjNeDtE{b@bCyJ}GlYuBvWai@xBovFi]q{@wHyQkOi_@ms@mi@{dAkR{Nuj@iV{L}FvJod@fFhAhSu}@|AW{Gnc@_ZppAsl@~xA{SxXsL|C_|Aon@sEgBzCkXcRkHbVhJJnDvEc@bC{JzbBdt@bHcDjXcu@~c@yzAvTwhAbL}eAzDcb@jFqBdQtBnHx@oDdA~Ckf@r@kJuCeEeSBsAuI|Bob@eJanAoC{Y{FkIu{@qf@c^wTqKcPmc@uZcWaSug@uEaf@mNmc@kUej@wSym@_I_`BsWuj@qPk_@{EajCjWsOhC}YfXaIdAwVa\\_F{U}ZdHoEx@iF{K”
    },
    “name”: “Farmacias”
    }

     

    5. Send a POST to https://pro.analyzegps.cl/api/entities/2070/routes with the payload created above:

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.