Telogis.GeoBase.DataQuery |
Contains RPC methods used to fetch miscellaneous GIS data from the GeoStream server.
Name | Description |
---|---|
queryPOI (BoundingBox bounds, Array poiTypeList, String searchString, Function callback, Function errorCallback, Object server) | Fetches a collection of points of interest (POI) in a specified rectangular region, optionally filtered by type and an additional search string. 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 = ''; 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 (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)}); // To query within the BoundingBox using an array of POI types (not names), we // could use something similar to the following: // Create an array of POI types var POI1 = 'Airport'; var POI2 = 'ATM'; var POI3 = 'Museum'; var POI4 = 'PetrolStation'; var PoiArray = [POI1, POI2, POI3, POI4]; // Use the array for our BoundingBox data query Telogis.GeoBase.DataQuery.queryPOI(QueryBox, PoiArray, null, function (result) { for (i = 0; i < result.length; i++) { list += result[i].getName() + ' (' + result[i].getType() + ')\n'; } alert (list); }, function (error) {alert(error)});
|