Class: Locate maps.nyc.gov

nyc.ol.Locate

new Locate(geocoder, projectionopt, extentLimitopt)

A class for geocoding and geolocating
Parameters:
Name Type Attributes Description
geocoder nyc.Geocoder A geocoder implementation
projection string <optional>
The EPSG code of the projection for output geometries (i.e. EPSG:2263)
extentLimit ol.Extent <optional>
Geolocation coordinates outside of this bounding box are ignored
Implements:
Source:
Fires:

Extends

Members

(static, constant) ZOOM_LEVEL :number

The recommended zoom level to use when centering a map on a the result of a call to a locate method
Type:
  • number
Source:

Methods

locate()

Locate once using device geolocation
Implements:
Source:

off(eventName, evtHdlr, hdlrScopeopt)

Remove a previously connected event handler
Parameters:
Name Type Attributes Description
eventName string The name of the event to which the handler will be connected
evtHdlr function The event handler function
hdlrScope Object <optional>
The scope in which to invoke the event handler
Inherited From:
Source:

on(eventName, evtHdlr, hdlrScopeopt)

Connect a function to an event
Parameters:
Name Type Attributes Description
eventName string The name of the event to which the handler will be connected
evtHdlr function The event handler function
hdlrScope Object <optional>
The scope in which to invoke the event handler
Inherited From:
Source:

one(eventName, evtHdlr, hdlrScopeopt)

Connect a function to an event for a single invocation
Parameters:
Name Type Attributes Description
eventName string The name of the event to which the handler will be connected
evtHdlr function The event handler function
hdlrScope Object <optional>
The scope in which to invoke the event handler
Inherited From:
Source:
Geocode an input string representing a location
Parameters:
Name Type Description
input string The value to geocode
Implements:
Source:

track(track)

Track using device geolocation
Parameters:
Name Type Description
track boolean Track or not
Implements:
Source:

trigger(eventName, dataopt)

Trigger a named event with event data
Parameters:
Name Type Attributes Description
eventName string The name of the event to trigger
data Object <optional>
The event data
Inherited From:
Source: