mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Added Google Geolcation
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
// Test files for Geolocation Definition file
|
||||
/// <reference path="google.geolocation.d.ts" />
|
||||
|
||||
//determine if the handset has client side geo location capabilities
|
||||
var isInit: bool = geo_position_js.init();
|
||||
if(isInit){
|
||||
geo_position_js.getCurrentPosition(success_callback, error_callback);
|
||||
} else {
|
||||
alert("Functionality not available");
|
||||
}
|
||||
|
||||
function success_callback(position: Position): void {
|
||||
geo_position_js.showMap(position.coords.latitude, position.coords.longitude);
|
||||
}
|
||||
|
||||
function error_callback(positionError: PositionError): void {
|
||||
console.log(positionError.code);
|
||||
}
|
||||
Reference in New Issue
Block a user