new Locate(map, geocoder, extentLimitopt)
Class for providing geocoding and device geolocation functionality
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
map |
L.Map | The Leaflet map for use in geolocation | |
geocoder |
nyc.Geocoder | A geocoder implementation | |
extentLimit |
L.LatLngBounds |
<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:
search(input)
Geocode an input string representing a location
Parameters:
Name | Type | Description |
---|---|---|
input |
string | The value to geocode |
- 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: