Sharing a location
Find and share your favorite places
The My Places framework provides a central repository for places. A place is a location on a map, an address, or a point of interest. My Places is a repository of places that are saved by the user by many applications. You can display a place in a full screen UI component using the PlacePickerControl, and allow the user to browse, edit, or save place details in the places database using the PlacePicker class.
You can find and manage places from anywhere in your app. The user can conduct a search, access the location on a map, navigate to the place, and share it. You can use the SelectedPlace and SelectedPlaceImageType classes to extract information about the place that the user wants to share. Using the My Places framework, you can also read and write to the places database programmatically.
To use the places classes, you must add the following line to the .pro file in your project:
LIBS += -lbbcascadesplacesTo enable your app to access the places framework, you must add Location permissions to your bar-descriptor.xml file. For more information, see Location.
Visit the Sample Apps page to download a place picker sample app that demonstrates how to add a PlacePicker as an attached object and use the show() function to let the user select a place from the places database.
Integrating with BlackBerry Maps
Cascades lets you integrate maps with the invocation framework. You can use the MapInvoker class to trigger map-related invocation requests. You can make any location in an app a fully actionable link. You can use the LocationMapInvoker class to use a location as a link and integrate your app with other apps on the device. You can trigger navigation in a map using the RouteMapInvoker class. You can use the invocation framework to:
- Invoke the BlackBerry Maps app. BlackBerry Maps is a voice-guided map application that allows the user to see turn-by-turn navigation and real-time traffic in a two-dimensional rendering of a map on the device.
- Start a navigation session, providing a starting address and a destination, using MapNavigationMode to specify whether navigation should use the fastest or shortest route and MapTransportationMode to specify whether you are navigating in a car or as a pedestrian.
- Search with keywords to find an address, using MapSearchMode to specify if searching should be performed in circles around the radius of a location or performed along a path.
- Find a point of interest using data stored in JavaScript Object Notation (JSON) format. For more information about working with JSON data, see Data storage.
Visit the Sample Apps page to download a sample app that demonstrates how to use the RouteMapInvoker class to navigate to a location. The route map invoker sample interacts with the My Places database and lets you choose routes to your favourite places, your recent places, or your contacts locations.
Last modified: 2013-03-21