Detect when Android v2 maps has loaded

前端 未结 3 2051
离开以前
离开以前 2020-11-28 10:42

I\'m writing a app that would take 9 snapshots of the map around an area when the user presses a button.

In loop, using this to move and save:

map.mo         


        
3条回答
  •  独厮守ぢ
    2020-11-28 11:16

    As I saw this question haven't still been solved. Don't know why but for me when map have finished loading, the OnCameraChangeListener gets called. So I just use like this to detect when the map have finished loading.

    googleMap.setOnCameraChangeListener(new OnCameraChangeListener() {
            @Override
            public void onCameraChange(CameraPosition arg0) {
                map.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(
                        mStartLat + (mMultiOffsetX + mWidth), mStartLng
                                + (mMultiOffsetY + mHeight)), mZoom));
                map.snapshot(this);
            }
        });
    

提交回复
热议问题