Hi Barry,
Thank you for your answer.
On May 27, 2:31 pm, barryhunter [KML Guru] wrote:
> On May 26, 5:07 pm, tl wrote:
>
> > Hi,
>
> > When i click on a placemark, I would like to trigger some web action
> > scripts.
>
> > The first solution i tried is to insert some URL in the balloon so
> > that when i click on the URL, a php script is started on my web
> > server : "
http://myserver/doaction1.php", "
http://myserver/
> > doaction2.php" etc. If the script generate a web page, the link is
> > opened in the web navigator and the action is done. The problem for me
> > with this solution is that i want to avoid to open the navigator
>
> You could perhaps make the script return a single pixel image, and
> then include the script in a <img> tag? That would register when the
> balloon content displays.
>
> Or if you do want to link to another KML, perhaps you could use the
> <description>
> <![CDATA[
> <a href="
http://myServer.com/
> CraftsFairs.kml#Albuquerque;balloonFlyto">
> One of the Best Art Shows in the West</a>
> ]]>
> </description> construct.
http://code.google.com/apis/kml/documentation/kmlreference.html#descr...
Mmm your idea is interesting but i don't necessarily wants my script
to be triggered when the balloon is displayed (but your idea gives
other more possibilities :) ). i have several choices, so i prefer to
represent like a toolbar in the balloon so that we can choose which
script to call.
Anyway, i tried your solution, there is still the same issue: the
script is called only the first time we click on the placemark. On the
second click the image is not reloaded as GE probably has it in a
cache somewhere. So the script is not called a second time.
>
> But I feel I dont fully understand your issue. Perhaps you have an
> online example you can link to - a picture speaks a thousend words
> etc...
So far i am still doing local test.
>
>
>
> > So I am trying to generate KML files from my action scripts. If the
> > scripts generate a <Document>, then each time the user click on the
> > related URL, a new document is added in my temporary list, which is
> > not perfect either. Also if i click several time on the same URL, only
> > the first click will trigger the script, i guess further don't work
> > because GE believes it is a static KML file and use his cache.
>
> You might be able to explictly control that using Cache-Control and
> Expires HTTP headers.
Well if i generate HTML, i add that:
<meta http-equiv="PRAGMA" content="NO-CACHE" />
<meta http-equiv="EXPIRES" content="-1" />
and it works fine, but i could not find any similar way for KML with a
NetworkLinkControl.