2

Qualifiers: First, my application is a native Android application using Google Map v2. Second, I'm not looking for someone to provide code on how to implement a detailed solution but instead I'm simply looking for possible high level design approaches I could take to achieve my objectives. If you have specifics that you can share I'm definitely appreciative of anything you may want to volunteer but first and foremost I'm looking for high level design recommendations as I'm more than willing to figure out all of the details. All I ask is that if you do provide some recommendations please qualify whether the recommendation is based on theory (which is fine) or whether you know that it is possible (e.g., you've implemented something similar or know with a high level of confidence that it will work).

BTW, I've already spent considerable time looking at Google docs, somewhat related S.O. posts re: marker's and other related tutorials but I haven't found anything yet that gives me the info I need to design an acceptable solution. Perhaps the info is right under my nose and i'm just missing it?

Objective: Upon opening the Map marker info window give the user the ability to either:

1) Close the Marker's info window (e.g., by tapping an "x" in upper right window) without having to open another Marker's info window;

OR

2) "Tap" on the "body" of the info window and launch a separate activity to display a more detailed map for this marker.

I can easily see ways to accomplish either 1 or 2 separately but not both from the same info window screen for a given marker.

I need to give the user the ability to take either of these actions because upon seeing the marker's info window content the user will either want to retrieve more info regarding the location or simply close the marker window and perhaps look at other marker's info window content.

BTW, I am familiar with the following Google statement regarding Marker info window:

As mentioned in the previous section on info windows, an info window is not a live View, rather the view is rendered as an image onto the map. As a result, any listeners you set on the view are disregarded and you cannot distinguish between click events on various parts of the view. You are advised not to place interactive components — such as buttons, checkboxes, or text inputs — within your custom info window.

Perhaps the aforementioned quote means I won't be able to do what I want to do without some sort of "trickery"...e.g., replacing the standard info window with my own?

BTW I've seen other apps marker's that do provide a close ("x") button on the marker's info window...but not sure what version of Maps they were using (i.e., v1 or v2). Maybe having an "x" close button was standard with v1 Map api?

Cheers,

user2101068
  • 617
  • 1
  • 8
  • 23
  • Do you really need the "x" close button? User can always tap outside to close the info window. – MaciejGórski May 15 '13 at 22:23
  • Macie, True i could have them do that...but it seems much more natural (and user friendly) that someone would either tap the "x" to close the info window or tap the "body" of it to take further action...making the user first tap outside of the info window to make it disappear first is not at all intuitive to me and i think from a usability perspective a questionable design choice by Google. One option I thought of (however not ideal) was "upon" click create a dialog window and have the user select "close" or "retrieve more info". Thoughts? Other ideas? – user2101068 May 15 '13 at 22:48
  • I don't like this limitation either, but hey... this is programming and anything is possible. I'd encourage you to try out my answer. I will do it myself if I start a new project that uses maps. Using dialog should be sufficient **if** you make it have a custom look. The default one would be scary above 3D shiny maps. – MaciejGórski May 15 '13 at 22:53
  • Thanks! I saw your suggested solution after I added my comment. BTW, there are so many things about Android that I find troubling and would love to hear their rationale for why they have done/do what they have do (e.g., seemingly capricious deprecation of API's with no rational or suggested alternative)...short of going to Google I/O and tracking down the right person to ask...is there any forum to ask Google these type of "why" questions? – user2101068 May 15 '13 at 23:18
  • I this [android developers googlegroup](https://groups.google.com/forum/?fromgroups#!forum/android-developers) is a good place. A bunch of Android experts offering advice there. You can also ask the same questions here of course. – MaciejGórski May 15 '13 at 23:28

1 Answers1

1

There is a workaround for this (which I haven't tested myself yet) here: Google Maps Android API v2 - Interactive InfoWindow (like in original android google maps).

If you do try it, I would be glad to hear how it works.

Community
  • 1
  • 1
MaciejGórski
  • 22,187
  • 7
  • 70
  • 94
  • Maciej, just saw your comment here. I also saw this post when I was researching alternative solutions. I didn't pursue it because it looked a bit complicated and I was hoping that there might be a simpler approach....I will let you know if i end up implementing this solution. – user2101068 May 15 '13 at 23:08