Section 1

Preview this deck

PositionError Object

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (8)

Section 1

(8 cards)

PositionError Object

Front

code: - PERMISSION_DENIED - POSITION_UNAVAILABLE - TIMEOUT message:

Back

location options

Front

enableHighAccuracy: bool: get better accuracy if true - default=false timeout: long: maximum length of time (in milliseconds) the devices is allowed to take in order to return a position - default=Infinity maximumAge: long: maximum age in milliseconds of a possible cached position that is acceptable to return. If 0, device cannot use cached value and must retrieve real current position. if Infinity must use cached position. - default=0

Back

clearWatch()

Front

clears a watch handler params: - watchID

Back

Get current position

Front

navigator.geolocation.getCurrentPosition(success, error, options); success and error are functions, options is an object

Back

Check for geolocation api

Front

if ("geolocation" in navigator) { // available } else { // not available }

Back

Position Object

Front

coords: coordinates object timestamp: readonly

Back

coordinates object

Front

- latitude: decimal degrees - longitude: decimal degrees - altitude: meters from sea level (can be null) - accuracy: meters - heading: degrees from north with 0 being north. NaN if speed is 0 and null if no information avalible - speed: meters per second

Back

watchPosition()

Front

registers a handler function that will be called automatically each time the position of the device changes. params: - success: function - error: function - options: PositionOptions

Back