문제

I'd like to add an unfocus listener on the markers of my map, but it doesn't seem to exists. What would be the best way to do that?

I do understand that there is no unfocus listener function, sorry for the unclear explanation. When I click on a marker I show a linearLayout on the bottom of the screen and modify a textview. What I want to do is hide this linearLayout when the user clicks somewhere else on the map.

I don't want to use InfoWindow.

도움이 되었습니까?

해결책 2

You may achieve that by:

  • remembering currently focused Marker in onMarkerClick or getInfoWindow
  • clearing currently focused Marker in onMapClick and also after other events like setVisible or remove called on focused Marker (if you use them in your code)

다른 팁

There is no UNFOCUS in markers because there is no need. When you click anywhere else on the map it will automatically be unfocused.
EDIT :
You can use onMapClickListner to get the click on the map. This way the marker will automatically unfocused and you can handled that event.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top