Telogis.GeoBase.POI |
A description of a point of interest returned by the server, grouping additional information about it such as name and phone number.
// Create a BoundingBox in Los Angeles var QueryBox = new Telogis.GeoBase.BoundingBox( new Telogis.GeoBase.LatLon(33.893487,-118.252747), new Telogis.GeoBase.LatLon(33.886426,-118.234481) ); var list = ''; var myQuery = ''; // An empty string or null returns all POIs. // Also accepts partial matches to POI names (not types), for example 'Airport' or 'Museum'. // Or a full name, such as 'Acme Fish Market' or 'Tasty Cupcakes By Angelo'. // Query every POI within the BoundingBox Telogis.GeoBase.DataQuery.queryPOI(QueryBox, null, myQuery, function (result) { for (var i = 0; i < result.length; i++) { var checkFood = result[i].getFoodType(); if (checkFood == 'UNKNOWN'){ checkFood = ' Unknown (this POI does not serve food, or the food available is unknown)'; } list += '' + result[i].getName() + ' at ' + result[i].getLocation() + ' is a POI of type ' + result[i].getType() + '\n' + ' -- POI summary with phone number: ' + result[i].toString() + '\n' + ' -- POI food type: ' + checkFood + '\n' ; } alert (list); }, function (error) {alert(error)});
Name | Description |
---|---|
getFoodType () | Gets the type of food served at the point of interest, if it is an eatery. JavaScript // Create a BoundingBox in Los Angeles var QueryBox = new Telogis.GeoBase.BoundingBox( new Telogis.GeoBase.LatLon(33.893487,-118.252747), new Telogis.GeoBase.LatLon(33.886426,-118.234481) ); var list = ''; // Query every POI within the BoundingBox Telogis.GeoBase.DataQuery.queryPOI(QueryBox, null, null, function (result) { for (var i = 0; i < result.length; i++) { list += '' + result[i].getName() + ' sells food type: ' + result[i].getFoodType() + '\n'; } alert (list); }); String - A code representing the food type of the POI, if applicable. |
getLocation () | Gets the location of the point of interest. JavaScript // Create a BoundingBox in Los Angeles var QueryBox = new Telogis.GeoBase.BoundingBox( new Telogis.GeoBase.LatLon(33.893487,-118.252747), new Telogis.GeoBase.LatLon(33.886426,-118.234481) ); var list = ''; // Query every POI within the BoundingBox Telogis.GeoBase.DataQuery.queryPOI(QueryBox, null, null, function (result) { for (var i = 0; i < result.length; i++) { list += '' + result[i].getName() + ' is located at ' + result[i].getLocation() + '\n'; } alert (list); }); LatLon - The latitude-longitude coordinates describing where the POI is situated. |
getName () | Gets the name of the point of interest. JavaScript // Create a BoundingBox in Los Angeles var QueryBox = new Telogis.GeoBase.BoundingBox( new Telogis.GeoBase.LatLon(33.893487,-118.252747), new Telogis.GeoBase.LatLon(33.886426,-118.234481) ); var list = ''; // Query every POI within the BoundingBox Telogis.GeoBase.DataQuery.queryPOI(QueryBox, null, null, function (result) { for (var i = 0; i < result.length; i++) { list += 'POI found in BoundingBox: ' + result[i].getName() + '\n'; } alert (list); }); String - The POI's name. |
getType () | Finds the POIType code representing the type of the point of interest. JavaScript // Create a BoundingBox in Los Angeles var QueryBox = new Telogis.GeoBase.BoundingBox( new Telogis.GeoBase.LatLon(33.893487,-118.252747), new Telogis.GeoBase.LatLon(33.886426,-118.234481) ); var list = ''; // Query every POI within the BoundingBox Telogis.GeoBase.DataQuery.queryPOI(QueryBox, null, null, function (result) { for (var i = 0; i < result.length; i++) { var TypeValue = Telogis.GeoBase.POIType[result[i].getType()]; list += 'POI ' + result[i].getName() + ' is of type ' + result[i].getType() + ' (POIType value '+TypeValue +')\n'; } alert (list); }); String - The POI's type. |
toString () | Finds a string representation of the point of interest, comprising information about its name and phone number (if available). JavaScript // Create a BoundingBox in Los Angeles var QueryBox = new Telogis.GeoBase.BoundingBox( new Telogis.GeoBase.LatLon(33.893487,-118.252747), new Telogis.GeoBase.LatLon(33.886426,-118.234481) ); var list = ''; // Query every POI within the BoundingBox Telogis.GeoBase.DataQuery.queryPOI(QueryBox, null, null, function (result) { for (var i = 0; i < result.length; i++) { list += 'POI summary: ' + result[i].toString() + '\n'; } alert (list); }); String - A string of the form '$name ($phone)'. |
Name | Type | Description |
---|---|---|
getPhoneNumber | String | Gets the phone number associated with the point of interest. JavaScript // Create a BoundingBox in Los Angeles var QueryBox = new Telogis.GeoBase.BoundingBox( new Telogis.GeoBase.LatLon(33.893487,-118.252747), new Telogis.GeoBase.LatLon(33.886426,-118.234481) ); var list = ''; // Query every POI within the BoundingBox Telogis.GeoBase.DataQuery.queryPOI(QueryBox, null, null, function (result) { for (var i = 0; i < result.length; i++) { list += 'The phone number of ' + result[i].getName() + ' is ' + result[i].getPhoneNumber() + '\n'; } alert (list); }); |