Class: MapLocator

nyc/ol/MapLocator~ MapLocator


new MapLocator(options)

A class for managing map location

Parameters:
Name Type Description
options module:nyc/ol/MapLocator~MapLocator.Options

Constructor options

Source:

Extends

Members


<static, constant> LOCATION_STYLE :ol.style.Style

The marker icon style for user location

Type:
  • ol.style.Style
Source:

layer :ol.layer.Vector

The layer on which to render locations

Type:
  • ol.layer.Vector
Source:

Methods


getProjection()

Get the projection of the map

Inherited From:
Overrides:
Source:
Returns:

The map projection

Type
string

setLocation(data)

Set the location to the provided location without moving the map

Parameters:
Name Type Description
data module:nyc/Locator~Locator.Result

The location to which the map will be oriented

Inherited From:
Overrides:
Source:

zoomLocation(data [, callback])

Zoom to the provided location then optionally invoke a callback function

Parameters:
Name Type Argument Description
data module:nyc/Locator~Locator.Result

The location to which the map will be oriented

callback module:nyc/MapLocator~MapLocator#zoomLocationCallback <optional>

The function to call after the locator has zoomed to the location

Inherited From:
Overrides:
Source:

Type Definitions


Options

Object type to hold constructor options for module:nyc/ol/MapLocator~MapLocator

Type:
  • Object
Properties:
Name Type Argument Default Description
map ol.Map

The map on which location will be managed

style ol.style.Style <optional>

The style for the layer on which user-specified locations will be displayed

zoom number <optional>
module:nyc/MapLocator~MapLocator.ZOOM_LEVEL

The zoom level used when locating coordinate

Source:

zoomLocationCallback()

Inherited From:
Overrides:
Source: