Google Map API V2 - How do I keep a marker in the center of the screen while user is scrolling the map?

后端 未结 7 1788
执念已碎
执念已碎 2020-12-10 02:00

Google Map API V2 - How do I keep a marker in the center of the screen while user is scrolling the map ?

My purpose is to let user choose a location. I use the follo

7条回答
  •  死守一世寂寞
    2020-12-10 02:29

    How about?

    mMap.setOnCameraChangeListener(new OnCameraChangeListener() {
            public void onCameraChange(CameraPosition arg0) {   
                    mMap.clear();               
                    mMap.addMarker(new MarkerOptions().position(arg0.target));
            }
    });
    

提交回复
热议问题