本文介绍了watchPosition()和getCurrentPosition的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

getCurrentPosition()watchPosition()有什么区别.我读了几篇有关getCurrentPosition()watchPosition()的文章.但是我不清楚.据我了解,getCurrentPosition()仅一次更新位置,但是watchPosition()不断更新位置.我是对的吗?

What is the difference between getCurrentPosition() and watchPosition(). I read several articles about getCurrentPosition() and watchPosition(). But none of was clear to me. As far as I'm understand getCurrentPosition() update location only one time But watchPosition() continuously update location. I'm I right??

推荐答案

getCurrentPosition()给出currentPosition纬度和经度值,该值仅触发一次.其中,watchPosition()连续给出currentPosition的纬度和经度值.如果位置发生变化(假设您在行驶中的车辆中,那么watchPosition()将给出结果.然后您将知道此结果)

getCurrentPosition() gives currentPosition latitude and longtitude values,which fires only once. Where as watchPosition() gives currentPosition latitude and longtitude values continuously. If position changed(assume you are in a moving vehicle,then watchPosition() will give result.Then you will come to know the result of this )

这篇关于watchPosition()和getCurrentPosition的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-04 21:42