Class: GeoLocationWidget

GeoLocationWidget

This Widget provides the current position of the device.

new GeoLocationWidget()

Extends

Requires

  • module:easejs
  • module:Widget
  • module:AttributeType
  • module:AttributeValue
  • module:AttributeTypeList
  • module:AttributeValueList
  • module:Callback
  • module:Parameter

Members

protectedattributesAttributeValueList

All available Attributes and their values.

protectedattributeTypesAttributeTypeList

Types of all available attributes.

protectedcallbacksCallbackList

List of Callbacks.

protectedconstantAttributesAttributeValueList

All available constant Attributes and their values.

protectedconstantAttributeTypesAttributeTypeList

Types of all available ConstantAttributes.

protecteddiscovererDiscoverer

Associated discoverer.

idstring

ID of the Widget. Will be generated.

namestring

Name of the Widget. In this case: GeoLocationWidget

protectedoldAttributesAttributeValueList

This temporary variable is used for storing the old attribute values. So these can be used to check conditions.

protectedsubscribersSubscriberList

List of Subscriber.

Methods

inherited addAttribute(_attribute)

Adds a new AttributeValue. If the given value is not included in the list, the associated type will be also added. Otherwise, only the value will be updated.
Name Type Description
_attribute AttributeValue AttributeValue

inherited protectedaddCallback(_callback)

Adds a new Callback.
Name Type Description
_callback Callback List or Array of AttributeValues.

inherited protectedaddConstantAttribute(_constantAttribute)

Adds a new constantAttributeValue. If the given value is not included in the list, the associated type will be also added. Otherwise, only the value will be updated.
Name Type Description
_constantAttribute AttributeValue AttributeValue

inherited addSubscriber(_subscriber)

Adds a new Subscriber.
Name Type Description
_subscriber Subscriber Subscriber

inherited privatedataValid(_conditions){boolean}

Verifies if the attributes match to the specified conditions in case any exists.
Name Type Description
_conditions string List of Conditions that will be verified.

inherited privategetCurrentTime(){Date}

Returns the current time.
Returns the id of the widget.

inherited getName(){string}

Returns the name of the widget.
Returns the old Attributes.
Returns the Subscriber.

inherited abstractgetType(){string}

Returns the type of this class, in this case "Widget".
Returns the available AttributeTypes.

inherited getWidgetConstantAttributeTypes(){AttributeTypeList}

Returns the available ConstantAttributeTypes (attributes that do not change).

inherited abstractgetWidgetDescription(){WidgetDescription}

Returns the description of this component.
Function for initializing. Calls all initFunctions and will be called by the constructor.

protectedinitAttributes()

Initializes attributes. For this class: Latitude and Longitude

protectedinitCallbacks()

Initializes Callbacks. For this class: UPDATE (latitude and longitude)

protectedinitConstantAttributes()

Initializes constantAttributes. For this class: no constantAttributes available

inherited abstract,protectedintervalRunning(_interval)

Runs the context acquisition constantly in an interval. Can be called by init.
Name Type Description
_interval integer Interval in ms

inherited protectedisAttribute(_attribute){boolean}

Verifies whether the specified attributes is a provided Attribute.
Name Type Description
_attribute AttributeValue

inherited abstractputData(_data)

Updates the Attributes by external components.
Name Type Description
_data AttributeValueList | Array Data that should be entered.
Returns the last acquired Attributes.
Returns the specified Callbacks that can be subscribed.
Returns the ConstantAttributes.

protectedqueryGenerator()

Implements queryGenerator(). Query latitude and longitude by calling navigator.geolocation.getCurrentPosition().
Returns all available AttributeValues, Attributes and ConstantAtrributes.
Registers the component to the associated Discoverer.

inherited removeSubscriber(_subscriber)

Removes the specified Subscriber.
Name Type Description
_subscriber Subscriber Subscriber

inherited protectedsendToSubscriber(_callbackName)

Sends all Attributes, specified in the given callback, to components which are subscribed to this Callback.
Name Type Description
_callbackName string Name of the searched Callback.

inherited protectedsetAttributes(_attributes)

Sets the AttributeValueList and also the associated AttributeTypes.
Name Type Description
_attributes AttributeValueList | Array List or Array of AttributeValues

inherited protectedsetCallbacks(_callbacks)

Sets Callbacks.
Name Type Description
_callbacks CallbackList | Array List or Array of Callbacks.

inherited protectedsetConstantAttributes(_constantAttributes)

Sets the ConstantAttributeValueList and also the associated AttributeTypes.
Name Type Description
_constantAttributes AttributeValueList | Array List or Array of AttributeValues

inherited setDiscoverer(_discoverer)

Sets the associated Discoverer and registers to that.
Name Type Description
_discoverer Discoverer Discoverer

inherited protectedsetId(_id)

Sets the id of the Widget.
Name Type Description
_id string Id of the Widget.

inherited protectedsetName(_name)

Sets the name of the Widget.
Name Type Description
_name string Name of the Widget.

inherited protectedsetSubscriber(_subscriber)

Sets SubscriberList.
Name Type Description
_subscriber SubscriberList | Array List or Array of Subscriber.

inherited updateAndQueryWidget(_function){AttributeValueList}

Updates and returns all available AttributeValues, Attributes and ConstantAtrributes.
Name Type Description
_function function nullable For alternative actions, because an asynchronous function can be used.

inherited updateWidgetInformation(_function)

Updates the attributes by calling queryGenerator.
Name Type Description
_function function nullable For alternative actions, because an asynchronous function can be used.

Type Definitions

onError

Error function for navigator.geolocation.getCurrentPosition() used in queryGenerator().

onSuccess

Success function for navigator.geolocation.getCurrentPosition() used in queryGenerator(). Stores the values in the associated attributes.