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
Contributor
zedsaid
Posts: 34
Registered: ‎08-01-2012
My Device: Playbook
My Carrier: None

Simulate gelocation updates to test GPS based app

I am coming from iOS where I can use the simulator to simulate location updates such as a car driving and I will recieve those updates.

 

Is there a way to do with in WebWorks or using Ripple?  It is just SO much easier to debug this way rather than trying to physically move and debug.

Please use plain text.
Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Simulate gelocation updates to test GPS based app

[ Edited ]

zedsaid wrote:

Is there a way to do with in WebWorks or using Ripple?  It is just SO much easier to debug this way rather than trying to physically move and debug.


As I wrote in your other post you could try the KitchenSink example. There is a running Geolocation example you can try. The only need to do to get to rewrite something in the "/js/html5" folder in the "geo.js" file in function "getPosition" (almost last function in there) in line 338 change

 

navigator.geolocation.getCurrentPosition(geolocationSuccess, geolocationError, options);

 to

 

navigator.geolocation.watchPosition(geolocationSuccess, geolocationError, options);

and perhaps add the

 

clearOutput();

 function call to the geolocationSuccess() function to clear the output every time you get new Geocoordinates. That should work for you. You could also try to play with the options object in the (new) watchPosition(...) function call in line 333.

 

BTW: this also works with Ripple for me ;-)

 


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Please use plain text.