Skip to content

A simple react component which wraps the navigator.geolocation api

License

Notifications You must be signed in to change notification settings

joelvoss/react-geolocation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Geolocation

This repository contains a simple react component which wraps the navigator.geolocation api.

Usage

$ git clone ...
$ cd react-geolocation
$ npm run start

Options

The following options can be set as props:

  • enableHighAccuracy: Higher accuracy, but slower and power consuming.
  • maximumAge: Defines how old the cached position is allowed to be before returning a new position.
  • timeout: Time before the query times out.
  • watch: Defines if the geolocation should be watched.
  • errorMessages: Array of error messages corrensponding to the three error codes (1, 2, 3).
  • onChange: Subscription callback, which gets called every time the location changes or an error is thrown.

About

A simple react component which wraps the navigator.geolocation api

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published