Route¶
A Route Maps API is a feature provided by MapZone that allows developers to calculate and display the optimal route between two or more locations on a map. With a Route Maps API, developers can specify the start and end points of a journey, along with any additional constraints such as preferred mode of transportation, and retrieve a detailed route that can be displayed on a map. The API may also provide information such as the total distance, estimated travel time, and turn-by-turn directions. Developers can use Route Maps APIs to create applications that help with navigation, transportation planning, and logistics management.
URL¶
https://tw.map.zone/api/route?point={point}&point={point}&type=json&locale=tw&apikey={your-apikey}&vehicle=car
Method¶
GET
Parameters¶
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
point | array string | yes | none | The points for which the route should be calculated. Format: [latitude,longitude]. Specify at least an origin and a destination. Via points are possible. The maximum number depends on your plan. |
points_encoded | boolean | no | true | Allows changing the encoding of location data in the response. The default is polyline encoding, which is compact but requires special client code to unpack. Set this parameter to false to switch the encoding to simple coordinate pairs like [lon,lat]. See the description of the response format for more information. |
vehicle | string | no | car | Enum: car. Config the vehicle profiles for which the route should be calculated. |
Example¶
Input
https://tw.map.zone/api/route?point=23.60501245075453,120.47102124735574&point=23.737353346594148,120.52540550743623&type=json&locale=tw&apikey=95f852d9f8c38e08ceacfd456b59059d0618254a50d3854c&vehicle=car
{
{
"license": "vietmap",
"code": "OK",
"messages": null,
"paths": [
{
"distance": 22842.8,
"weight": 1514.2,
"time": 1514200,
"transfers": 0,
"points_encoded": true,
"bbox": [
120.43778,
23.60188,
120.52573,
23.73653
],
"points": "kmaoCcnh~UqBaPpIuAZ~Bx@jFNp@p@vCFd@Hn@J|@TnBN~@z@~E~@rFPzCF`ABvG@L?`@?V@pDEt@IvAU|AGhAEv@OnCk@dECv@?FKnCALAPCx@a@pCa@rBIf@c@|Cg@jD]~EArHKhAh@ZpDjBrCxALFz@^FzEDtA_DtCo@j@qDdDCDIHURKHwJ|IyDlDSREDoEbEkC`CcHxGcEpDkCxBKHIFY\\AJ@J@JFNDNVr@Pp@Lv@@`@OZIb@MXQPSL]J[BS@}@JoCBwA@{ACg@AyDSi@@q@B}@I}@OqLiAiCW}NoAcMqA{F}@o@KkG}@yl@sIad@mJcR{DiRoFgBk@{e@}OwDwAyDoAgJqDkUaJoGuCwBeAuLqFgDcBqIkEgKuFgMaHyLsGiCuAaTuLqTiLi\\wQcN{GaD{AqBkA}As@cAo@m@g@]_@u@_Am@eAYm@Sg@Yy@a@u@m@y@q@q@a@e@Ye@W{@SoAASCWq@wLASASCQs@iLOmDSUqB?S@q@BsAOs@[iAs@wA_AKGc@YeIcGaIuF_@Y_EqCc@Y}@Yu@EgA@E?G@gBH_Kd@g@Bi@BcAF_BHI?a@{BKo@oByJEUoBqJoA_EGSEMe@mAiBsD{BcDkFuFeAgAOOWWkO_OQQyNoNIIKMMOOQWWkI_IyG_HSSMOKQKKaAkAkDuEiDiF_@k@Ug@KWoAoCwAmDcAqCyAuEIUI_@CMi@gCwAmHAKIi@Gi@CMe@cDy@oHCME_@CQw@oF}@sFs@aDCGEUGSEUcA_DmAcDiDmG}@_BS]wBgEe@qAUBY@o@BG?cDFU@wJd@U@iBJk@BaBD_ADwAFO?k@BeADq@Bw@DiADmDkO",
"instructions": [
{
"distance": 285.6,
"heading": 0,
"sign": 0,
"interval": [
0,
1
],
"text": "Tiếp tục",
"time": 70600,
"street_name": "",
"last_heading": null
},
{
"distance": 192.4,
"heading": 0,
"sign": 2,
"interval": [
1,
2
],
"text": "Rẽ phải",
"time": 48200,
"street_name": "",
"last_heading": null
},
{
"distance": 1592.6,
"heading": 0,
"sign": 2,
"interval": [
2,
32
],
"text": "Rẽ phải",
"time": 114000,
"street_name": "",
"last_heading": null
},
{
"distance": 106.3,
"heading": 0,
"sign": 0,
"interval": [
32,
34
],
"text": "Tiếp tục theo 大林中興路地下道",
"time": 9600,
"street_name": "大林中興路地下道",
"last_heading": null
},
{
"distance": 372.2,
"heading": 0,
"sign": 0,
"interval": [
34,
39
],
"text": "Tiếp tục theo 中興路",
"time": 33400,
"street_name": "中興路",
"last_heading": null
},
{
"distance": 195.9,
"heading": 0,
"sign": 0,
"interval": [
39,
41
],
"text": "Tiếp tục theo 中興一路",
"time": 20400,
"street_name": "中興一路",
"last_heading": null
},
{
"distance": 280.5,
"heading": 0,
"sign": -2,
"interval": [
41,
46
],
"text": "Rẽ trái vào 祥和路",
"time": 25500,
"street_name": "祥和路",
"last_heading": null
},
{
"distance": 156,
"heading": 0,
"sign": 2,
"interval": [
46,
48
],
"text": "Rẽ phải vào 明華路",
"time": 14200,
"street_name": "明華路",
"last_heading": null
},
{
"distance": 1498.3,
"heading": 0,
"sign": 2,
"interval": [
48,
67
],
"text": "Rẽ phải vào 民生北路",
"time": 114700,
"street_name": "民生北路",
"last_heading": null
},
{
"distance": 140.7,
"heading": 0,
"sign": -2,
"interval": [
67,
76
],
"text": "Rẽ trái vào 民生路",
"time": 9100,
"street_name": "民生路",
"last_heading": null
},
{
"distance": 514.9,
"heading": 0,
"sign": 0,
"interval": [
76,
92
],
"text": "Tiếp tục",
"time": 41300,
"street_name": "",
"last_heading": null
},
{
"distance": 8825.8,
"heading": 0,
"sign": 0,
"interval": [
92,
125
],
"text": "Tiếp tục theo 中山高速公路",
"time": 361000,
"street_name": "中山高速公路",
"last_heading": null
},
{
"distance": 439.9,
"heading": 0,
"sign": 0,
"interval": [
125,
136
],
"text": "Tiếp tục",
"time": 35100,
"street_name": "",
"last_heading": null
},
{
"distance": 203.3,
"heading": 0,
"sign": 0,
"interval": [
136,
142
],
"text": "Tiếp tục",
"time": 16300,
"street_name": "",
"last_heading": null
},
{
"distance": 586.1,
"heading": 0,
"sign": 0,
"interval": [
142,
150
],
"text": "Tiếp tục theo 大業路",
"time": 38800,
"street_name": "大業路",
"last_heading": null
},
{
"distance": 1487.4,
"heading": 0,
"sign": -2,
"interval": [
150,
177
],
"text": "Rẽ trái vào 延平路一段",
"time": 99200,
"street_name": "延平路一段",
"last_heading": null
},
{
"distance": 1957.9,
"heading": 0,
"sign": 2,
"interval": [
177,
197
],
"text": "Rẽ phải vào 雲科路四段",
"time": 128300,
"street_name": "雲科路四段",
"last_heading": null
},
{
"distance": 2943.1,
"heading": 0,
"sign": 0,
"interval": [
197,
244
],
"text": "Tiếp tục theo 雲科路三段",
"time": 195500,
"street_name": "雲科路三段",
"last_heading": null
},
{
"distance": 780.1,
"heading": 0,
"sign": -2,
"interval": [
244,
263
],
"text": "Rẽ trái vào 西平路",
"time": 71000,
"street_name": "西平路",
"last_heading": null
},
{
"distance": 283.8,
"heading": 0,
"sign": 2,
"interval": [
263,
264
],
"text": "Rẽ phải",
"time": 68000,
"street_name": "",
"last_heading": null
},
{
"distance": 0,
"heading": 0,
"sign": 4,
"interval": [
264,
264
],
"text": "Đến đích",
"time": 0,
"street_name": "",
"last_heading": null
}
],
"snapped_waypoints": "cnh~UkmaoCuuI}qX"
},
{
"distance": 24782.3,
"weight": 1765.3,
"time": 1765300,
"transfers": 0,
"points_encoded": true,
"bbox": [
120.45874,
23.60249,
120.53879,
23.73653
],
"points": "kmaoCcnh~UqBaPpIuAZ~Bx@jFNp@p@vCFd@Hn@J|@TnBN~@z@~E~@rFPzCF`ABvG@L?`@?V@pDEt@IvAU|AGhAEv@OnCk@dEyAw@uAu@{CaBoAq@_@Ss@lCYdAKb@IVSv@ADGRGPC^OLcAb@{@`@g@b@Yg@c@k@Y[SU{@s@yGqFoByAiAs@gLuEc`@gOuR}HyCkA}DqAm@QgBYyIq@eE]kFc@o@GuAG_CUaBGuABg@B_Jz@WB_BL_AHO@U@k@Bm@?w@Cg@EWCKAqBUQCKCkNiBaf@kGWEQAmNeB_NeBo@MyDa@wG{@uG{@mGw@wC]mH}@UEETI|@Q|AId@GTMXWT[NU@Y?[IMKQQS]Sm@I[E_@Am@Bw@Bk@\\wBTqBBeA?i@ZiELeF?kGAyDMgHe@uIYgD_AqHiA}GgAeFyAqFiEkPq@_CsCiKyA{FoAoFsAyGk@_Dw@eG_@cDa@{EQ{CEgAE_BGyCCiC?uAHeIH_DHiCRwEl@iL^}JH_HAwCEwCQoE[mEg@wFu@{Ec@gCcBqHmB{GiDmKWm@yFkOeCiGs@qBoBiGmBuG}@sCu@eCyAmFw@aDCc@?c@Bo@F_@Rc@NQPMVKZA\\BLFPLNNJTFR?Z?REZK`@]h@[Xc@NYD{AViAVcCLcBNeDLe@Ba@I{Bw@KEOEq@O}@SOCKCmDk@CAiAMm@IWEULMJm@j@e@j@m@h@e@Vc@Pa@JYFYBW@gB@K?mEEI?mECmBA{@AyCEeAI{@Uy@[g@Yi@[u@q@o@}@]u@]cAc@mAmCJM?cQXuCH_ADU@O?[@wHXQ@M?cCDM?a@B]@sGNqDJM@M@M@kEJY@G?I@_BBoADeADC?U@MAM?WAIAuCK[AGf@AF[fCETAPCLm@lEe@bCAJCFSbA{@lDIVOj@q@tAiAjDM\\ENENeF~LOZYZSLUJUHSDWBc@@qBFuBDyB?gDOqBQYESCUAwBIa@EcBWq@IiCm@cBe@oDwAYMg@SGCoB_Au@Q{Aw@MGk@YMG]S}CkBwAaAKImBqASMu@s@SNg@f@[`@U^Wd@QTg@r@qClE]l@k@z@SVKPcArAiArBQd@g@ZoCdBKF}InFwA|@_Bt@KDk@ZYHoEhBKDcBp@IB]NOFmBv@_@Pa@NMFUJA?cBp@kAd@MFMFqEhBeGDgBFkAF_ABsAHOBUBY@o@BG?cDFU@wJd@U@iBJk@BaBD_ADwAFO?k@BeADq@Bw@DiADmDkO",
"instructions": [
{
"distance": 285.6,
"heading": 0,
"sign": 0,
"interval": [
0,
1
],
"text": "Tiếp tục",
"time": 70600,
"street_name": "",
"last_heading": null
},
{
"distance": 192.4,
"heading": 0,
"sign": 2,
"interval": [
1,
2
],
"text": "Rẽ phải",
"time": 48200,
"street_name": "",
"last_heading": null
},
{
"distance": 1470,
"heading": 0,
"sign": 2,
"interval": [
2,
27
],
"text": "Rẽ phải",
"time": 106200,
"street_name": "",
"last_heading": null
},
{
"distance": 284.1,
"heading": 0,
"sign": 2,
"interval": [
27,
32
],
"text": "Rẽ phải vào 水源路",
"time": 31700,
"street_name": "水源路",
"last_heading": null
},
{
"distance": 221,
"heading": 0,
"sign": 0,
"interval": [
32,
41
],
"text": "Tiếp tục theo 水源路73巷",
"time": 31900,
"street_name": "水源路73巷",
"last_heading": null
},
{
"distance": 120.1,
"heading": 0,
"sign": 2,
"interval": [
41,
45
],
"text": "Rẽ phải vào 中正路",
"time": 19700,
"street_name": "中正路",
"last_heading": null
},
{
"distance": 90.9,
"heading": 0,
"sign": 0,
"interval": [
45,
49
],
"text": "Tiếp tục theo 中正路",
"time": 8100,
"street_name": "中正路",
"last_heading": null
},
{
"distance": 2664.3,
"heading": 0,
"sign": 0,
"interval": [
49,
69
],
"text": "Tiếp tục theo 縱貫公路",
"time": 172500,
"street_name": "縱貫公路",
"last_heading": null
},
{
"distance": 198.9,
"heading": 0,
"sign": 0,
"interval": [
69,
70
],
"text": "Tiếp tục theo 石龜溪橋",
"time": 11000,
"street_name": "石龜溪橋",
"last_heading": null
},
{
"distance": 2762.8,
"heading": 0,
"sign": 0,
"interval": [
70,
98
],
"text": "Tiếp tục theo 延平路三段",
"time": 181800,
"street_name": "延平路三段",
"last_heading": null
},
{
"distance": 930.4,
"heading": 0,
"sign": -2,
"interval": [
98,
125
],
"text": "Rẽ trái",
"time": 83800,
"street_name": "",
"last_heading": null
},
{
"distance": 5634.6,
"heading": 0,
"sign": 0,
"interval": [
125,
170
],
"text": "Tiếp tục theo 東西向快速公路 台西古坑線",
"time": 253700,
"street_name": "東西向快速公路 台西古坑線",
"last_heading": null
},
{
"distance": 386.5,
"heading": 0,
"sign": 0,
"interval": [
170,
173
],
"text": "Tiếp tục",
"time": 34700,
"street_name": "",
"last_heading": null
},
{
"distance": 760.1,
"heading": 0,
"sign": 0,
"interval": [
173,
201
],
"text": "Tiếp tục",
"time": 68400,
"street_name": "",
"last_heading": null
},
{
"distance": 1688.9,
"heading": 0,
"sign": 0,
"interval": [
201,
247
],
"text": "Tiếp tục theo 中山路",
"time": 95900,
"street_name": "中山路",
"last_heading": null
},
{
"distance": 1575.3,
"heading": 0,
"sign": -2,
"interval": [
247,
282
],
"text": "Rẽ trái vào 中山路",
"time": 101800,
"street_name": "中山路",
"last_heading": null
},
{
"distance": 664.5,
"heading": 0,
"sign": -2,
"interval": [
282,
301
],
"text": "Rẽ trái vào 明德路",
"time": 43400,
"street_name": "明德路",
"last_heading": null
},
{
"distance": 765.6,
"heading": 0,
"sign": 0,
"interval": [
301,
317
],
"text": "Tiếp tục theo 明德陸橋",
"time": 50100,
"street_name": "明德陸橋",
"last_heading": null
},
{
"distance": 999.3,
"heading": 0,
"sign": 0,
"interval": [
317,
341
],
"text": "Tiếp tục theo 明德北路三段",
"time": 70500,
"street_name": "明德北路三段",
"last_heading": null
},
{
"distance": 1684.6,
"heading": 0,
"sign": -2,
"interval": [
341,
382
],
"text": "Rẽ trái vào 西平路",
"time": 111900,
"street_name": "西平路",
"last_heading": null
},
{
"distance": 1118.6,
"heading": 0,
"sign": 0,
"interval": [
382,
407
],
"text": "Tiếp tục theo 西平路",
"time": 101400,
"street_name": "西平路",
"last_heading": null
},
{
"distance": 283.8,
"heading": 0,
"sign": 2,
"interval": [
407,
408
],
"text": "Rẽ phải",
"time": 68000,
"street_name": "",
"last_heading": null
},
{
"distance": 0,
"heading": 0,
"sign": 4,
"interval": [
408,
408
],
"text": "Đến đích",
"time": 0,
"street_name": "",
"last_heading": null
}
],
"snapped_waypoints": "cnh~UkmaoCuuI}qX"
}
]
}