Hi Guys I am using Google Maps Android API v2. I loaded the Map and placed few Marker. I wanted to display a HTML URL in the "infoWindow" but Google seems to suggest its not possible https://developers.google.com/maps/documentation/android/infowindows#custom_info_windows. can it be done using "OnInfoWindowClickListener"? So that i open a dialogue box using this listener which contains a HTML URL?
Asked
Active
Viewed 359 times
1
-
It is not possible to do that via html, but if you put view with `OnClickListener`, you can achieve that using method from an answer here: http://stackoverflow.com/questions/14123243/google-maps-api-v2-custom-infowindow-like-in-original-android-google-maps – MaciejGórski Nov 12 '13 at 14:44
-
I have already started working on trying OnInfoWindowClickListener solution below, if i am not able to achieve what i want will try your solution. THanks for trying to help – rajat bhivania Nov 13 '13 at 03:53
1 Answers
0
I wanted to display a HTML URL in the "infoWindow" but Google seems to suggest its not possible
You can display pretty much whatever you want in an info window (though I have not tried anything that uses a SurfaceView
). You cannot respond to clicks on anything other than then entire info window.
can it be done using "OnInfoWindowClickListener"? So that i open a dialogue box using this listener which contains a HTML URL?
You are welcome to do whatever you wish when the user clicks on an info window.

CommonsWare
- 986,068
- 189
- 2,389
- 2,491
-
That was my problem, i.e. not being able to click the URL inside infoWindow. Could you help me with some sample codes on onInfoWindowClicklistener ? – rajat bhivania Nov 12 '13 at 12:27
-
@rajatbhivania: https://github.com/commonsguy/cw-omnibus/tree/master/MapsV2/Popups is a sample app that has an `OnInfoWindowClickListener`. In my case, I just display a `Toast`, but you could `show()` a `DialogFragment`, or `startActivity()`, or execute a `FragmentTransaction`, or pretty much whatever you want. – CommonsWare Nov 12 '13 at 12:45