Dynamically Change Refresh Period of Network Link

204 views
Skip to first unread message

FastWave

unread,
Oct 18, 2006, 1:07:28 AM10/18/06
to KML Discussions
HI,
I am creating an application that plots gps positions over time. eg: someone is walking with a gps and I plot where they have been.

I have a Network Link which loads in kml data from a web server, Refresh is Once Only.

I have another Network Link which loads in an NetworkLink UPDATE that CREATES new gps points in Google Earth. The refresh is initially set to ONINTERVAL every 5 minutes.

My problem is I want to change the REFRESH INTERVAL of the UPDATE network link dynamically based on the urgency of the data which is determined when the UPDATE kml file is created dynamically from a database.

I can't work out a way to change this value dynamically from an Network Link Update.

I have also tried using a REFRESH of ONEXPIRE but cannot work out how to make the UPDATE network link expire.

I do not want to REFRESH the initial Network Link which loads first as it can be very large.

Does anyone have any ideas or suggestions ?

Thanks
Gary

barryhunter

unread,
Oct 18, 2006, 10:26:51 AM10/18/06
to KML Discussions
Two ways you should be able to do this in theory...

1) use OnExpires, and then make the script that returns the content for the network link set and expires header. For example the first time its loaded it returns 5minutes, so GE keeps the content and after 5mins refreshes it, this time the link sets an expired for 4 mins, so this time GE will wait 4mins before refreshings, repeat as required...
I think you can use a http header or <expires> tag inside NetworkLinkControl
See http://earth.google.com/kml/kml_21tutorial.html#expiration

2) use MinRefreshPeriod tag as in a NetworkLinkControl in side the content of the link, this would work very similar to 1) in that each time the link is refreshed it can choose how long to wait until the next refresh. For this to work will need to set the refresh period very low (eg 10 seconds) but it should never refresh that often beucase of the NetworkLinkControl telling it otherwise.
http://earth.google.com/kml/kml_tags_21.html#networklinkcontrol

I say theory as never tried either of these techniques to see if they work!

Valery35

unread,
Oct 18, 2006, 1:02:45 PM10/18/06
to KML Discussions
Yeah Barry

With old "SQL servers - based " applications no problems. We have events from server. NL not can return classic event and we can research tags NL control and the site setup only.

To GE team: "Refresh by event" it is next step of NL options?

IMHO <expires> is not dynamic solution. This stored in cash and we not see last events. As image in baloon. Maybe it is my errors with parameters of pages.

I while not use this also.

Thanks. Interest post.
Reply all
Reply to author
Forward
0 new messages