android - 当我在 Google Maps Android 上完成相机移动时处理事件

标签 android google-maps

当我在谷歌地图上完成相机移动时,如何处理事件?我打算在查找完位置后取 map 中心的最后一个坐标,然后捕获显示在 map 中心的最后一个位置。

谢谢。

最佳答案

是的,这可以通过在您的 Activity 中实现 OnCameraChangeListener 来完成

例如。

    public class ABCActivity extends Activity implements OnCameraChangeListener
    {
    @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);

            setContentView(R.layout.actiivty_abc_layout);



    }
    @Override
        public void onCameraChange(CameraPosition position) {

 /// Perform all your operations here
    }

    }

关于android - 当我在 Google Maps Android 上完成相机移动时处理事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35497229/

相关文章:

java - Android - 显示折线

android - 如何找到从当前位置到给定位置的距离?

android - Windows 10 中的 Ionic 5 ERR_AVD_HOME_NOT_FOUND : No valid Android AVD home found.

android - 想在 ListView 中的 TextView 中设置罢工

android - 使用 Intent.createChooser 使用 Waze 和谷歌地图导航显示 Waze 图标两次

android - 适用于 Android 的谷歌地图渐变多段线?

javascript - 谷歌地图V3 : fitbounds and center not working together

android - 如何检测 fragment 何时出现在屏幕上?

android - 如何知道安装何时完成

java - Android 设备的内部版本号是否唯一?