chandramohan
chandramohan

Reputation: 31

Mapbox: Getting "Coordinate is invalid: 3.099813715520299,101.63553013450047" error for Matrix API

I am working with matrix API https://docs.mapbox.com/api/navigation/matrix/

When I try to add the coordinates given in above link in my system and try i am getting proper result.

https://api.mapbox.com/directions-matrix/v1/mapbox/driving/-122.42,37.78;-122.45,37.91;-122.48,37.73?approaches=curb;curb;curb&access_token=<%access Token%>&sources=0&destinations=1,2

But when I am trying realtime data I am getting below error

https://api.mapbox.com/directions-matrix/v1/mapbox/driving/3.08,101.58;3.09,101.57;3.10,101.63;3.06,101.55;3.13,101.68;3.10,101.66?access_token=<%access token%>&sources=0&destinations=1,2,3,4

{ message: "Coordinate is invalid: 3.08,101.58", code: "InvalidInput" }

Can please help me with what the issue with coordinates

Upvotes: 0

Views: 581

Answers (2)

Gorgsenegger
Gorgsenegger

Reputation: 7856

One thing also causing the Coordinate is invalid error is a redundant ; after the last pair of coordinates, so instead of e.g.

-117.17282,32.71204;-117.1470279,32.7048179; use

-117.17282,32.71204;-117.1470279,32.7048179

Upvotes: 0

Related Questions