-
Notifications
You must be signed in to change notification settings - Fork 0
API Cheat Sheet [geo5]
bapquad edited this page Feb 26, 2022
·
2 revisions
Working with GPS on web technology.
For using the geo5
module, let's import this module like as following line.
import {geo5} from '@bapquad/element5'
Retrieves the location of device.
Parameter
- Has no parameter.
Return
Returns the geo5
object.
Example
import {geo5} from '@bapquad/element5'
geo5.onDetect(function(e)
{
console.log(e.position.coords.latitude);
console.log(e.position.coords.longitude);
});
let pos = geo5.GetPosition();
console.log(pos);
Retrieves the location of device.
Parameter
- Has no parameter.
Return
Returns the geo5
object.
Example
import {geo5} from '@bapquad/element5'
geo5.onDetect(function(e)
{
console.log(e.position.coords.latitude);
console.log(e.position.coords.longitude);
});
let pos = geo5.GetLocation();
console.log(pos);
Retrieves the location of device.
Parameter
- Has no parameter.
Return
Returns the geo5
object.
Example
import {geo5} from '@bapquad/element5'
geo5.onDetect(function(e)
{
console.log(e.position.coords.latitude);
console.log(e.position.coords.longitude);
});
let pos = geo5.GetCurrentPosition();
console.log(pos);
Retrieves the location of device.
Parameter
- Has no parameter.
Return
Returns the geo5
object.
Example
import {geo5} from '@bapquad/element5'
geo5.onDetect(function(e)
{
console.log(e.position.coords.latitude);
console.log(e.position.coords.longitude);
});
let pos = geo5.GetCurrentLocation();
console.log(pos);
Scan the position.
Parameter
- Has no parameter.
Return
Returns the geo5
object.
Example
import {geo5} from '@bapquad/element5'
geo5.onDetect(function(e)
{
console.log(e.position.coords.latitude);
console.log(e.position.coords.longitude);
});
let pos = geo5.Scan();
console.log(pos);
Scan current position of the device.
Parameter
-
success:function
- The event handle occurs if get location successfully. Required -
error:function
- The event handle occurs if get location failure. Optional -
options:object
- The options for scan. Optional
Return
Returns the geo5
object.
Example
import {geo5} from '@bapquad/element5'
let geo = geo5.ScanWith(function(e)
{
console.log(e.position.coords.latitude);
console.log(e.position.coords.longitude);
});
// Print the geo
console.log(geo);
Resets current position of the device for preparing to search new session.
Parameter
- Has no parameter.
Return
Returns the geo5
object.
Example
import {geo5} from '@bapquad/element5'
let geo = geo5.ScanWith(function(e)
{
console.log(e.position.coords.latitude);
console.log(e.position.coords.longitude);
geo5.Reset();
});
// Print the geo
console.log(geo);
Bapquad Games since 2015
- Get Started
- Working with DOM
- Constructing the StyleSheet
- Working with Sprite
- Working with Timeline
- Working with Scroller
- Working with Camera
- Working with Microphone
- Making the Ajax Request
- Opening a Websocket
- Working with Storage
- Checking User Agent
- Working with GPS
- Working with Router
- Playing the Stream