Intercept Embedded Google Maps Clicks?

Discussion in 'Web Design and Development' started by Makosuke, Jun 16, 2007.

  1. Makosuke macrumors 603

    Joined:
    Aug 15, 2001
    Location:
    The Cool Part of CA, USA
    #1
    This is an involved enough question that I'm not hopeful for an answer, but can't hurt to try:

    I'm working on a site as a favor with an embedded Google map. And I've basically learned enough of the Maps API to do what I want--embed several maps that somebody else is working on in Google's MyMaps as layers that can be turned on and off with some checkboxes. This is the rough mockup:

    http://explorejefferson.jsdi.org/embedmaptest.html

    Now, the trick comes with links in the little "word balloons" that pop up when you click a marker. I want those links to pop up a new window with more info. Except I can't seem to figure out how to intercept the relevant clicks from the Maps API with some Javascript to create the new window.

    I know it can be done, since (aside from the fact that you can do pretty much anything with the Maps API) MyMapsPlus.com (neat service) is doing exactly that--they auto-build a map for an iFrame for you, and to avoid the links opening in the iFrame they automatically open a new window.

    I've tried to figure out how MyMapsPlus is doing it, but I'm a rank amateur at Javascript and their code is pretty dense, so I couldn't figure it out.

    Covering what seem to me to be the obvious alternatives, MyMapsPlus doesn't do the layers, I can't insert the Javascript directly into the maps popup bubbles because MyMaps seems to strip out any fancy formatting, and I can't put everything in the bubble because there's too much and I want it to be easily printable anyway.

    Is there some obvious way of doing this that I'm overlooking because I suck at Javascript, or is the right answer "Sit down and learn Javascript and the Maps API before asking questions, you lazy punk."?
     
  2. mnkeybsness macrumors 68030

    mnkeybsness

    Joined:
    Jun 25, 2001
    Location:
    Moneyapolis, Minnesota
    #2
    I think the easiest reply is "Sit down and learn Javascript and the Maps API" (not the lazy punk part)...

    Javascript can be intimidating, but once you get into it, it's a lot of fun and not that complicated.
     

Share This Page