Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Super Contributor
Posts: 398
Registered: ‎01-12-2011
My Device: Q10
My Carrier: Fido
Accepted Solution

MapView navigation?

[ Edited ]

Hi,

 

I have successfully created a MapView (bb::cascades::maps::MapView) and have added one GeoLocation (bb:: platform::geo::GeoLocation) which shows a marker on the map.

 

I have added a name and description to my location:

 

location->setName("Point of interest");

location->setDescription("This point is interesting");

 

So when I click on the marker the little bubble pops up showing me 3 things:

 

-The GeoLocation's Name. "Point of interest"

-The GeoLocation's Description. "This point is interesting"

-A button with an arrow on it.

 

The arrow on the button is usually associated with the ability to navigate to the marker in question. How do I capture a button press from this button? And more importantly, how can I start navigation when the button is pressed?

 

Thanks!

Highlighted
Developer
Posts: 358
Registered: ‎04-13-2013
My Device: Z10
My Carrier: Telus

Re: MapView navigation?

For Navigation you'll need to use the RouteInvoker

 

To use this you'll need this in your main.cpp:

#include <bb/platform/RouteMapInvoker>

qmlRegisterType<bb::platform::RouteMapInvoker>("bb.platform", 1, 0, "RouteMapInvoker");
	    bb::data&colon;:DataSource::registerQmlTypes();

 ^put that right under this code in your main.cpp:

 

Q_DECL_EXPORT int main(int argc, char **argv)
{

 As well as attach this in your qml:

RouteMapInvoker {
            
            id: routeInvoker
        
        }

 And then onClicked or onTouch use this:

onTriggered: {
                routeInvoker.endLatitude = listItemLat.text <<<the latitude you want to go to
                routeInvoker.endLongitude = listItemLon.text <<<the longitude you want to go to
                routeInvoker.go() <<<calls the function
            }