01-21-2013 07:25 AM
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 10.0.9.1673 to 10.0.9.2318 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) :
MapView(parent)
{
setRenderEngine("RenderEngine3D");
bb:latform::geo::GeoLocation *geoLocation = new bb:
latform::geo::GeoLocation(52.519900, 13.355500);
geoLocation->setName("My Geo Marker");
geoLocation->setIconUri("/apps/com.example.blitzer_de.testDev__blitzer_dedd8a84df/native/assets/imag es/v2/ic_section_control_report_act.png");
qDebug() << "Was added?" << mapData()->add(geoLocation);
setFocusedId(geoLocation->id());
qDebug() << "Focused ID:" << focusedId();
setLocationOnFocused();
}
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:
https://developer.blackberry.com/cascades/referenc
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.
BR,
Paweł