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 Developer
Posts: 23
Registered: ‎09-10-2009
My Device: Not Specified

Re: Capturing GPS coordinates while in browser

I am using Sprint, and I don't think so, but don't know for sure.

New Developer
Posts: 43
Registered: ‎07-29-2008
My Device: Not Specified

Re: Capturing GPS coordinates while in browser

Do you get coordinates under this URL: http://bit.ly/sMBQG ?

New Developer
Posts: 23
Registered: ‎09-10-2009
My Device: Not Specified

Re: Capturing GPS coordinates while in browser

I got the page, Radius showed to be 5, javascript asked if it was ok to get location, I said yes, and then it gave me the following error."Error: Cannot convert 'undefined' to an object'"

New Developer
Posts: 43
Registered: ‎07-29-2008
My Device: Not Specified

Re: Capturing GPS coordinates while in browser

Thank's for the hint. I will take a look at the application an then post again. It works with the Storm.

New Developer
Posts: 43
Registered: ‎07-29-2008
My Device: Not Specified

Re: Capturing GPS coordinates while in browser


dcsimmons wrote:

I got the page, Radius showed to be 5, javascript asked if it was ok to get location, I said yes, and then it gave me the following error."Error: Cannot convert 'undefined' to an object'"


 

I have checked the page with the 9630 Sprint (4.7.1) simulator and got the same error message. Unfortunately my simulator does no more connect to the server and I cannot test which object is undefined. The page works well on the BlackBerry Storm (4.7.0).

 

The error may have two reasons:

 

1. The JavaScript Location API doesn't work correctly on the BlackBerry Tour and objects and properties are undefined.

 

2. The JavaScript API of the 9630 was changed and the code must be adapted.

New Developer
Posts: 43
Registered: ‎07-29-2008
My Device: Not Specified

Re: Capturing GPS coordinates while in browser

I have tested the new BlackBerry software v5: My location-based services application works well.

New Developer
Posts: 23
Registered: ‎09-10-2009
My Device: Not Specified

Re: Capturing GPS coordinates while in browser

I did the upgrade as well.  Still get the same error using the URL you provided, and get 0 for running my own script.  Any more ideas?

 

Thanks for trying!

New Developer
Posts: 43
Registered: ‎07-29-2008
My Device: Not Specified

Re: Capturing GPS coordinates while in browser

Hello,

 

could you please try again using the provided URL? Thank you.

New Developer
Posts: 23
Registered: ‎09-10-2009
My Device: Not Specified

Re: Capturing GPS coordinates while in browser

Yes, your URL worked, but I still get O's on my end for my own testing

New Developer
Posts: 43
Registered: ‎07-29-2008
My Device: Not Specified

Re: Capturing GPS coordinates while in browser

Could you please try the following code:

 

<script type="text/javascript">
        blackberry.location.setAidMode(1);
        blackberry.location.onLocationUpdate(window.alert("new location is " + blackberry.location.latitude + ", " + blackberry.location.longitude));
        blackberry.location.refreshLocation();
    </script>

 

The AidMode can have the values 0, 1, 2.