简体   繁体   English

我在Google Maps Android上完成移动摄像机后处理事件

[英]Handle Event When I Finished Moving Camera On Google Maps Android

How can I handle event when I finished moving camera on google map? 在Google地图上移动相机后如何处理事件? I intend to take the last coordinate at the center of the map after I finished looking for locations, then capture the last location that showing at the center of the map. 我打算在查找完位置后将最后一个坐标作为地图中心,然后捕获显示在地图中心的最后一个位置。

Thank you. 谢谢。

Yes this can be done by implementing the OnCameraChangeListener in your activity 是的,这可以通过在活动中实现OnCameraChangeListener来完成

for example. 例如。

    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 v2执行asynctask

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM