npm i --save nativescript-last_known_location
- 版本:1.0.4
- GitHub: https://github.com/andrew4alive/nativescript-last_known_location
- NPM: https://npmjs.net.cn/package/nativescript-last_known_location
- 下载次数
- 昨天: 0
- 上周: 0
- 上个月: 0
nativeScript-last_known_location
import { Last_known_location } from "nativescript-last_known_location";
import { isAndroid, isIOS, device, screen } from "tns-core-modules/platform";
function getlastlocation(){
if( !isAndroid ) return ;
const get_last_location_class=Last_known_location;
var get_last_location = new get_last_location_class();
//optional get_last_location.msg="message when request location permission"
get_last_location.getlocation(
location=>{
console.log("least known location latutide:longitude"+location.getLatitude()+","+location.getLongitude());
},
()=>{ console.log("no permission");}
)
}
(可选) 前提条件 / 要求
npm 和 nativescript 安装
安装
tns plugin add nativescript-last_known_location
用法
API
许可证
Apache 许可证版本 2.0,2004 年 1 月