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
dhicock
Posts: 54
Registered: ‎05-31-2013
My Device: BlackBerry Z30

LocationMapInvoker crasing my app

import bb.cascades 1.0
import bb.platform 1.0

Page {
    titleBar: TitleBar {
        title: "Locations"
    }
    Container {
        layout: DockLayout{}
        
        attachedObjects:[
            LocationMapInvoker {
                id: locationA
                
                centerLatitude: 27.74949
                centerLongitude: -97.41918
                altitude: 200
                
                locationLatitude: 27.74949
                locationLongitude: -97.41918
                locationName: "Location A"
            }
        ]
        
        Button {
            text: "Map It"
            onClicked: {
                locationA.go();
            }
        }
    }
}

 I can't for the life of me find out what I'm doing wrong here.

 

If I comment out the LocationMapInvoker, it launches fine, but with it there, the app will just hang and not do anything.

 

Any ideas?

Like this answer? Give it a
Visit my blog for programming help, guides and common issues.
Please use plain text.
Developer
ekke
Posts: 1,520
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: LocationMapInvoker crasing my app

don't know

 

the only difference: I attached LocationMapInvoker at root element - in your case the Page, not the Container,

but should make no difference

 

your .pro is ok ?

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

Open Source Enthusiast
blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.
Developer
dhicock
Posts: 54
Registered: ‎05-31-2013
My Device: BlackBerry Z30

Re: LocationMapInvoker crasing my app

I have -lbbplatform in my .pro file, so I didn't think there was anything else that needed to be added.

import bb.cascades 1.0
import bb.platform 1.0
Page {
    content: Container 
    {      
        
    layout: DockLayout {}        
    attachedObjects:[           
        LocationMapInvoker {            
            
	        id: locationInvokerID                           
	        // This example shows how to bind properties to pre-defined values.            
	        // One can bind properties to values coming from other widgets             
	        // within this QML page (e.g. text field's input)              
	        centerLatitude :  45.416667    // Ottawa's latitude           
	        centerLongitude : -75.7        // Ottawa's longitude           
	        altitude : 200              
	        // Request for a given POI (point of interest) to be shown           
	        // on the map also.             
			locationLatitude : 45.4555          
			locationLongitude : -75.68          
			locationName : "My Favorite location"          
			// 'geocodeLocationEnabled' boolean property is not explicitly set,   
			// so it will be false.            
			// Also request for a search around the center of map    
			// (as part of setting properties available on superclass MapInvoker)  
			searchText : "Music"         
			searchLatitude : 45.416667       
			searchLongitude : -75.7          
			// 'searchMode' property is not explicitly set,    
			// so this will be a Radial search        
			}    
		]      
		// Make a Cascades button (or any Cascades widget)    
		// that can be used to trigger location invoker.     
		Button {                    
		    verticalAlignment: VerticalAlignment.Center      
		    horizontalAlignment: HorizontalAlignment.Center      
		    text: "Map it"           // When button is clicked, call the invoker by its ID         
		    onClicked: {             locationInvokerID.go();       
		    }  
		}  
	}
} 

 Here is the sample code for it, and they didn't add it to the root element, so I had assumed it wasn't necessary.

 

I went ahead and tried anyways on the root element and the same issue popped up. I've narrowed it down to the LocationMapInvoker as well, since the code works fine if I comment just that (and what's in the brackets). I just can't figure it out! :smileysad:

Like this answer? Give it a
Visit my blog for programming help, guides and common issues.
Please use plain text.
Developer
ekke
Posts: 1,520
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: LocationMapInvoker crasing my app

never had a problem with LocationMapInvoker

 

are you using 10.0 or 10.1 ?

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

Open Source Enthusiast
blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.
Developer
dhicock
Posts: 54
Registered: ‎05-31-2013
My Device: BlackBerry Z30

Re: LocationMapInvoker crasing my app

I'm using 10.1
Like this answer? Give it a
Visit my blog for programming help, guides and common issues.
Please use plain text.
Developer
ekke
Posts: 1,520
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: LocationMapInvoker crasing my app

when exactly crashes your app ?

any debug logs ?

how are you opening the Page ? Push on NavigationPane ?

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

Open Source Enthusiast
blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.
Developer
dhicock
Posts: 54
Registered: ‎05-31-2013
My Device: BlackBerry Z30

Re: LocationMapInvoker crasing my app

The app crashes on launch.

 

No debug log is raised and I can't write any.

 

The page is a tab

Like this answer? Give it a
Visit my blog for programming help, guides and common issues.
Please use plain text.
Developer
ekke
Posts: 1,520
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: LocationMapInvoker crasing my app

try to create the Page dynamically,

so if app launches another Tab should be active

 

then there's no instance of the Page

couldn't imagine that then the app crashes

 

otherwise I only could tzhink that your project is corrupt:

 

is this project created with 10.1 or survived sincle 10.0 ?

 

I created all projects new with 10.1:

got new workspace, created new project, then copied src and assets

 

give it a try

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

Open Source Enthusiast
blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.
Developer
dhicock
Posts: 54
Registered: ‎05-31-2013
My Device: BlackBerry Z30

Re: LocationMapInvoker crasing my app

Here's where it gets stranger. This isn't the first tab.

 

I just recently started BB10 development, and have only worked with 10.1, so no chance of it being legacy.

 

I created a new project with just that one page (and the line added to the .pro file) and it fails again. No errors/warnings, no build problems, no log issues, it just doesn't load.

 

Do you think my workspace might be corrupt somehow?

Like this answer? Give it a
Visit my blog for programming help, guides and common issues.
Please use plain text.
Developer
ekke
Posts: 1,520
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: LocationMapInvoker crasing my app


dhicock wrote:

Here's where it gets stranger. This isn't the first tab.

 

I just recently started BB10 development, and have only worked with 10.1, so no chance of it being legacy.

 

I created a new project with just that one page (and the line added to the .pro file) and it fails again. No errors/warnings, no build problems, no log issues, it just doesn't load.

 

Do you think my workspace might be corrupt somehow?


hmmmm

would try to use a new workspace

 

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

Open Source Enthusiast
blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.