Open an infowindow with an external link--SIMPLE example.

2,641 views
Skip to first unread message

scott bjelland

unread,
Jan 6, 2011, 11:11:21 PM1/6/11
to google-map...@googlegroups.com
Hello,

I JUST started to try to use V3 for a new client project and I'm having some trouble. I cannot figure out how to open an infowindow using an external link--say a link on the same page, to the side of the map. YES, I've Googled this, and YES, I've searched this forum, but trying to implement the examples had not borne fruit. Can someone PLEASE point me to an example map with just one or two links opening one or two infowindows?? IT MUST BE SIMPLE for me to grasp this concept. I don't want to generate markers from an external XML file, I DON'T want to dynamically generate a list of markers in the side column (I've seen those examples) I'm just looking for ONE LITTLE MAP with one little marker and a nice javascript link which opens it. PLEASE, if anyone has this simple example could you help me out?

Thanks in advance.

Chris Broadfoot

unread,
Jan 7, 2011, 12:39:18 AM1/7/11
to google-map...@googlegroups.com
See here:
--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.

scott bjelland

unread,
Jan 7, 2011, 1:54:09 AM1/7/11
to google-map...@googlegroups.com
Thanks, but none of those examples at all fit the description I wrote of what I'm looking for. 

Chris Broadfoot

unread,
Jan 7, 2011, 3:32:06 AM1/7/11
to google-map...@googlegroups.com
You're extremely unlikely to find *exactly* what you're looking for. No one here is going to write code for you.

Check Larry's site for more sample code:


In particular, this one:
On Fri, Jan 7, 2011 at 5:54 PM, scott bjelland <scottb...@gmail.com> wrote:
Thanks, but none of those examples at all fit the description I wrote of what I'm looking for. 

--

dtipson

unread,
Jan 7, 2011, 3:38:57 PM1/7/11
to google-map...@googlegroups.com
You need some means to actually reference the marker in question, and fire a click event on it.

Once you've created the map, the marker, and the infowindow with javascript references to them all, you can just call

referencetoinfoWindow.open(referencetomap, referencetothemarker);
referencetoinfoWindow.setContent(whateverHTMLyouwantinthemarker);

scott bjelland

unread,
Jan 7, 2011, 6:03:22 PM1/7/11
to google-map...@googlegroups.com
Thanks dtipson...you understand what I'm looking to to. I think where I get hung up is exactly where to put these references...inside or outside of which tag, etc. etc. I've just started in with Google Maps V3 so this is all very new to me but I want to switch over and start using the newest version.

I'll focus on these two references you've pointed out in some of the examples of maps I have and maybe something will click. Unbelieveble, but I don't think a single example of this simple map feature exists anywhere on the web. All the examples are mixed in with using external XML files, etc. etc. which make it hard for a beginner to see exactly how to structure the basic elements.

dtipson

unread,
Jan 7, 2011, 6:44:29 PM1/7/11
to google-map...@googlegroups.com
I'm not sure what you mean about tags: I'm talking about simple javascript calls.  You create the map, you create the marker, you create the infowindow all with references to those objects, and then you can arbitrarily link ANY user action to making the infowindow open on that marker by calling the appropriate methods.  If you wanted to make a click event on some page element, ANY page element, trigger that behavior, then you'd attach a click event listener to that page element.  Are you using a javascript library like jQuery?  If so, it has a really simple way to do that:

<div id="pageelement">some text that when clicked on will fire the code to open the infowindow</div>

jQuery("#pageelement").click(function(){
execute some code (like the psuedocode I outlined above)
});


Reply all
Reply to author
Forward
0 new messages