Back

CreateLocator

Returns a Locator object.

For more information in the detailed docs see CreateLocator

  loc = app.CreateLocator( type, options ) → app object - Locator

Example - Example



function OnStart()
{
    loc = app.CreateLocator("GPS,Network");
    loc.SetOnChange(loc_OnChange);
    loc.Start();
    app.ShowPopup("Locating");
}

function loc_OnChange(pos)
{
    var msg = pos.latitude + ", " + pos.longitude;
    app.ShowPopup( msg );
}
    Copy     Copy All       Run      

The following methods are available on the Locator object:

  GetBearingTo( latitude, longitude ) → unknown
  GetDistanceTo( latitude, longitude ) → unknown
  GetType() → string: "Locator"
  Method( name, types, p1, p2, p3, p4 )
  SetRate( rate )
  Start()
  Stop()

string: "GPS" or "Network" or "?"
unknown
number
?
?
Returns the control class name.
string
string: comma separated: "boolean", "char", "byte", "short", "int", "long", "float", "double"
Allows access to other functions defined on the object in Java via reflection.
function(data)
called when some of the values changed
number: seconds
update interval
start locator
stop locator