Rectangle 27 0

Triggering a map event (like a marker click) in Google maps Android V2?


OnMapClickListener is an Interface you can use to detect clicks on Google Maps V2. Kind of a "trigger" like in js. You set a Listener for specific events and you wait until you got some. Then you declare a method and you handle the event.

Note
Rectangle 27 0

Triggering a map event (like a marker click) in Google maps Android V2?


OnMapClickListener is an Interface you can use to detect clicks on Google Maps V2. Kind of a "trigger" like in js. You set a Listener for specific events and you wait until you got some. Then you declare a method and you handle the event.

Note
Rectangle 27 0

Triggering a map event (like a marker click) in Google maps Android V2?


OnMapClickListener is an Interface you can use to detect clicks on Google Maps V2. Kind of a "trigger" like in js. You set a Listener for specific events and you wait until you got some. Then you declare a method and you handle the event.

Note
Rectangle 27 0

Triggering a map event (like a marker click) in Google maps Android V2?


OnMapClickListener is an Interface you can use to detect clicks on Google Maps V2. Kind of a "trigger" like in js. You set a Listener for specific events and you wait until you got some. Then you declare a method and you handle the event.

Note
Rectangle 27 0

Triggering a map event (like a marker click) in Google maps Android V2?


marker.showInfoWindow();
map.animateCamera(CameraUpdateFactory.newLatLng(marker.getPosition()), 250, null);

250 is assumed here, API doesn't give you the value used internally for this default marker click behaviour.

Btw. you may want to submit a feature request here: gmaps-api-issues or here: Android Maps Extensions (or both).

Hmm, do you mean to say that I will not be able to trigger a marker click through my code ? I understand how to use a marker click listener (I am actually using it my code), but I wanted to trigger the click through my code without having to touch/click on the marker.

I gave you a workaround. There is no such method Marker.doClick(), but you can call OnMarkerClickListener's method yourself without direct interaction with the library.

If you have a OnMarkerClickListener, you can just keep the reference and call a function on it sending marker as a param.

If you need to run default implementation when onMarkerClick returns false (or you have no OnMarkerClickListener), you need to do it yourself:

You cannot triger a marker click directly.

hi this works but i would like to show navigate buttons in onmarkerclick

Note
Rectangle 27 0

Triggering a map event (like a marker click) in Google maps Android V2?


marker.showInfoWindow();
map.animateCamera(CameraUpdateFactory.newLatLng(marker.getPosition()), 250, null);

250 is assumed here, API doesn't give you the value used internally for this default marker click behaviour.

Btw. you may want to submit a feature request here: gmaps-api-issues or here: Android Maps Extensions (or both).

Hmm, do you mean to say that I will not be able to trigger a marker click through my code ? I understand how to use a marker click listener (I am actually using it my code), but I wanted to trigger the click through my code without having to touch/click on the marker.

I gave you a workaround. There is no such method Marker.doClick(), but you can call OnMarkerClickListener's method yourself without direct interaction with the library.

If you have a OnMarkerClickListener, you can just keep the reference and call a function on it sending marker as a param.

If you need to run default implementation when onMarkerClick returns false (or you have no OnMarkerClickListener), you need to do it yourself:

You cannot triger a marker click directly.

hi this works but i would like to show navigate buttons in onmarkerclick

Note
Rectangle 27 0

Triggering a map event (like a marker click) in Google maps Android V2?


marker.showInfoWindow();
map.animateCamera(CameraUpdateFactory.newLatLng(marker.getPosition()), 250, null);

Sign up for our newsletter and get our top new questions delivered to your inbox (see an example).

250 is assumed here, API doesn't give you the value used internally for this default marker click behaviour.

Btw. you may want to submit a feature request here: gmaps-api-issues or here: Android Maps Extensions (or both).

Hmm, do you mean to say that I will not be able to trigger a marker click through my code ? I understand how to use a marker click listener (I am actually using it my code), but I wanted to trigger the click through my code without having to touch/click on the marker.

I gave you a workaround. There is no such method Marker.doClick(), but you can call OnMarkerClickListener's method yourself without direct interaction with the library.

If you have a OnMarkerClickListener, you can just keep the reference and call a function on it sending marker as a param.

If you need to run default implementation when onMarkerClick returns false (or you have no OnMarkerClickListener), you need to do it yourself:

You cannot triger a marker click directly.

hi this works but i would like to show navigate buttons in onmarkerclick

Note