DefinitelyTyped/types/google.geolocation/google.geolocation-tests.ts
Nathan Shively-Sanders 13839fe613
Type updates for TS 4.1 (#47679)
TS 4.1 changes the name of some DOM types. This PR updates those names.
2020-09-16 15:39:53 -07:00

19 lines
563 B
TypeScript

// Test files for Geolocation Definition file
//determine if the handset has client side geo location capabilities
var isInit: boolean = geo_position_js.init();
if(isInit){
geo_position_js.getCurrentPosition(success_callback, error_callback);
} else {
alert("Functionality not available");
}
function success_callback(position: GeolocationPosition): void {
geo_position_js.showMap(position.coords.latitude, position.coords.longitude);
}
function error_callback(positionError: GeolocationPositionError): void {
console.log(positionError.code);
}