0

I have a Google Map, and i added a framelayout on top of the map to check when the user touch and release the finger from map, however i want to implement pinch to zoom (in or out) but without move the position of the marker (like Uber or lyft) how can i make this?

Javier
  • 1,469
  • 2
  • 20
  • 38

1 Answers1

0

you can either use a centered imageButton on the framelayout as a replacement for a marker, the map can be dragged in the background layer but the imageButton will remain constant. or, you can use. onCameraChange(CameraPosition) to get the position of the camera center and place marker over there while removing the previous marker.

reference for onCameraChange(CameraPosition)

android How to move a map under a marker,

How to attach a flexible marker on map something like Uber and Lyft?.

I have not tested the oncamerchange(cameraPosition) approach you might enconter a little delay in this approach as the method recieves the call when the animation of the map has ended.

Community
  • 1
  • 1
harshitpthk
  • 4,058
  • 2
  • 24
  • 32