API Docs for: 7.2
Show:

MQA.Geocoder Class

Module: MQA

Geocoder Module intended to provide a simple place to override common function but provides base functionalty of executing a geocode request to the service.

Methods

_constructPOI

(
  • location
)
MQA.Poi private

Internal construct poi... mostly used as example.

Parameters:

  • location Object
    • location from the geocode response

Returns <MQA.Poi>

poi

_processAmbiguities

(
  • location
)
MQA.Poi private

Internal _processAmbiguities mostly used as example.

Parameters:

  • location Object
    • location from the geocode response

Returns <MQA.Poi>

poi

_processResults

(
  • response
  • map
)
private

Internal default processResults function

Parameters:

constructPOI

(
  • location
)
MQA.Poi

Called when a location is resolved from a geocode, and is intended to be overridden.

Parameters:

  • location Object

    The location from the geocode response.

Returns <MQA.Poi>

The MQA.Poi of the location.

geocode

(
  • locations
  • [options]
  • [map]
  • [callback]
)

Execute a geocode request. See the Geocode Options section for the list of available geocode options.

Parameters:

  • locations Array | Object | String

    The location(s) to geocode.

  • [options] Object optional

    Additional geocode options.

  • [map] MQA.TileMap optional

    The map used to show the location(s).

  • [callback] Function optional

    The name of the callback function where a single parameter of the raw response will be passed.

Example:

MQA.Geocoder.geocode('Lancaster PA', { maxResults: 1 }, map, myCallbackFunction);

processAmbiguities

(
  • results
  • [map]
)

Called when there are ambiguities in the response of a geocode request, and is intended to be overridden.

Parameters:

  • results Object

    The ambiguous locations in the geocode response.

  • [map] MQA.TileMap optional

    The map used to show the locations.

processResults

(
  • response
  • [map]
)

Called when the location(s) is resolved from a geocode, and is intended to be overridden. This offers the greatest flexibility, but also requires the user to define how the geocode result(s) should be handled.

Parameters:

  • response Object

    The geocode response.

  • [map] MQA.TileMap optional

    The map used to show the location(s).

reverse

(
  • latLng
  • [options]
  • [map]
  • [callback]
)

Execute a reverse geocode request.

Parameters:

  • latLng MQA.LatLng

    The lat/lng of the location.

  • [options] Object optional

    Additional geocode options.

  • [map] MQA.TileMap optional

    The map used to show the location(s).

  • [callback] Function optional

    The name of the callback function where a single parameter of the raw response will be passed.

Example:

var latlng = new MQA.LatLng(39.743943, -105.020089);

MQA.Geocoder.reverse(latlng, null, map, myCallbackFunction);

runBatchGeocode

(
  • locations
  • options
  • map
  • callback
)
private

Internal function to run a batch geocode

Parameters:

runGeocode

(
  • location
  • options
  • map
  • callback
)
private

Internal function to run a single location geocode

Parameters: