Larry:

The link in the page that fires the modal is:

<a href="external-content.htm" rel="#overlay">

Further down the page you see the following javascript that
triggers the modal:

<script>
$(function() {

        // if the function argument is given to overlay,
        // it is assumed to be the onBeforeLoad event listener
        $("a[rel]").overlay({

                expose: 'darkorange',
                effect: 'apple',

                onBeforeLoad: function() {

                        // grab wrapper element inside content
                        var wrap = this.getContent().find(".contentWrap");

                        // load the page specified in the trigger
                        wrap.load(this.getTrigger().attr("href"));
                }

        });
});
</script>

If the link in the kml could be intercepted and redirected to the
javascript on
the page, it would work. Not quite sure what js would trigger the
modal and with
the code I included you probably can determine that.

One of the reasons I want to use kml links is that I have a php script
that writes
the kml file from a mysql database. Each link in the "kml description
cdata" must be
unique so as to load different data in the modals. I'm obviously a
little lost
on a solution and appreciate any suggestions you may have.

Thanks,

Jim

On Mar 21, 4:20 pm, "[email protected]" <[email protected]>
wrote:
> On Mar 21, 5:01 pm, beachjim <[email protected]> wrote:
>
> > Larry:
>
> > What it is not doing is firing the javascript and the modal window. If
> > you look at the html, the button code that opens a modal is the same as
> > the code in the kml file. It looks like the google api is loading last and
> > ignoring any other javascript on the page when referenced from the kml. I
> > thought changing the target to _self would change that but evidently not.
> > It looks as though I am unable to call javascript from the kml
>
> I don't think you can call javascript from kml that has been rendered
> by GGeoXml (I don't see any javascript in your kml).  But you should
> be able to execute it in the infowindowopen (and
> infowindowprepareopen) handlers.
>
> What is the javascript that you expect to run to do the modal window?
>
>   -- Larry
>
> > to open the modal and may have to resort to a different method other than
> > a direct link in the kml file. Is that correct, I obvously
> > want the easy way out...!
>
> > Jim
>
> > On Mar 21, 3:53 pm, "[email protected]" <[email protected]>
> > wrote:
>
> > > On Mar 21, 4:41 pm, "[email protected]" <[email protected]>
> > > wrote:
>
> > > > On Mar 21, 4:01 pm, Jim Vleck <[email protected]> wrote:
>
> > > > > Larry:
>
> > > > > Thank you very much for taking a look at my code. The code I included
> > > > > to change the target of the ballon link is in the main page and is:
>
> > > > > GEvent.addListener(map,"infowindowprepareopen", function(iwtabs) {
> > > > >                  iwtabs[0].contentElem.innerHTML =
> > > > > iwtabs[0].contentElem.innerHTML.replace("_blank", "_self");
> > > > >                  });
>
> > > > Didn't notice that.  However I don't see that event in the
> > > > documentation, only 
> > > > infowindowopen:http://code.google.com/apis/maps/documentation/reference.html#GMap2.i...
>
> > > > But it does seem to fire. I can append a link that works to the
> > > > innerHTML, maybe the .replace isn't working the way you expect.
>
> > > Actually, it does seem to be doing what you expect (I didn't read the
> > > text, silly me "Click Photo to View Property", seems pretty clear,
> > > when I do click on the photo and not that text), it 
> > > openshttp://www.elgolfonow.com/external-content2.htm
> > > in the same browser window.
>
> > > What do you think it is doing wrong?  I see that the _blank is
> > > replaced by _self in innerHTML.  That obviously doesn't relate to the
> > > topic of the post though... so the fact that this is doing what I
> > > would expect may not solve your problem.
>
> > >     -- Larry
>
> > > > > I appreciate your assistance and will take a look at the other parsers
> > > > > you mentioned. Please don't hesitate to comment further.
>
> > > > > Best Regards,
>
> > > > > Jim Vleck
>
> > > > > At 11:00 AM 3/21/2010, you wrote:
>
> > > > > >On Mar 21, 9:07 am, beachjim <[email protected]> wrote:
> > > > > > > I am really stumped on how to get a link in a KML (Google Map) 
> > > > > > > file to
> > > > > > > trigger a modal window. I have a test page setup at:
>
> > > > > > >http://www.elgolfonow.com/indexmap.html
>
> > > > > > > I did see how to change the target of the link in the balloon 
> > > > > > > which is
> > > > > > > in the "description". I have added that code to the Google 
> > > > > > > javascript.
>
> > > > > >Where have you added that code? I don't see it.
>
> > > > > > > The same code I use on the button on the page to trigger a modal 
> > > > > > > is
> > > > > > > the same code I used in the KML file in the "description" tag.
>
> > > > > >I don't see any code in the KML file.  But any javascript there will
> > > > > >be stripped out by GGeoXml.  You may need to investigate the third
> > > > > >party parsers:
> > > > > >http://econym.org.uk/gmap/egeoxml.htm
> > > > > >or
> > > > > >http://www.dyasdesigns.com/geoxml/
>
> > > > > >BTW - this line gives an error:
> > > > > >         var marker=new GMarker(marker);
>
> > > > > >because marker is undefined (and it is not a GLatLng, which GMarker
> > > > > >requires as its first argument)..
>
> > > > > >   -- Larry
>
> > > > > > > Still stumped and any ideas or assistance would be greatly
> > > > > > > appreciated.
>
> > > > > > > Best,
>
> > > > > > > Jim
>
> > > > > >--
> > > > > >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.
>
> > > > > Jim Vleck
> > > > > Chief Technology Officer
> > > > > OCEAN VOYAGE sales performance agencyhttp://www.oceanvoyage.com
> > > > > 800 357-1299  Ext. 6
> > > > > 858 922-6023 Cell

-- 
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