The GeoLocatorProvider
interface allows you to write your own integration with a third-party geo-location provider service. An implementation of the GeoLocatorProvider
interface must implement the following methods:
isAddressEntry()
—Returns true if the provider supports a free-form address entry.isPostalCodeOnly()
—Returns true if the provider supports a postal code entry.getGeoLocation()
—Returns aCoordinate
object based on a locale and a given free-form address or postal code or returns aCoordinate
object based on a locale and a given city and state.
The GeoLocatorService
wraps the GeoLocatorProvider
functionality. To use it, set the provider
property of the GeoLocatorService
class to your implementation of GeoLocatorProvider
. The GeoLocatorService
accepts three input methods:
Free-form address (for example, 1 Main Street Cambridge MA)
Postal code
City and state
The GeoLocatorService
also contains a defaultLocale
property that can be used to define a default location for queries.