mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
update website
This commit is contained in:
@@ -4,7 +4,7 @@ in Info.plist to enable geolocation. Geolocation is enabled by default
|
||||
when you create a project with <code>react-native init</code>.</p><h3><a class="anchor" name="android"></a>Android <a class="hash-link" href="#android">#</a></h3><p>To request access to location, you need to add the following line to your
|
||||
app's <code>AndroidManifest.xml</code>:</p><p><code><uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /></code></p></div><span><h3><a class="anchor" name="methods"></a>Methods <a class="hash-link" href="#methods">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="getcurrentposition"></a><span class="propType">static </span>getCurrentPosition<span class="propType">(geo_success: Function, geo_error?: Function, geo_options?: GeoOptions)</span> <a class="hash-link" href="#getcurrentposition">#</a></h4><div><p>Invokes the success callback once with the latest location info. Supported
|
||||
options: timeout (ms), maximumAge (ms), enableHighAccuracy (bool)</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="watchposition"></a><span class="propType">static </span>watchPosition<span class="propType">(success: Function, error?: Function, options?: GeoOptions)</span> <a class="hash-link" href="#watchposition">#</a></h4><div><p>Invokes the success callback whenever the location changes. Supported
|
||||
options: timeout (ms), maximumAge (ms), enableHighAccuracy (bool)</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="clearwatch"></a><span class="propType">static </span>clearWatch<span class="propType">(watchID: number)</span> <a class="hash-link" href="#clearwatch">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="stopobserving"></a><span class="propType">static </span>stopObserving<span class="propType">()</span> <a class="hash-link" href="#stopobserving">#</a></h4></div></div></span></div><div><table width="100%"><tbody><tr><td><h3><a class="anchor" name="examples"></a>Examples <a class="hash-link" href="#examples">#</a></h3></td><td style="text-align:right;"><a target="_blank" href="https://github.com/facebook/react-native/blob/master/Examples/UIExplorer/GeolocationExample.js">Edit on GitHub</a></td></tr></tbody></table><div class="prism language-javascript"><span class="token comment" spellcheck="true">/* eslint no-console: 0 */</span>
|
||||
options: timeout (ms), maximumAge (ms), enableHighAccuracy (bool), distanceFilter(m)</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="clearwatch"></a><span class="propType">static </span>clearWatch<span class="propType">(watchID: number)</span> <a class="hash-link" href="#clearwatch">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="stopobserving"></a><span class="propType">static </span>stopObserving<span class="propType">()</span> <a class="hash-link" href="#stopobserving">#</a></h4></div></div></span></div><div><table width="100%"><tbody><tr><td><h3><a class="anchor" name="examples"></a>Examples <a class="hash-link" href="#examples">#</a></h3></td><td style="text-align:right;"><a target="_blank" href="https://github.com/facebook/react-native/blob/master/Examples/UIExplorer/GeolocationExample.js">Edit on GitHub</a></td></tr></tbody></table><div class="prism language-javascript"><span class="token comment" spellcheck="true">/* eslint no-console: 0 */</span>
|
||||
<span class="token string">'use strict'</span><span class="token punctuation">;</span>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user