new Geoclient(options)
A class for geocoding using the New York City Geoclient API
Parameters:
| Name | Type | Description |
|---|---|---|
options |
module:nyc/Geoclient~Geoclient.Options | Constructor options |
Fires:
Extends
Members
-
projection :string
-
The epsg code
Type:
- string
- Source:
Methods
-
off(eventName, evtHdlr [, hdlrScope])
-
Remove a previously connected event handler
Parameters:
Name Type Argument Description eventNamestring The name of the event to which the handler will be connected
evtHdlrfunction The event handler function
hdlrScopeObject <optional>
The scope in which to invoke the event handler
- Inherited From:
- Overrides:
- Source:
-
on(eventName, evtHdlr [, hdlrScope])
-
Connect a function to an event
Parameters:
Name Type Argument Description eventNamestring The name of the event to which the handler will be connected
evtHdlrfunction The event handler function
hdlrScopeObject <optional>
The scope in which to invoke the event handler
- Inherited From:
- Overrides:
- Source:
-
one(eventName, evtHdlr [, hdlrScope])
-
Connect a function to an event for a single invocation
Parameters:
Name Type Argument Description eventNamestring The name of the event to which the handler will be connected
evtHdlrfunction The event handler function
hdlrScopeObject <optional>
The scope in which to invoke the event handler
- Inherited From:
- Overrides:
- Source:
-
search(input)
-
Geocode an input string representing a location
Parameters:
Name Type Description inputstring The value to geocode
- Inherited From:
- Overrides:
- Source:
Returns:
The result of the search request
- Type
- Promise.<(module:nyc/Locator~Locator.Result|module:nyc/Locator~Locator.Ambiguous)>
-
trigger(eventName [, data])
-
Trigger a named event with event data
Parameters:
Name Type Argument Description eventNamestring The name of the event to trigger
dataObject <optional>
The event data
- Inherited From:
- Overrides:
- Source:
Type Definitions
-
Options
-
Constructor options for module:nyc/Geoclient~Geoclient
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description urlstring The URL for accessing the Geoclient API (see https://developer.cityofnewyork.us/api/geoclient-api)
projectionstring <optional>
EPSG:3857 The EPSG code of the projection for output geometries (i.e. EPSG:2263)