简体   繁体   中英

how to set google map on max zoom level with animation on marker click in android

map.setOnMarkerClickListener(new OnMarkerClickListener() {

                @Override
                public boolean onMarkerClick(Marker arg0) {
                    // TODO Auto-generated method stub

                    LatLng point = arg0.getPosition();

                    map.moveCamera(CameraUpdateFactory.newLatLngZoom(point, 15));

                    map.animateCamera(CameraUpdateFactory.zoomTo(15), 2000,
                            null);
                    return false;

                }
            });

i am able to set camera ta max zoom level using this code but i want when i click on marker camera should move to zoom level with animation slowly slowly zoom should increase please tell me or suggest me how to achieve this .

From what I'm getting here you already moved camera using moveCamera. Delete this line and change animateCamera line to :

map.animateCamera(CameraUpdateFactory.newLatLng(point).zoomTo(15), 2000, null);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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