在Ionic中使用navigator.geolocation或$ cordovaGeolocation [英] Use navigator.geolocation or $cordovaGeolocation in Ionic

查看:331
本文介绍了在Ionic中使用navigator.geolocation或$ cordovaGeolocation的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我基本上可以使用这两种方法得到相同的信息,我想知道哪一种是首选的,哪一种使用另一种优势?

Since I basically can get the same info with both approaches, I'm wondering which is the preferred one and what are the advantages using one over the other?

推荐答案

值得注意的是,根据当前和官方文件(参见 cordova geolocation doc ),没有必要使用$ cordovaGeolocation,而是使用全局对象navigator.geolocation。

It is worth noting that according to the current and oficial documentation (see cordova geolocation doc), there is no need to use $cordovaGeolocation, but rather the global object navigator.geolocation.

这篇关于在Ionic中使用navigator.geolocation或$ cordovaGeolocation的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆