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
Highlighted
New Contributor
Posts: 8
Registered: ‎01-22-2014
My Device: Blackberry Q10
My Carrier: Vodafone

can't set Marker's iconUri

Hi all.

I'm having an annoying problem with Cascades Markers .

I'd like to set a custom icon for the marker on the map (i.e. an image located in "assets/images/me.png" ), but I can't set it properly.

The problem is related to the iconUri  parameter, which I tried to set it to the following values:

* "asset:///images/me.png"

* "assets/images/me.png"

* "images/me.png"

* "file:///app_working_directory/app/native/assets/images/me.png"


but none of these did the trick. I simply didn't see the Marker.

The weird thing is that if I set it to an image which is not in my assets (e.g. "/usr/hmi/lbs/purple_pin.png" ), it does work without any issue.

 

Looking for a solution, I found that BlackBerry's MapView sample set the iconUri this way:

setIconUri(UIToolkitSupport::absolutePathFromUrl(QUrl("asset:///images/me.png")))

 "Nice!" I thought. So I imported <bb/UIToolkitSupport> and called that function in the exact same way... but the compiler reported Simulator (what the...?!) errors and stopped.

 

Well, I hope someone had the same nonsense problem and can help me.

 

In addiction, I'd like to know if there is a list of the files contained in the "/usr/hmi/lbs/" directory somewhere, since at least I could use those files as Marker icon Smiley Happy

 

Thank you very much, I would be lost without this community

 

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: can't set Marker's iconUri

To access the icons you can start a SSH session using Momentics and copy them across.

 

Just go to the  Debug Perspective -> Target File System Navigator.

Right-click on the device and select Launch SSH session.

 

 


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: can't set Marker's iconUri

... and for the icon try using,

 

   QDir::homePath();

 

This will point to the root level of your app.

 


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.