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
ekke
Posts: 1,571
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Custom MapView is working :)

here are some screenshots and video how it can look like

 

based on Shadid Haques blog and github sample I got it working :smileyhappy:

 

source snippets will follow later, some tips:

 

if Map was opened on top of NavigationPane or TabbedPane you have to set for this page

code for NavigationPane:

if (mapPage == page) {
            // TODO workaround because of BUG
            peekEnabled = false
        } else {
            peekEnabled = true
        }

 code for TabbedPane:

onActiveTabChanged: {
        if (rootNavigationPane.activeTab == overviewTab) {
            // TODO workaround because of BUG
            peekEnabled = false
        } else {
            peekEnabled = true
        }
    }

 otherwise peek would make your map un-draggable - focus then is always on the overlay-container and no way to get the Map back. this bug is known and will be fixed by RIM.

 

another bug I run into: if Page with MapView was attached as Page, then my app freezes or crashes -

you should always create dynamically and destroy the map page.verified this with Shadid: it's the recommended way to create/destroy.

 

if you open the MapView and place a Marker on top, the Marker won't be shown to you.

You have to drag the map some mm and it appears.

problem is, that there's no signal for you to know when the map is ready - this is known and RIM is working on this.

 

have fun with MapView and Sensors - not so elegant to use as GoogleMaps APIv2 for Android from dec-2012, but good to start with. I got info that API will become easier to use.

THX again to Shadid Haque - without his sample I would been lost in space.

-------------------------------------------------------------------------------
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
Contributor
velkin
Posts: 34
Registered: ‎10-28-2012
My Device: Dev Alpha B

Re: Custom MapView is working :)

I also got the my mapview "working" again based on the custommapview sample.....however, even in the sample app....crazy render errors can be triggered and will cause the app to crash. The following prints out, about a million times.

 

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

 

 

Simply load the sample app....and then swipe down from the top for the menu. now click on the map again.....big explosion.  The same thing happens in my own app....when i try to move back and forth between a page with map on it, for example.

 

If anyone has a solution for this, i would be grateful...I've tried dynamically creating and destroying using componentDefs and delegates...and it currently sits in its own page object that is componentDef-ed and destroyed when popped off the navigation. No effect. Same crazy render errors.

 

Is there a way to tell the mapview to pause rendering?

 

 

*Like or mark as solution!*
Developer
ekke
Posts: 1,571
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: Custom MapView is working :)

there's currently no way - we have to wait for next OS

-------------------------------------------------------------------------------
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
Contributor
velkin
Posts: 34
Registered: ‎10-28-2012
My Device: Dev Alpha B

Re: Custom MapView is working :)

Yeah, i was in contact with someone at RIM. The issue arrises if the mapview is moved/resized etc....putting it on a sheet will prevent a swipe-down causing the issue since the topmenu is inaccessible in that case...but the errors still happen when the sheet is closed.

 

On a hunch I was able to suppress openGl errors by setting mapview.visible to false before closing the sheet, no more printouts.....but it still crashed the app in the end.

 

For now i have commented out the map functionality in my app until i can think of another method to get in the way of the rendering process, or the issue is resolved.

*Like or mark as solution!*
Developer
ekke
Posts: 1,571
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: Custom MapView is working :)

in my app I got it working without crashing

 

my ActionBar is positioned as Overlay

peek is disabled


map is always dynamically created / destroyed

 

problems at the moment: delay until map is rendered,

problems switching portrait / landscape where Map looses control and pinContainer was dragged instead of map

 

hopefully it will be better with new OS on 30th

I have delayed submitting my app to appworld in the meantime

-------------------------------------------------------------------------------
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