Created
January 15, 2012 23:36
-
-
Save eknuth/1617988 to your computer and use it in GitHub Desktop.
method refresh the routes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var geo = new Ext.util.GeoLocation({ | |
autoUpdate: false, | |
listeners: { | |
locationupdate: function(geo) { | |
refreshRoutes(geo.latitude, geo.longitude); | |
}, | |
locationerror: function(geo, bTimeout, bPermissionDenied, bLocationUnavailable, message) { | |
if (bTimeout) { | |
alert('Timeout occurred.'); | |
} else { | |
alert('Error occurred.'); | |
} | |
} | |
} | |
}); | |
geo.updateLocation(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var refreshRoutes = function(lat, lon) { | |
socket.emit('get-routes', lat, lon, function(routes) { | |
Ext.each(routes, function(route, index) { | |
App.routeStore.add(route); | |
}); | |
App.routeList.refresh(); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment