Click or drag to resize

Telogis.GeoBase.DataQuery

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
DataQuery Namespace

Contains RPC methods used to fetch miscellaneous GIS data from the GeoStream server.

Functions
NameDescription
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)});
Arguments
  • bounds (BoundingBox) - The BoundingBox describing the region to request points of interest in.

  • (Optional) poiTypeList (Array) - An array of POIType codes, whose elements are the permissible types that the returned points of interest may have. If this is not provided, all types are allowed. Defaults to null.

  • (Optional) searchString (String) - A string to filter the results by. All returned POIs must contain this as a substring of their descriptions; if it is left empty, this filtering takes no effect. Defaults to ''.

  • callback (Function) - The arbitrary function to execute with the results of the request once a reply is received from the server. The results of the call are passed to this as arguments rather than being returned, since the request is asynchronous.

    Arguments
    • poi (Array) - The list of POIs that match the filtering behavior specified by DataQuery.queryPOI.poiTypeList and DataQuery.queryPOI.searchString.

  • (Optional) errorCallback (Function) - An arbitrary callback to execute if an error or timeout occurs when performing the query. Returns the error or timeout that occurred when performing the query. Defaults to null.

    Arguments
    • error (Telogis.Errors.GeoBaseError) - An exception describing the problem that was encountered.

  • server (Object) - An optional object that contains server.url (The address of the GeoStream server as a string) and server.authToken (The GeoStream authentication token to be used for requesting tiles) to be used for this request.