FuseJS/GeoLocation Module (JS)
Provides geolocation services.
Using geolocation services requires device authorization. Including the Fuse.GeoLocation
package
in your project will trigger a prompt for this authorization when the app is launched.
Use startListening to get continual location updates. Use location or getLocation for one-time location requests.
You need to add a reference to "Fuse.GeoLocation"
in your project file to use this feature.
This module is an EventEmitter, so the methods from EventEmitter can be used to listen to events.
Example
The following example shows how the different modes of operation can be used:
To handle errors from GeoLocation we can listen to the "error"
event, as follows:
GeoLocation.on("error", function(err) { ... })
Location
- Namespace
- Fuse.GeoLocation
- Package
- Fuse.GeoLocation 2.9.1
Interface of GeoLocation
GetAuthorizationStatus() js
Returns the authorization status of GeoLocation
location : Location js
getLocation(timeout) js
isLocationEnabled() js
Returns whether or not the device has Geolocation enabled.
changed(location) js
error(error) js
Raised when an error occurs.
authorizationRequest js
startListening(minimumReportInterval, desiredAccuracy) js
stopListening() js
NativeEventEmitterModule
Inherited fromEmit(object[]) uno
EmitError(string) uno
Call emit("error", reason)
on the underlying JS EventEmitter.
EmitErrorObject(string) uno
Call emit("error", new Error(reason))
on the underlying JS EventEmitter.
EmitFactory(Func<Context, object[]> (Context)) uno
EmitFactory<T>(Func<Context, T, object[]> (Context, T), T) uno
On(object, Callback (Context, object[])) uno
Connect a Callback to an event.
On(object, NativeEvent) uno
NativeModule
Inherited fromAddMember(NativeMember) uno
Reset : EventHandler (object, EventArgs) ux
Module
Inherited fromDispose uno
Evaluate(Context, ModuleResult) uno
Evaluate(Context, string) : ModuleResult uno
Evaluated : EventHandler (object, EventArgs) ux
EvaluateExports(Context, string) : object uno
GetFile : FileSource uno
Returns the file source that will be watched by the Context for changes in Fuse preview. Override in subclasses and return correct file source to support live updates in Fuse preview.