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
Developer
csibbdev
Posts: 67
Registered: ‎09-23-2010
My Device: Curve
My Carrier: T-Mobile
Accepted Solution

Error using blackberry maps args

I have the following code,

 

blackberry.invoke.invoke(blackberry.invoke.APP_MAPS, args);

 

It worked in version 6.0.0.246.

 

I just upgraded to version 6.0.0.526 and now it throws an error.

 

Has the API changed again? - it changed from 5 to 6.

 

Thanks in advance.

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Error using blackberry maps args

Hi csibbdev,

 

Can you post up the JavaScript that you are using to populate the args object?

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
Developer
csibbdev
Posts: 67
Registered: ‎09-23-2010
My Device: Curve
My Carrier: T-Mobile

Re: Error using blackberry maps args

<?xml version="1.0"?>
<lbs clear="ALL" id="ATM">
	<location x="-8434166" y="3404324" label="Starbucks" description=" "/>
	<location x="-8432728" y="3402484" label="Dunkin' Donuts" description=" "/>
	<location x="-8435358" y="3403040" label="Douceur De France" description=" "/>
	<location x="-8431938" y="3404842" label="Lu Lu's Bakery LLC" description=" "/>
	<location x="-8430371" y="3403924" label="Starbucks" description=" "/>
	<location x="-8436174" y="3401991" label="Krispy Kreme Doughnuts" description=" "/>
	<location x="-8435823" y="3402703" label="Southern Skillet" description=" "/>
	<location x="-8432004" y="3406581" label="Dunkin' Donuts" description=" "/>
	<location x="-8436054" y="3402721" label="Aunt Kimmy's Creations" description=" "/>
	<location x="-8431765" y="3402114" label="Starbucks" description=" "/>

 

Above is the result of the xmlString used below and here is the javascript in question, note the two formats used for version 5 and version 6....

kmlString += "<\/lbs>"
         var XMLLocation   = "file:///store/home/user/documents/SEARCHDATA.txt";
         if (blackberry.io.file.exists(XMLLocation))
         {
            blackberry.io.file.deleteFile(XMLLocation);
         }
         var blob_clientdata = blackberry.utils.stringToBlob( kmlString, "US-ASCII" );
         blackberry.io.file.saveFile( XMLLocation, blob_clientdata );
         var osversion = blackberry.system.softwareVersion;
         try {
         if (osversion.substr(0, 1) == '5')
         {
            var parser = new DOMParser();
            var doc = parser.parseFromString(kmlString, "text/xml");
            var args = new blackberry.invoke.MapsArguments(doc);
            blackberry.invoke.invoke(blackberry.invoke.APP_MAPS, args);
         }
         else
         {  try {
            var args = new blackberry.invoke.MapsArguments(kmlString);
            blackberry.invoke.invoke(blackberry.invoke.APP_MAPS, args);
            } catch (Error) {
            alert("Version 6 arg err");
            }
         }

 

Please use plain text.
Developer
csibbdev
Posts: 67
Registered: ‎09-23-2010
My Device: Curve
My Carrier: T-Mobile

Re: Error using blackberry maps args

Crickets?

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Error using blackberry maps args

I sent it over to our testing team today, and they were unable to reproduce the error with either SDK v1.5 or 2.0.  They tested on the simulator and on a device with 6.0.0.526 loaded

 

Is there possibly something that changed with your wireless vendor who may have removed maps or the ability to access it?

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
Developer
csibbdev
Posts: 67
Registered: ‎09-23-2010
My Device: Curve
My Carrier: T-Mobile

Re: Error using blackberry maps args

Bingo - he shoots, he scores!

 

My major US carrier "left out" BB Maps from the latest software "upgrade", I guess so that they can promote their own service.

 

Now to figure out a way around this so that my super app framework works with any carrier.

Please use plain text.