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

查看:27
本文介绍了在 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天全站免登陆