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

Posts: 1
Registered: ‎01-21-2013
My Device: DevAlpha
My Carrier: T-Mobile

Once upon a time in a Geolocation (MapView) world a developer went crazy

The crazy developer a.k.a. me, wants to create a custom marker with an icon on a MapView and this is his story.


After updating the BB10 SDK from to on the 11th January 2013 I've tried to check if setting a geo marker on the BB10 Map component would finally work.
I've run the previous code that I had:

CustomMapView::CustomMapView(bb::cascades::Container* parent) :

    bb:Smiley Tonguelatform::geo::GeoLocation *geoLocation = new bb:Smiley Tonguelatform::geo::GeoLocation(52.519900, 13.355500);
    geoLocation->setName("My Geo Marker");
    qDebug() << "Was added?" << mapData()->add(geoLocation);
    qDebug() << "Focused ID:" << focusedId();

And as before it didn't have any effect, the map wasn't rendered when the geoLocation has been added to the mapData (or mapData()->defaultProvider()). 
But this time I've noticed something different in the log:

GeoLocation::setIconUrl is deprecated. Use GeoLocation::setMarker instead. 

So I went into the documentation to check what the Marker class is.
It appears that the documentation on the web:
does not reflect the Marker.hpp header file. The header file shows that Marker can have an icon, size and all kind of useful things. From the API standpoint, really something useful.
Unfortunately whatever I do with the Marker or GeoLocation the map fails to render (white screen). I've tried sane argument, insane arguments, no arguments, default constructors etc. 
Nothing seems to work and the documentation (nor uncle Google) have any knowledge about the Marker topic.
Sometimes (not always) I get a set of errors but don't know if those are there due to the GeoLocation/Marker:

TileRequestError: Error: 7, Key: 0, 0, 15 
TileRequestError: Error: 7, Key: 0, 0, 13

The map canvas seems to react to touch/pinch (but only the log shows it as the screen continues to be white). 
File log.txt has been attached. I got the output playing with Marker.

I hope that somebody can provide some help before we lose one developer (me) to insanity.


Update: The solution is a nice workaround but I'm interested in a solution that is integrated in the MapView (the Marker class looks nice) and not a separate layer that is drawn on top of the map (as in the example). As the markers are behaving a bit wobbly.