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 datamodule: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 datamodule:nyc/Locator~Locator.Result The location to which the map will be oriented
callbackmodule: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
- Source:
Properties:
Name Type Argument Default Description mapol.Map The map on which location will be managed
styleol.style.Style <optional>
The style for the layer on which user-specified locations will be displayed
zoomnumber <optional>
module:nyc/MapLocator~MapLocator.ZOOM_LEVEL The zoom level used when locating coordinate
-
zoomLocationCallback()
-
Callback for module:nyc/MapLocator~MapLocator#zoomLocation
- Inherited From:
- Overrides:
- Source: