[ Whereis® API Home ] [ Developers' Guide ] [ JS Services ]
The Points of Interest (POI) service returns a list of points of interest for a given area defined by a bounding box.
Sample request
The following code snippet returns a list of POIs by category name:
//Initialise service service = new EMS.Service.Poi(); //Format request var request = {}; request.category = "atms"; request.bounds = {"left":"144.96","bottom":"-37.817","right":"144.962","top":"-37.815"}; //Submit request service.browse(request, callback); //Handle the response function callback (response, status){ // Check the status of the result is non-error if (status == EMS.Status.OK) { // Success! check the results var items = response.results; if (items.length > 0) { var msg = ""; for (var i = 0; i < results.length; i++) { msg += results[i].name + " " + "<br>" ; } alert(msg); } else { // Found nothing } } else { // Error! Display the message. alert(response.message); } };