Class Index | File Index

Classes


Class M.Location


Extends M.Object.
M.Location defines a prototype for a location object. It is mainly used by the M.LocationManager and contains properties like latitude and longitude, that specify the retrieved location.
Defined in: location.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
 
This property specifies the location's accuracy in meters.
 
The date this location was retrieved.
 
The latitude of this location.
 
The longitude of this location.
 
This method contains a reference to the specified error callback method.
 
This method contains a reference to the specified success callback method.
 
The type of this object.
Method Summary
Method Attributes Method Name and Description
 
init(latitude, longitude)
This method initializes an M.Location object with the passed latitude and longitude parameters.
 
This method is called automatically as the error callback of the update().
 
This method is called automatically as the success callback of the update().
 
update(caller, onSuccess, onError, options)
This method is used to automatically update the location.
Methods borrowed from class M.Object:
bindToCaller, create, destroy, extend, get, include, set
Class Detail
M.Location()
Field Detail
{Number} accuracy
This property specifies the location's accuracy in meters.

{M.Date} date
The date this location was retrieved.

{Number} latitude
The latitude of this location.

{Number} longitude
The longitude of this location.

{Function} onUpdateError
This method contains a reference to the specified error callback method.

{Function} onUpdateSuccess
This method contains a reference to the specified success callback method.

{String} type
The type of this object.
Method Detail
init(latitude, longitude)
This method initializes an M.Location object with the passed latitude and longitude parameters. This method can be used to manually create an M.Location object if the position is already known. To create an M.Location object with the user's current position, you will have to use the M.LocationManager, respectively its getLocation() method. Nevertheless you can use this method to initialiy create an M.Location object with a specified location and then later use its update() method to retrieve the real and current location of the user / device.
Parameters:
{Number} latitude
The latitude of the location.
{Number} longitude
The longitude of the location.

onUpdateErrorInternal(position)
This method is called automatically as the error callback of the update(). After updating this location object, the external error callback is called.
Parameters:
{Object} position
The error that occurred.

onUpdateSuccessInternal(position)
This method is called automatically as the success callback of the update(). After updating this location object, the external success callback is called.
Parameters:
{Object} position
The position object of the Geolocation API.

update(caller, onSuccess, onError, options)
This method is used to automatically update the location. Since this is an asyncrhonous process, you have to specify two callback methods in case of success or error. additionally you can pass along options to configure the retrieving process. For further information about the parameters, check out getLocation() in M.LocationManager since this method is called out of update(). If the update was successful, the properties of the location object are updated and your specified callback is called (without parameter). If the update goes wrong, your specified error callback is called with the error message as its only parameter. The error message will be one of the following constant string values: - PERMISSION_DENIED - POSITION_UNAVAILABLE - TIMEOUT - UNKNOWN_ERROR - NOT_SUPPORTED
Parameters:
{Object} caller
The object, calling this function.
{Object} onSuccess
The success callback.
{Object} onError
The error callback.
{Object} options
The options for retrieving a location.

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Jan 25 2012 20:41:10 GMT+0100 (MEZ)