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

Web and WebWorks Development

Reply
New Contributor
Posts: 3
Registered: ‎06-02-2011
My Device: Developer
My Carrier: Developer

Opening BBMaps from browser on BBOS5+

Hello,

 

I have been totally unable to open BBMaps from the BlackBerry browser from BBOS5 devices. I'm running 5.0.0.713 in the Storm 2 simulator and 5.0.0.1015 on a physical Storm 2.

 

Support for doing just this was added in BBOS 4.5 and allegedly exists through version 6. There's an old thread about it here; one of the sample websites in that thread does not work on the Storm 2, while the other application is down.

 

Per the documentation, BBOS 5 allegedly supports both KML and XLOC. (Somebody posted in the Java forum about this exact problem last year.) What's really frustrating is that people claim that it works on earlier versions of OS5!

 

I figured at least XLOC would work, since version 6 retained alleged support for XLOC and dropped KML support. But nope.

 

I'm thinking the documentation is just wrong. Nothing I can do works - dynamic generation, static files with proper MIME types, etc. This really shouldn't be hard.

 

Here's something to ponder: if you go to a map on maps.blackberry.com in the browser... why is there no option to open it in Blackberry Maps?

 

As this is a professional web project, I can't publicly share the environment. I may be able to duplicate the relevant parts on my personal server, though. It's really frustrating, as we'd really like to support BlackBerry users, but we're starting to think it's not possible.

 

J

New Contributor
Posts: 3
Registered: ‎06-02-2011
My Device: Developer
My Carrier: Developer

Re: Opening BBMaps from browser on BBOS5+

[ Edited ]

So! The answer lies in disregarding all of that and using the BlackBerry Javascript API. Just create the address as a json object according to the spec, and call blackberry.launch.newMap like so:

 

<script type="text/javascript"> 
	var workAddress = 
		{ 
			"address1": "1600 Pennsylvania Ave.", 
			"city": "Washington", 
			"country": "USA", 
			"stateProvince": "DC", 
			"zipPostal": "20500" 
		}; 
	blackberry.launch.newMap({ "address": workAddress });
</script> 

 

I knew there had to be a reasonable way to do it! I'm a little concerned that this seems to be little-used, but it works on the Storm 2 and allegedly works on more recent platforms, so I'm satisfied for now.

 

According to the spec, you can also pass lat/long and XLOC markup. I have not tested that. There doesn't seem to be any support for KML, which is a bit of a shame.

 

(Of course, for multiplatform web development, you'll need to add checks for the blackberry object etc.)