Members
(static) EventType :string
Enumeration for locate event type
Type:
- string
Properties:
Name | Type | Description |
---|---|---|
GEOCODE |
string | The geocode event type |
GEOLOCATION |
string | The geolocation event type |
AMBIGUOUS |
string | The ambiguous event type |
ERROR |
string | The ambiguous event type |
(static) ResultType :string
Enumeration for locate result type
Type:
- string
Properties:
Name | Type | Description |
---|---|---|
GEOCODE |
string | The geocode result type |
GEOLOCATION |
string | The geolocation result type |
Methods
(abstract) locate()
Locate once using device geolocation
(abstract) search(input)
Geocode an input string representing a location
Parameters:
Name | Type | Description |
---|---|---|
input |
string | The value to geocode |
(abstract) track(track)
Track using device geolocation
Parameters:
Name | Type | Description |
---|---|---|
track |
boolean | Track or not |
Type Definitions
Ambiguous
Object type to hold data about possible locations resulting from a geocoder search
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
input |
string | The input string on which the geocoding attempt was made |
possible |
Array.<nyc.Locate.Result> | An array of possible results to the request |
Result
Object type to hold data about a successful result of a geocoder search or device geolocation
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | The formatted name of the geocoded location | |
coordinates |
Array.<number> | undefined | The geocoded location coordinates | |
accuracy |
number | The accuracy of the geocoded location in meters or units of a specified projection | |
type |
nyc.Locate.ResultType | They type of result | |
zip |
boolean |
<optional> |
Is this the geocoded location a ZIP Code center point |
geoJsonGeometry |
Object |
<optional> |
A geoJSON representation of the geocoded location coordinates |
data |
Object |
<optional> |
Additional properties provided by the geocoder |
Events
ambiguous
The result of an inconclusive search request
Type:
error
The error object from a locate request error
Type:
- Object
geocode
The result of a search request
Type:
geolocation
The result of a locate request