Created
November 26, 2012 15:10
-
-
Save ootes/4148703 to your computer and use it in GitHub Desktop.
Geolocatie script
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
// Variable declaration | |
var SANDBOX = "SANDBOX"; | |
var LINEAIR = "LINEAIR"; | |
var GPS_AVAILABLE = 'GPS_AVAILABLE'; | |
var GPS_UNAVAILABLE = 'GPS_UNAVAILABLE'; | |
var POSITION_UPDATED = 'POSITION_UPDATED'; | |
var REFRESH_RATE = 1000; | |
var currentPosition = currentPositionMarker = customDebugging = debugId = map = interval =intervalCounter = updateMap = false; | |
var locatieRij = markerRij = []; | |
var map = { | |
generate: function(){ | |
} | |
}; | |
var location = { | |
init: function(){ | |
debug.message("Controleer of GPS beschikbaar is..."); | |
ET.addListener(GPS_AVAILABLE, this.startInterval); | |
ET.addListener(GPS_UNAVAILABLE, function(){debug.message('GPS is niet beschikbaar.')}); | |
(geo_position_js.init())?ET.fire(GPS_AVAILABLE):ET.fire(GPS_UNAVAILABLE); | |
}, | |
startInterval: function(event){ | |
debug.message("GPS is beschikbaar, vraag positie."); | |
this.update_position(); | |
interval = setInterval(this.updatePosition, REFRESH_RATE); | |
ET.addListener(POSITION_UPDATED, this.checkLocations); | |
}, | |
updatePosition: function(){ | |
}, | |
checkLocations: function(){ | |
} | |
}; | |
var debug = { | |
message: function(){ | |
// error handling | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment