Search code examples
blackberry-10blackberry-cascades

blackberry cascades mapview


Hi I am trying to implement a mapview using blackberry cascades based on this link but whenever I import maps

import bb.cascades.maps 1.0 ,

the QNX IDE throws out an error saying

bb.cascades.maps is not installed.

I have set up the environment exactly as described in the developer site and dont seem to understand how do i install this module.


Solution

  • They seem to have left out some steps. Not all cascades objects are loaded by default into the development system, but they can be added at runtime. The biggest drawback is that the Eclipse can't do static analysis of the QML for errors only general syntax.

    If you add the following lines to the main.cpp file you may get the example to work (I hacked this into one of my current projects and got it to load without errors but the MapView is all black):

    #include #include <bb/cascades/maps/MapView>
    

    Then just before the QmlDocument::create call:

    qmlRegisterType<bb::cascades::maps::MapView>("bb.cascades.maps", 1, 0, "MapView");
    

    This is the mechanisim that is used quite frequently to make Cascades objects not included in the default setup available, or to make your own specializations from CustomControl or other Cascades objects available to QML.

    Finally this example seems to pre-date beta 3 so there may be some other issues that you may have to work through.

    EDIT

    I did some poking around and found this thread on the BlackBerry forum. Setting the altitude to 10000 actuall got me a usable map on the simulator and the Dev Alpha. It obviously needs more work but you can interact with it (drag to move, pinch to zoom, etc).