Options
All
  • Public
  • Public/Protected
  • All
Menu

geobase-client

geobase-client

The package geobase-client provides core Verizon Connect GeoBase functionality when connected to a GeoStream web server.

Functionality provided by geobase-client includes:

  • Geocoding, including autocomplete and fuzzy matching
  • Reverse geocoding
  • Driving directions
  • Routing and route optimization
  • Layer management, including traffic layers
  • Route highlighting

Users of geobase-client must successfully authenticate with a GeoStream server to use the features listed above.

For tutorials that teach you how to use the packages geobase-client, geobase-map, and geobase-map-demo see GeoBase Client Map Tutorial Help.

Installation

  1. Download node at nodejs.org and install it, if you haven't already.
  2. Install geobase-client as a dependency by running the following command in the base directory:
npm install geobase-client

NOTE: The setting 'geostreamVersion' in package.json indicates the GeoStream version this version of geobase-client is intended to be used with. Some of the functionality provided by geobase-client is not supported by older GeoStream versions.

Usage

To geocode an address use the following code: (In this example we are using the address '20 Enterprise, Aliso Viejo, CA 92656' in the USA.)

var geobase = require('geobase-client');

// Authenticate with the GeoStream server.
geobase.use({ 
    servers: ['http://my-geostream-server'],
    username: 'my-username',
    password: 'my-password'
})


// Perform a location search operation using the supplied address and country
geobase.locationSearch({
    country: '20 Enterprise, Aliso Viejo, CA 92656'
    countries: [geobase.Country.USA]
}).then(function(result) {
    if (result.suggestions.length > 0) {
        console.log("Location search result: " + 
        result.suggestions[0].formattedAddress);
    } else {
        console.log("No results found from the Location Search.");
    }
)};

To get a path between three points on the map use the following code:

var geobase = require('geobase-client');

// Authenticate with the GeoStream server
geobase.use({
    servers: ['http://my-geostream-server'],
    username: 'my-username',
    password: 'my-password'
})

// Define the coordinates of the stops
var stops = [{
    location: new geobase.LatLon(45.589666, -122.681536)
}, {
    location: new geobase.LatLon(45.549289, -122.566180)
}, {
    location: new geobase.LatLon(45.453036, -122.783160)
}];

// Perform a getPath operation to get the path through the stops 
// defined above
geobase.getPath({
    stops: stops,
    strategy: {}
}).then(function(path) {
    if (path.points) {
        var points = path.points;
        //... do something with your points ...
    }
});

For more usage examples see the tutorials provided in the package geobase-map-demo and the corresponding help within the Verizon Connect GeoBase Client Tutorial Help.

Software Version

Release version: 2.0

Release date: April 15th 2017

Licensing

Geobase-client is released under the MIT License. This license covers the Verizon Connect GeoBase Client software only. It does not cover the Verizon Connect GeoStream software.

Copyright © 2019 Verizon Connect Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Support

If you require additional assistance or support, don't hesitate to contact Verizon Connect customer support at gbsupport@verizonconnect.com. A member of the GeoBase support team will be glad to assist you.

Generated using TypeDoc