Skip to content

Commit

Permalink
Calling the appropriate method, depending if native geolocation funct…
Browse files Browse the repository at this point in the history
…ions have been replaced by our own mock versions or not
  • Loading branch information
ruiwen committed Dec 13, 2011
1 parent becfd39 commit d91ba97
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/geomock.js
Expand Up @@ -88,7 +88,9 @@ geomock.watchPosition = function(success, error, opts) {
geomock.go = function() {
// Nerf the real geolocation poll
if(navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(pos) {
var poll = (typeof(geomock._getCurrentPosition) == 'function')?geomock._getCurrentPosition:navigator.geolocation.getCurrentPosition;

poll.call(navigator.geolocation, function(pos) {

if(!geomock.mock_pos.coords) {
geomock.mock_pos.coords = {}
Expand Down

0 comments on commit d91ba97

Please sign in to comment.