LocationMapInvoker

Since: BlackBerry 10.0.0

#include <bb/platform/LocationMapInvoker>

To link against this class, add the following line to your .pro file: LIBS += -lbbplatform

An invoker for viewing a certain location (or a set of locations) on a map.

This invoker can be used inside any widget type (in order to give it a certain visual representation) and thus, when that UI component is activated by the user, this invoker will trigger the actual request to map the contents to be displayed.

Example use of this invoker in QML code (in conjunction with a button):
import bb.cascades 1.0
import bb.platform 1.0

Page {
  content: Container {
     layout: DockLayout {}

     attachedObjects:[  
        LocationMapInvoker {
           id: locationInvokerID
             
           // This example shows how to bind properties to pre-defined values.
           // One can bind properties to values coming from other widgets 
           // within this QML page (e.g. text field's input)

           centerLatitude :  45.416667    // Ottawa's latitude
           centerLongitude : -75.7        // Ottawa's longitude
           altitude : 200

           // Request for a given POI (point of interest) to be shown 
           // on the map also.

           locationLatitude : 45.4555
           locationLongitude : -75.68
           locationName : "My Favorite location"
           // 'geocodeLocationEnabled' boolean property is not explicitly set, 
           // so it will be false.

           // Also request for a search around the center of map 
           // (as part of setting properties available on superclass MapInvoker)
           searchText : "Music"
           searchLatitude : 45.416667
           searchLongitude : -75.7
           // 'searchMode' property is not explicitly set, 
           // so this will be a Radial search
        }
     ]

     // Make a Cascades button (or any Cascades widget) 
     // that can be used to trigger location invoker.
     Button {            
        verticalAlignment: VerticalAlignment.Center
        horizontalAlignment: HorizontalAlignment.Center

        text: "Map it"

         // When button is clicked, call the invoker by its ID            
         onClicked: {
            locationInvokerID.go();
         }
     }
  }
}


Overview

Inheritance

bb::platform::MapInvoker
bb::platform::LocationMapInvoker

Public Functions Index

LocationMapInvoker (QObject *parent=0)
virtual ~LocationMapInvoker ()
boolisGeocodeLocationEnabled () const
QStringkmlContent () const
QStringlocationDescription () const
doublelocationLatitude () const
doublelocationLongitude () const
QStringlocationName () const
intaltitude () const Inherited
doublecenterLatitude () const Inherited
doublecenterLongitude () const Inherited
intheading () const Inherited
boolisCurrentLocationEnabled () const Inherited
doublesearchLatitude () const Inherited
doublesearchLongitude () const Inherited
bb::platform::MapSearchMode::TypesearchMode () const Inherited
QStringsearchText () const Inherited

Public Slots Index

voidresetGeocodeLocationEnabled ()
voidresetKmlContent ()
voidresetLocationDescription ()
voidresetLocationLatitude ()
voidresetLocationLongitude ()
voidresetLocationName ()
voidsetGeocodeLocationEnabled (bool enable)
voidsetKmlContent (const QString &content)
voidsetLocationDescription (const QString &description)
voidsetLocationLatitude (double value)
voidsetLocationLongitude (double value)
voidsetLocationName (const QString &name)
voidgo ()Inherited
voidresetAltitude ()Inherited
voidresetCenterLatitude ()Inherited
voidresetCenterLongitude ()Inherited
voidresetCurrentLocationEnabled ()Inherited
voidresetHeading ()Inherited
voidresetSearchLatitude ()Inherited
voidresetSearchLongitude ()Inherited
voidresetSearchMode ()Inherited
voidresetSearchText ()Inherited
voidsetAltitude (int value)Inherited
voidsetCenterLatitude (double value)Inherited
voidsetCenterLongitude (double value)Inherited
voidsetCurrentLocationEnabled (bool enable)Inherited
voidsetHeading (int value)Inherited
voidsetSearchLatitude (double value)Inherited
voidsetSearchLongitude (double value)Inherited
voidsetSearchMode (bb::platform::MapSearchMode::Type mode)Inherited
voidsetSearchText (const QString &text)Inherited

Signals Index

voidgeocodeLocationEnabledChanged (bool enable)
voidkmlContentChanged (const QString &newKmlContent)
voidlocationDescriptionChanged (const QString &newLocationDescription)
voidlocationLatitudeChanged (double newLocationLatitude)
voidlocationLongitudeChanged (double newLocationLongitude)
voidlocationNameChanged (const QString &newLocationName)
voidaltitudeChanged (int newAltitude)Inherited
voidcenterLatitudeChanged (double newCenterLatitude)Inherited
voidcenterLongitudeChanged (double newCenterLongitude)Inherited
voidcurrentLocationEnabledChanged (bool enable)Inherited
voidheadingChanged (int newHeading)Inherited
voidsearchLatitudeChanged (double newSearchLatitude)Inherited
voidsearchLongitudeChanged (double newSearchLongitude)Inherited
voidsearchModeChanged (bb::platform::MapSearchMode::Type newSearchPattern)Inherited
voidsearchTextChanged (const QString &newSearchText)Inherited

Properties

bool geocodeLocationEnabled

Specifies whether the point of interest location needs to be geocoded (or reverse geocoded).

Since:

BlackBerry 10.0.0

QString kmlContent

Specifies all the necessary information about a set of POIs (points of interest).

This information must be presented in the form of a KML document.

Since:

BlackBerry 10.0.0

QString locationDescription

Specifies a single point of interest's description.

Since:

BlackBerry 10.0.0

double locationLatitude

Specifies a single point of interest's latitude.

Since:

BlackBerry 10.0.0

double locationLongitude

Specifies a single point of interest's longitude.

Since:

BlackBerry 10.0.0

QString locationName

Specifies a single point of interest's name.

Since:

BlackBerry 10.0.0

int altitudeInherited

Property specifying the map viewing altitude level.

Since:

BlackBerry 10.0.0

double centerLatitudeInherited

Property containing the map center's latitude.

Since:

BlackBerry 10.0.0

double centerLongitudeInherited

Property containing the map center's longitude.

Since:

BlackBerry 10.0.0

bool currentLocationEnabledInherited

Indicates whether Maps application should start GPS/GeoLocation upon start up.

This will cause the application to perform a transition to device's current location. This is disabled, by default.

Since:

BlackBerry 10.0.0

int headingInherited

Property specifying the orientation for displaying map's contents.

Values are in degrees. Valid values are from 0 to 360. 0 represents a North heading, and 180 represents South heading.

Since:

BlackBerry 10.0.0

double searchLatitudeInherited

Property containing the search center's latitude.

Since:

BlackBerry 10.0.0

double searchLongitudeInherited

Property containing the search center's longitude.

Since:

BlackBerry 10.0.0

bb::platform::MapSearchMode::Type searchModeInherited

Property which specifies a predefined search mode (for example, linear or radial).

See also:

bb::platform::MapSearchMode for the list of search modes.

Since:

BlackBerry 10.0.0

QString searchTextInherited

Property containing the actual user's search text.

Since:

BlackBerry 10.0.0

Public Functions

LocationMapInvoker (

Constructs a LocationMapInvoker instance.

This is the invoker through which users can set map view specific properties.

Parameters
parent

If not 0, the supplied parent will be responsible for deleting this instance.

Since:

BlackBerry 10.0.0

virtual~LocationMapInvoker ()

Destructor.

Since:

BlackBerry 10.0.0

bool isGeocodeLocationEnabled ()

Specifies the need for geocoding the POI's (Point Of Interest) location.

Return:

true if POI's location needs to be geocoded, false otherwise.

Since:

BlackBerry 10.0.0

QString kmlContent ()

Gets the KML content which specifies a set of POIs (Points Of Interest) along with their attributes (for example, latitude, longitude, name, description).

Return:

The KML-formatted content.

Since:

BlackBerry 10.0.0

QString locationDescription ()

Gets the point of interest's description.

Return:

The description value.

Since:

BlackBerry 10.0.0

double locationLatitude ()

Gets the point of interest's latitude.

Return:

The latitude value.

Since:

BlackBerry 10.0.0

double locationLongitude ()

Gets the point of interest's longitude.

Return:

The longitude value.

Since:

BlackBerry 10.0.0

QString locationName ()

Gets the point of interest's name.

Return:

The name value.

Since:

BlackBerry 10.0.0

int altitude ()Inherited

Returns the map viewing altitude level.

Return:

The altitude level value.

Since:

BlackBerry 10.0.0

double centerLatitude ()Inherited

Returns the map center's latitude.

Return:

The map center's latitude.

Since:

BlackBerry 10.0.0

double centerLongitude ()Inherited

Returns the map center's longitude.

Return:

The map center's longitude.

Since:

BlackBerry 10.0.0

int heading ()Inherited

Returns the heading for the map's contents.

Return:

The heading value.

Since:

BlackBerry 10.0.0

bool isCurrentLocationEnabled ()Inherited

Returns true if map contents should show the current location of the device.

Return:

true if contents should display the current location of the device.

Since:

BlackBerry 10.0.0

double searchLatitude ()Inherited

Gets the search center's latitude.

Return:

The search center's latitude.

Since:

BlackBerry 10.0.0

double searchLongitude ()Inherited

Gets the search center's longitude.

Return:

The search center's longitude.

Since:

BlackBerry 10.0.0

bb::platform::MapSearchMode::Type searchMode ()Inherited

Returns the search mode that will be used when performing searches (for example, search along a path or a radial search starting from a given location).

See also:

bb::platform::MapSearchMode for the list of available search modes.

Return:

The search mode.

Since:

BlackBerry 10.0.0

QString searchText ()Inherited

Gets the search term.

The text value is free-form.

Return:

The search text to be used.

Since:

BlackBerry 10.0.0

Public Slots

void resetGeocodeLocationEnabled ()

Disables the geocoding of POI's location.

Since:

BlackBerry 10.0.0

void resetKmlContent ()

Resets the KML content to an undefined value.

Since:

BlackBerry 10.0.0

void resetLocationDescription ()

Resets the point of interest's description to an undefined value.

Since:

BlackBerry 10.0.0

void resetLocationLatitude ()

Resets the point of interest's latitude to an undefined value.

Since:

BlackBerry 10.0.0

void resetLocationLongitude ()

Resets the point of interest's longitude to an undefined value.

Since:

BlackBerry 10.0.0

void resetLocationName ()

Resets the point of interest's name to an undefined value.

Since:

BlackBerry 10.0.0

void setGeocodeLocationEnabled (
  • boolenable)

Enables or disables geocoding of a POI's location.

Parameters
enable

true if geocoding needs to be performed, false otherwise.

Since:

BlackBerry 10.0.0

void setKmlContent (

Sets the KML content specifying a set of POIs (Points Of Interest).

Parameters
content

The KML-formatted content.

Since:

BlackBerry 10.0.0

void setLocationDescription (

Sets the point of interest's description.

Parameters
description

The description value.

Since:

BlackBerry 10.0.0

void setLocationLatitude (
  • doublevalue)

Sets the point of interest's latitude.

Parameters
value

The latitude value.

Since:

BlackBerry 10.0.0

void setLocationLongitude (
  • doublevalue)

Sets the point of interest's longitude.

Parameters
value

The longitude value.

Since:

BlackBerry 10.0.0

void setLocationName (

Sets the point of interest's name.

Parameters
name

The name value.

Since:

BlackBerry 10.0.0

void go ()Inherited

Triggers the actual request.

Depending on the actual invoker instance used, this will send the appropriate request to the Maps application, through the Invocation Framework.

Since:

BlackBerry 10.0.0

void resetAltitude ()Inherited

Resets the map viewing altitude to an undefined value.

Since:

BlackBerry 10.0.0

void resetCenterLatitude ()Inherited

Resets the map center's latitude to undefined value.

Since:

BlackBerry 10.0.0

void resetCenterLongitude ()Inherited

Resets the map center's longitude to an undefined value.

Since:

BlackBerry 10.0.0

void resetCurrentLocationEnabled ()Inherited

Disables the display of the current location of the device.

Since:

BlackBerry 10.0.0

void resetHeading ()Inherited

Resets the map's heading to an undefined value.

Since:

BlackBerry 10.0.0

void resetSearchLatitude ()Inherited

Resets the search latitude to an undefined value.

Since:

BlackBerry 10.0.0

void resetSearchLongitude ()Inherited

Resets the search longitude to an undefined value.

Since:

BlackBerry 10.0.0

void resetSearchMode ()Inherited

Resets the search mode to radial search (bb::platform::MapSearchMode::Radial).

Since:

BlackBerry 10.0.0

void resetSearchText ()Inherited

Clears the search text.

Since:

BlackBerry 10.0.0

void setAltitude (
  • intvalue)
Inherited

Sets the map viewing altitude level.

Parameters
value

The new map viewing altitude.

Since:

BlackBerry 10.0.0

void setCenterLatitude (
  • doublevalue)
Inherited

Sets the map center's latitude.

Parameters
value

The new latitude of the map's center.

Since:

BlackBerry 10.0.0

void setCenterLongitude (
  • doublevalue)
Inherited

Sets the map center's longitude.

Parameters
value

The new longitude of the map's center.

Since:

BlackBerry 10.0.0

void setCurrentLocationEnabled (
  • boolenable)
Inherited

Enables (or disables) the display of the current location of the device.

Parameters
enable

true if current location of the device should be be displayed, false otherwise.

Since:

BlackBerry 10.0.0

void setHeading (
  • intvalue)
Inherited

Sets the heading for the map's contents.

Valid values are in degrees, between 0 and 360.
Parameters
value

The new heading.

Since:

BlackBerry 10.0.0

void setSearchLatitude (
  • doublevalue)
Inherited

Sets the search center's latitude.

Parameters
value

The new search latitude.

Since:

BlackBerry 10.0.0

void setSearchLongitude (
  • doublevalue)
Inherited

Sets the search center's longitude.

Parameters
value

The new search longitude.

Since:

BlackBerry 10.0.0

void setSearchMode (Inherited

Sets the search mode.

Parameters
mode

The search mode.

See also:

bb::platform::MapSearchMode for the list of available modes.

Since:

BlackBerry 10.0.0

void setSearchText (Inherited

Sets the search term.

Parameters
text

The search text.

Since:

BlackBerry 10.0.0

Signals

void geocodeLocationEnabledChanged (
  • boolenable)

Emitted when the flag for geocoding (or reverse geocoding) for a location of interest changes.

Listeners should update the view to display a geocoded/reverse geocoded location. For example, when flag is true and location name is provided, then listener should geocode the location. Also, if flag is true and the location latitude and longitude are available but the location name is not provided, then listener should reverse geocode the location.

Parameters
enable

The new value of the flag.

Since:

BlackBerry 10.0.0

void kmlContentChanged (

Emitted when there was a value change in the KML content of a location of interest.

Listeners should update the view to display the new content, according to new KML document instructions.

Parameters
newKmlContent

The new value of KML content.

Since:

BlackBerry 10.0.0

void locationDescriptionChanged (
  • const QString &newLocationDescription)

Emitted when the description of a location of interest changes.

Listeners should update the view to display the location's new description.

Parameters
newLocationDescription

The new location description.

Since:

BlackBerry 10.0.0

void locationLatitudeChanged (
  • doublenewLocationLatitude)

Emitted when the latitude coordinate of a location of interest changes.

Listeners should update the view to display the location at the new position.

Parameters
newLocationLatitude

The new latitude value.

Since:

BlackBerry 10.0.0

void locationLongitudeChanged (
  • doublenewLocationLongitude)

Emitted when the longitude coordinate of a location of interest changes.

Listeners should update the view to display the location at the new position.

Parameters
newLocationLongitude

The new longitude value.

Since:

BlackBerry 10.0.0

void locationNameChanged (

Emitted when the name of a location of interest changes.

Listeners should update the view to display the location's new name.

Parameters
newLocationName

The new location name.

Since:

BlackBerry 10.0.0

void altitudeChanged (
  • intnewAltitude)
Inherited

Emitted when the viewing altitude changes.

Listeners should update the view to reflect the new altitude.

Parameters
newAltitude

The new value of the viewing altitude.

Since:

BlackBerry 10.0.0

void centerLatitudeChanged (
  • doublenewCenterLatitude)
Inherited

Emitted when the latitude coordinate of the map's center changes.

Listeners should update the view to reflect the new map center.

Parameters
newCenterLatitude

The new latitude of the map's center.

Since:

BlackBerry 10.0.0

void centerLongitudeChanged (
  • doublenewCenterLongitude)
Inherited

Emitted when the longitude coordinate of the map's center changes.

Listeners should update the view to reflect the new map center.

Parameters
newCenterLongitude

The new longitude of the map's center.

Since:

BlackBerry 10.0.0

void currentLocationEnabledChanged (
  • boolenable)
Inherited

Emitted when the flag controlling the display of the current device location changes.

Listeners should update the view to display the current location.

Parameters
enable

The new value of the flag.

Since:

BlackBerry 10.0.0

void headingChanged (
  • intnewHeading)
Inherited

Emitted when the map's heading changes.

Listeners should update the view to reflect the new heading.

Parameters
newHeading

The new value of the map's heading.

Since:

BlackBerry 10.0.0

void searchLatitudeChanged (
  • doublenewSearchLatitude)
Inherited

Emitted when the latitude coordinate of search location changes.

Listeners should update the view to reflect the new search position.

Parameters
newSearchLatitude

The new value of the latitude coordinate.

Since:

BlackBerry 10.0.0

void searchLongitudeChanged (
  • doublenewSearchLongitude)
Inherited

Emitted when the longitude coordinate of search location changes.

Listeners should update the view to reflect the new search position.

Parameters
newSearchLongitude

The new value of the longitude coordinate.

Since:

BlackBerry 10.0.0

void searchModeChanged (Inherited

Emitted when the search mode changes.

Listeners should update to reflect the new search mode.

Parameters
newSearchPattern

The new search mode.

See also:

bb::platform::MapSearchMode for the list of available search modes.

Since:

BlackBerry 10.0.0

void searchTextChanged (Inherited

Emitted when the search text changes.

Listeners should update to reflect the new search text.

Parameters
newSearchText

The new value of the search text.

Since:

BlackBerry 10.0.0

Last modified: 2014-06-24



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus