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

Reply
Developer
Posts: 75
Registered: ‎09-12-2012
My Device: Looking for a BB10 testing device
My Carrier: Developper

How to show markers in a mapView ?

Hi all,

I can't find any solution to show points (markers) in a mapView.

 

Anyone have a sample ?

 

Thanks.

---------
Mobile developer freelance - QtQuick - Cascades - WP7 - Android
My works : http://fdelgado.fr
Developer
Posts: 1,645
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: How to show markers in a mapView ?

from the Release Notes:

 

 

Push pins for geographic data on a MapView control

  • Push pins are added to MapView through MapData. MapData for a Mapview is obtained by calling the mapData() function. Push pins can be added through MapData::add(bb::smileytongue:latform::geo::Geographic *geo) or MapData::add(const bb::smileytongue:latform::geo::GeoList &elements). If you add the push pins to the MapView, the push pins will not render at all. Subsequently, the user is not able to interact with push pins. Bubbles around the push pins will not render either. The APIs do not show any errors during compilation or cause an unexpected termination at runtime.
-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Developer
Posts: 75
Registered: ‎09-12-2012
My Device: Looking for a BB10 testing device
My Carrier: Developper

Re: How to show markers in a mapView ?

Yes I already read that, did you try it ?

---------
Mobile developer freelance - QtQuick - Cascades - WP7 - Android
My works : http://fdelgado.fr
Developer
Posts: 91
Registered: ‎09-25-2012
My Device: bb10 alpha
My Carrier: free

Re: How to show markers in a mapView ?

Yes, could you try please  ?

a lover of Qt
Developer
Posts: 285
Registered: ‎08-06-2010
My Device: Z10

Re: How to show markers in a mapView ?

[ Edited ]

Map pins cannot be rendered on the MapView right now. I've almost completed a sample project that I'll upload to Github where you can use a WebView and OpenStreetMaps in order to get some form of reasonable mapping pre-launch.



Follow me on twitter @RileyGB - https://twitter.com/RileyGB
View my BB10 OpenSource projects - https://github.com/RileyGB/BlackBerry10-Samples
Developer
Posts: 75
Registered: ‎09-12-2012
My Device: Looking for a BB10 testing device
My Carrier: Developper

Re: How to show markers in a mapView ?

Thanks searingmedia could you give us your link when you'll finish it ?

 

Do you know why pins cannot be rendered on the MapView ?

 

Thanks.

---------
Mobile developer freelance - QtQuick - Cascades - WP7 - Android
My works : http://fdelgado.fr
Developer
Posts: 285
Registered: ‎08-06-2010
My Device: Z10

Re: How to show markers in a mapView ?

Some sort of bug in the implementation I would think, refer to the release notes that Ekke posted above.



Follow me on twitter @RileyGB - https://twitter.com/RileyGB
View my BB10 OpenSource projects - https://github.com/RileyGB/BlackBerry10-Samples
Developer
Posts: 408
Registered: ‎06-03-2010
My Device: Z10 Red
My Carrier: Free

Re: How to show markers in a mapView ?

[ Edited ]

GeoLocation* loc = new GeoLocation(lat, lng, mapView);

loc->marker().setIconUri("asset:///images/marker_me.png");

mapView->mapData()->add(loc);

 

But the image is not set even with loc->setIconUri("asset:///images/marker_me.png");

Developer
Posts: 16,637
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to show markers in a mapView ?

we invoke the map application as we did not get the marker on the mapview to work.
to get the invoke working it was important to set both a title and a description, otherwise the marker would not be displayed.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 285
Registered: ‎08-06-2010
My Device: Z10

Re: How to show markers in a mapView ?

Thanks for the tip Simon, I had given up on the locationmapinvoker just yesterday. 



Follow me on twitter @RileyGB - https://twitter.com/RileyGB
View my BB10 OpenSource projects - https://github.com/RileyGB/BlackBerry10-Samples