webOS Nation Forums >  webOS apps and software >  webOS development > Stop GPS tracking
Stop GPS tracking

  Reply
 
LinkBack Thread Tools Display Modes
Old 11/12/2010, 10:18 AM   #1 (permalink)
Member
 
Join Date: Nov 2009
Posts: 3
Likes Received: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Default Stop GPS tracking

I'm aware this is probably a really stupid question, but... I'm building location data into my app using the startTracking method. How do I tell it to stop tracking? I've tried using startTracking with subscribe: false and guessing at stopTracking method (which I didn't think would work). Any thoughts?
markwilson is offline   Reply With Quote
Old 11/12/2010, 11:34 AM   #2 (permalink)
Member
 
JED-WEB-OS's Avatar
 
Join Date: Aug 2009
Location: Houston Texas
Posts: 1,174
Likes Received: 44
Thanks: 500
Thanked 213 Times in 163 Posts
Default

I have a Verizon Pre Plus. The GPS automatically stopped tracking when I put the battery in the phone. Sorry I can’t help you.
__________________
Palm m130 > Verizon Trēo 650 > Verizon Trēo 755p > Verizon Palm Prē Plus > TouchPad > ?
~ The Future's Just Not What it Used To Be ~
JED-WEB-OS is offline   Reply With Quote
Old 11/12/2010, 12:20 PM   #3 (permalink)
Member

 
Grabber5.0's Avatar
 
Join Date: Dec 2008
Location: Kansas City, MO
Posts: 1,742
Likes Received: 86
Thanks: 198
Thanked 362 Times in 291 Posts
Default

I can help when I get back to my desk.
Grabber5.0 is offline   Reply With Quote
Old 11/12/2010, 01:12 PM   #4 (permalink)
Member

 
Grabber5.0's Avatar
 
Join Date: Dec 2008
Location: Kansas City, MO
Posts: 1,742
Likes Received: 86
Thanks: 198
Thanked 362 Times in 291 Posts
Default

Here is how I handle start/stop tracking:
Code:
FirstAssistant.prototype.handleStartTrackingButtonPress = function(event){
	this.controller.get('status').update("Start tracking ...");
	if (!this.tracking)
	{
		this.tracking=true;
		//If we still have an old tracking handle, try to cancel it
		if (this.trackingHandle)
		{
			this.trackingHandle.cancel();
			this.trackingHandle = null;
		}
		this.trackingHandle = this.controller.serviceRequest('palm://com.palm.location', {
			method : 'startTracking',
			parameters: {
				subscribe: true
					},
			onSuccess: this.gotFix.bind(this),
			onFailure: this.error.bind(this)
			});

		//Set timer for updateMapImage, which will update as the new fix is returned.
		this.controller.window.setTimeout(this.updateMapImage, this.mapinterval);
	}
	else
	{
		console.log("Attempting to stop tracking.");
		this.controller.get('status').update("Stopped tracking ...");
		this.tracking=false;
		try
		{
			this.trackingHandle.cancel();
			this.trackingHandle = null;
		}
		catch (ex)
		{
			console.log("Error cancelling gps tracking!" + Object.toJSON(ex));
		}
		
	}
	this.controller.modelChanged(this.model); 
}
__________________
Matt Williams

Developer of: SMS Auto Forward/Reply, GPS Viewer,
Keyring converters for CSV, eWallet, & CodeWallet
Grabber5.0 is offline   Reply With Quote
Reply

 

Tags
gps, services

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0