maps.nyc.gov

Class: Tracker

nyc.ol.Tracker

new Tracker(options)

A class for tracking position from device Geolocation
Parameters:
Name Type Description
options nyc.ol.Tracker.Options Constructor options
Source:
See:
Fires:

Extends

  • ol.Geolocation

Members

(static) EventType :string

Enumeration for tracker event types
Type:
  • string
Properties:
Name Type Description
UPDATED string The updated event type
Source:

accuracyLimit :number

Type:
  • number
Source:

currentZoomLevel :boolean

Type:
  • boolean
Source:

maxPoints :number

Type:
  • number
Source:

positions :Array.<ol.Feature>

Type:
  • Array.<ol.Feature>
Source:

recenter :boolean

Type:
  • boolean
Source:

rotate :boolean

Type:
  • boolean
Source:

skipViewUpdate :number

Type:
  • number
Source:

startingZoomLevel :number

Type:
  • number
Source:

track :ol.geom.LineString

Type:
  • ol.geom.LineString
Source:

Methods

restore()

Restore previous tracking data if available
Source:

setTracking(tracking)

Enable or disable tracking
Parameters:
Name Type Description
tracking boolean Whether or not to track position
Source:
See:

updateView(position)

Orient the view to the current position
Parameters:
Name Type Description
position ol.Coordinate | ol.Feature
Source:

Type Definitions

Options

Object type to hold constructor options for nyc.ol.Tracker
Type:
  • Object
Properties:
Name Type Attributes Default Description
map ol.Map The map on which to track locations
trackingOptions GeolocationPositionOptions <optional>
Tracking options @see http://www.w3.org/TR/geolocation-API/#position_options_interface
recenter boolean <optional>
true Recenter the view on location change
rotate boolean <optional>
true Rotate the view on location change
showNorth boolean <optional>
true Show a north arrow on the map
maxPoints number <optional>
0 The maximum number of points to retain in the track (0 = unlimited)
startingZoomLevel number <optional>
16 The zoom for the view when tracking begins
currentZoomLevel boolean <optional>
false Use the current zoom level of the view when tracking begins and ignore startingZoomLevel
accuracyLimit number <optional>
0 The maximum accuracy distance for an acceptable position (0 = unlimited)
Source:

Events

updated

The updated event
Type:
  • ol.events.Event
Source: