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

Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.

Posts: 86
Registered: ‎05-21-2012
My Device: Blackberry 10 Dev Alpha
My Carrier: IDEA

Getting problem when inserting map view dynamically



      I have a component definition in the attached objects of a container. When clicked on defferent buttons of the container, I am changing the source of the component definition and inserting to the container. I have succeeded with several buttons but when I insert the container which has the map view, the mapview is not loading. Is there any problem with mapview that is dynamically inserted to the container (OR) is it not possible to load map if we insert dynamically?


Thanks in advance!

- Raju

- Raju
Posts: 1,746
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: Getting problem when inserting map view dynamically

I had a problem with MapView if attached normaly:

the Map was empty and endless Console output from Rendering Engine


could fix this with dynamic components.


this works for me:

here's the Component

ComponentDefinition {
            id: singleSiteMapComponent
            source: "../maps/MapOfSingleSite.qml"

this is the property dfor the component:

property variant mapPage;


and here's the code to open the MapView

function pushSingleSiteMap(latitude, longitude) {
        mapPage = singleSiteMapComponent.createObject(navigationPane)
        console.log("lat: " + latitude + " lon: " + longitude)
        mapPage.latitude = latitude
        mapPage.longitude = longitude

and at last step the code to destroy

onPopTransitionEnded: {
        if (mapPage == page) {
            console.debug("map destroyed !!")

 to get the whole picture, here's the code from Page with MapView to get the coordinates

Page {
    property alias latitude: mapview.latitude
    property alias longitude: mapview.longitude

 Now using the dynamic way the MapView works Smiley Happy


with some limitations:

  • first startup after opening the app can take up to 20 seconds
  • opening the Page with the Map for 2-3 seconds you see a black screen before the Map "arrives"
  • rendering of the Map is a desaster, not all tiles are rendered well

On Dev Alpha repeatedly switching between Map and other Page (create / destroy) in some cases the MapView stops rendering, screen black only and it happens rarely that I couldn't close the App and had to restart the DevAlpha.


But I got info from RIM that this should be better at launch

Compared with new GoogleMaps API v2 for Android from December 2012 at the moment MapView is way behind.

I need only 50% of code for GoogleMap API v2 and rendering is smooth and Camera-Animations are cool.


So - at the moment - from my POV it's only the Map where Android4 works better - in all other components I'm using for complex business apps, BlackBerry 10 is much better.


Hope, that BB10 Devs at RIM will spent some more time to get a cool Map-UX at launch. This is important because reviews will be sensible in this part after the iOS6 - map-desaster


thanks to Shadid Haque we now have a great CustomMapView sample at Github. get it, integrate it into your apps and report all problems you find to give the devs the chance to fix OS before launch

ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
Posts: 86
Registered: ‎05-21-2012
My Device: Blackberry 10 Dev Alpha
My Carrier: IDEA

Re: Getting problem when inserting map view dynamically

Thanks ekke! I will see that sample now...!

- Raju

- Raju
Posts: 34
Registered: ‎10-28-2012
My Device: Dev Alpha B
My Carrier: Rogers

Re: Getting problem when inserting map view dynamically

No need to switch "back and forth" between pages to cause the crash....Even in the CustomMapView, simply swipe down from the top to display the menu (there is nothing in the menu...but it doesn't matter), and then touch the map again. The app will explode and the map will stop working with:


eglSwapBuffers: an EGLSurface argument does not name a valid surface configured for rendering
NBRE_GLTexture::Create2DTexture: glGenTextures failed! texture name=InternalTexture, nbmID=T_BR13_2_PNG_23_2374_2933, offset=0, memory addr=a1e0020 glError = 0



*Like or mark as solution!*