如何获取我在 Android map 上长时间点击的特定位置的纬度和经度值?
最佳答案
对于长按,我建议你查看http://www.kind-kristiansen.no/2010/handling-longpresslongclick-in-mapactivity/ .这将详细介绍如何在 Maps API 中监听长按事件,因为据我所知很少或没有内置功能。</p>
至于纬度/经度代码,长按后可以将像素转换为坐标。
public void recieveLongClick(MotionEvent ev)
{
Projection p = mapView.getProjection();
GeoPoint geoPoint = p.fromPixels((int) ev.getX(), (int) ev.getY());
// You can now pull lat/lng from geoPoint
}
关于android - 如何在Android中获取 map 上的经纬度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4446811/