2
I am new to programming and I am developing an app from which I search for a list of taxis closer to my location through a website. But I’m having a hard time with it.
Lists active taxi drivers within an Endpoint geographical rectangle:
GET https://api.99taxis.com/lastLocations
Parameters:
sw: Extreme south point, extreme west of the rectangle, in the form "latitude, longitude". Ex: -23.612474,- 46.702746
ne: Northernmost point, easternmost point of the rectangle, in the format "latitude,longitude". Ex: -23.589548,- 46.673392
Example
Request:
GET https://api.99taxis.com/lastLocations?sw=-23.612474,-46.702746&ne=-23.589548,-46.673392
I can only create an endpoint, but I don’t know how to pull this service and put it on the map, for example:
var person = MapModule.createAnnotation({
latitude: -23.474891,
longitude: -46.526756,
title: 'Você',
subtitle: 'São Paulo, SP',
pincolor: MapModule.ANNOTATION_RED,
image:"/ui/images/buscador.png",
});
Could someone help me with the line of codes for me to pick up the latidude and longitude of these taxis in this rectangular geography??? Thanks guys
André, I downloaded your link and gave me a beautiful whitening... however, I’m still struggling in the for... you accessed the link of locations? So, I’m not able to go through this array with a for and take the index of the latitude and longitude keys and houses... I also need that driverId but knowing the location I will be able to execute it. Could you help me with that?
– user27497
It is very strange, but I checked the headers and etc and the server response is there, in a JSON, straight, but when I use some function, be the
$.ajax
or the$.getJSON
, the answer does not come, neither in text nor in JSON, I do not know if it is the API that is blocking. I couldn’t manipulate any information, even though the answer exists.– André Sampaio