Just add the link to your "address" variable.  Something like this

Change this:
address =  "Spenst Kristiansand<br />Henrik Wergelands g 29<br />4612
Kristiansand";

To this:
address =  "Spenst Kristiansand<br />Henrik Wergelands g 29<br />4612
Kristiansand<br/> <a target='blank' href='/http://website.com'>link</
a>";

Where "website.com" is the name of website for this entry and "link"
is any text you want the user to click on to activate the link.

On Apr 6, 2:26 pm, ajr <[email protected]> wrote:
> Thanks PapaBear.
>
> I have to say that I am a complete novice at making the google maps
> and copied the code from a site that provides basic code for the maps.
> I added in what you suggested, but it did not work, although I am
> probably putting it in the wrong place.
>
> But, that code you provided, will it work with what I have in the map
> code -
> ----------------------------------------------------
>
>    // Create the marker and corresponding information window
> function createInfoMarker(point, address) {
>    var marker = new GMarker(point);
>    GEvent.addListener(marker, "click",
>       function() {
>          marker.openInfoWindowHtml(address);
>       }
>    );
>   return marker;}
>
> // Spenst kristiansand
> var point = new GPoint(7.998284, 58.144695);
> address =  "Spenst Kristiansand<br />Henrik Wergelands g 29<br />4612
> Kristiansand";
> var marker = createInfoMarker(point, address);
> map.addOverlay(marker);
>
> ---------------------------------------------------------------------------------------
>
> Thanks again for your help.
> Adam
>
> On Apr 6, 7:55 pm, Papa Bear <[email protected]> wrote:
>
> > In the function that adds the marker start with the text you want in
> > the infowindow
>
> > var htmltext = "blah blah Mike's Gym blah blah ..."
>
> > then add the link
>
> > htmltext += '<a target="linkWindow" href="http://www.MikesGym.com'">Mikes 
> > Gym</a>'
>
> > Then after creating the marker, call the listener thus:
>
> > function addListeners(marker, htmltext) {
> >   GEvent.addListener(marker, "click", function() {
> >     marker.openInfoWindowHtml(htmltext);
> >   } );
> >   return marker;
>
> > }
>
> > On Apr 6, 12:03 pm, ajr <[email protected]> wrote:
>
> > > Hi,
>
> > > Firstly, I hope I am the correct group - I have a Google API map.
>
> > > I have a site with a google map 
> > > -http://www.gymlink.no/treningssenter/vestagder/kristiansandkart.html
> > > (This is a gym directory). I would like to add a website link to the
> > > description when the arrow is clicked and an information box comes up.
> > > For example, Mikes Gym, the address and then a link to his site.
>
> > > I tried many different things, but cant seem to get one on there.
> > > Based on the code I have used for the map, how can I add a link?
>
> > > Would appreciate any help. Cheers Adam- Hide quoted text -
>
> > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to