我无法得到准确的GPS位置的谷歌地图API在Android应用 [英] I'm having trouble getting accurate GPS locations from the Google Maps API for use on Android

查看:138
本文介绍了我无法得到准确的GPS位置的谷歌地图API在Android应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发使用Android手机(2.1及以上),谷歌地图的人,以纪念区的应用程序(单点,线和面)。他们都获得了谷歌地图视图,并围绕他们希望创建一个点,然后preSS在GUI上的一个按钮来添加点在该位置的屏幕上的位置输入点的线。

We are developing an application for people to mark areas (single points, lines, and polygons) on Google Maps using Android phones (2.1 and up). They are given a Google Maps view and enter the points for the lines by centering the screen at the location that they want to create a point and then press a button on the GUI to add the point at that location.

输入点后,他们recenter在屏幕上的一个点,preSS的创建点按钮的位置了。后的所有点为该形状都已输入,他们切换到他们输入一些描述性信息,并发送信息到中央数据库中的另一个视图。

After entering a point, they recenter the screen on the location for the next point and press the create point button again. After all of the points for that shape have been entered, they switch to another view where they enter some descriptive information and send the information to a central database.

不幸的是,点转向由小相对于他们应该纪念的地点数量。如果从摘要视图回点编辑视图的用户交换机,所有的点都将已经转移,一些仅由脚和一些由多达10或15英尺。这个问题似乎是,

Unfortunately, the points shift by a small amount relative to the locations they were supposed to mark. If the user switches from the summary view back to the point editing view, all of the points will have shifted, some by only a foot and some by as much as 10 or 15 feet. The problem appears to be that

GeoPoint point = mapView.getMapCenter();

返回不准确的GPS坐标的观点已被平移后。当点被呈现到新鲜视图,它们一致地显示在其与在互联网上的谷歌地图视图那些相同的GPS坐标关联以及相同的位置。我们广泛调试的软件和坐标时,会从 mapView.getMapCenter()返回错误的地图位置/ GPS坐标;

由于我们关注的是,

Point p = new Point();
mapView.getProjection().toPixels(mapView.getMapCenter(), p); 

可能无法返回屏幕宽度/ 2 screenHeight / 2 的位置,我们实际上表明使用了十字放置点的toPixels位置和新创建的点匹配正好与十字型的最初创建时。切换到汇总屏幕和背部后,他们正在重新呈现在他们真正的GPS坐标。

might not return the screenWidth / 2, screenHeight / 2 location, we actually show the cross-hair used to place points at the toPixels location and the newly created points match up exactly with the cross-hair when they are originally created. After changing to the summary screen and back, they are re-rendered at their real GPS coordinates.

此外,为了清楚,此无关与GPS传感器的精确度。

Also, to be clear, this has nothing to do with the accuracy of the GPS sensor.

如果我们能刷新/平移后重新初始化图来看,它可能是尴尬的,但它是一个改进我们当前的问题。 移动到其他的地图软件,同时,需要花费大量的时间和可能具有其自身的问题。

If we could refresh / reinitialize the map view after panning, it might be awkward, but it would be an improvement over our current problems. Moving to other map software, meanwhile, would take a lot of time and might have its own problems.

推荐答案

我们最终在我们的android应用取代谷歌地图使用Bing地图,使用Android SDK从InKnowledge。他们提供精确的GPS坐标为中心的地图视图,这是我们用来构建多边形,折线和图钉形状。

We eventually replaced Google Maps with Bing Maps in our android application, using the Android SDK from InKnowledge. They are providing accurate GPS coordinates for the center of the map view, which we use to build polygons, polylines, and pushpin shapes.

这篇关于我无法得到准确的GPS位置的谷歌地图API在Android应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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