MapLongPressToPinDrop
#include <bb/cascades/maps/MapLongPressToPinDrop>
To link against this class, add the following line to your .pro file: LIBS += -lbbcascadesmaps
A utility action class for performing a pin drop, which is the creation of a new point of interest (pin) triggered by a user's action.
This class connects to the MapView::mapLongPressed() signal. When a user performs a long-press on an empty map space, this class creates the new pin.
Create a new GeoLocation at the point the map was pressed.
Asynchronously initiate a reverse geocode to get the street address.
Set the map's focus to the new pin.
Emit a pinCreated() signal.
Update the name of the GeoLocation with the address information, when the reverse geocode has completed.
This action is connected to a MapView instance. When the action and a map are associated, the MapView object becomes the parent of the action object. Thus, when an instance of this class has been created and associated with a MapView instance, the instance should not be explicitly destroyed by the client.
To connect this action to a MapView instance: When a new pin is created, the corresponding new GeoLocation object is added to the associated MapView's MapData object. To retrieve the new GeoLocation when the pinCreated() signal is emitted:
BlackBerry 10.0.0
Public Functions Index
| MapLongPressToPinDrop (bb::cascades::maps::MapView *map) | |
| virtual | ~MapLongPressToPinDrop () |
Signals Index
| void | pinCreated (const QString &id) |
| void | reverseGeocodeFinished (const QString &id, bool success) |
Public Functions
Constructor.
| Parameters | |
|---|---|
| map |
The MapView control that this action is to be associated with. This parameter is required and can't be NULL. |
BlackBerry 10.0.0
virtual
Destructor.
BlackBerry 10.0.0
Signals
void
Emitted when a new pin is created.
| Parameters | |
|---|---|
| id |
The ID of the new Geographic entity. |
BlackBerry 10.0.0
void
Emitted when the reverse geocode of the address of a new pin has completed.
| Parameters | |
|---|---|
| id |
The ID of the Geographic that was reverse geocoded. |
| success |
true if the reverse geocode succeeded, false otherwise. |
BlackBerry 10.0.0