Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我制作了一个使用 phonegap 显示 Google 地图的示例 Android 应用程序。我想获取地图上被触摸的地方的位置。有什么方法吗?
它适用于 Android MapView 的解决方案,但我确信您在 PhoneGap 中也有类似的方法。 我认为您需要扩展 Overlay 类并覆盖 OnTap 方法。
@Override public boolean onTap(GeoPoint p,MapView mapView){ Log.d("TOUCHED_PLACE", "Latitutde:"+p.getLatitudeE6()/1E6 + " Longitude:"+p.getLongitude()/1E6); }
更多信息: https://developers.google.com/maps/documentation/android/reference/com/google/android/maps/Overlay#onTap%28com.google.android.maps.GeoPoint,%20com.google.android。地图.MapView%29
:)