Updating kml file

407 views
Skip to first unread message

L01

unread,
Oct 25, 2006, 6:11:23 AM10/25/06
to KML Discussions
Hi,

I'm using the kml tutorial (http://earth.google.com/kml/kml_21tutorial.html#updates).

The update works fine but there is one problem; when i load the update kml file, GE don't fly to the new coordinates.
The placemark is well changed.

How can I do that?

Here are my kml files:

Point-load.kml
Code:
 
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<NetworkLink>
<name>Loads Point.kml</name>
<flyToView>1</flyToView>
<Link>
<href>/tmp/Point.kml</href>
</Link>
</NetworkLink>
</kml>



Point.kml

Code:
 
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Document id="123">
<Placemark id="pm123">
<name>point123</name>
<LookAt id="la123">
<longitude>5.36318055556</longitude>
<latitude>51.8579722222</latitude> <range>500</range>
<tilt>0</tilt>
<heading>0</heading>
<altitudeMode>relativeToGround</altitudeMode>
</LookAt>
<Point id="p123">
<coordinates>5.36318055556,51.8579722222,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>



Update_load.kml
Code:
 
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<NetworkLink>
<name>This is the update</name>
<Link>
<href>/tmp/NetworkLinkControl-Update.kml</href>
</Link>
</NetworkLink>
</kml>



NetworkLinkControl-Update.kml

Code:
 <?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<NetworkLinkControl>
<flyToView>1</flyToView>

<Update>
<targetHref>/tmp/Point.kml</targetHref>
<Change>
<Placemark targetId="pm123">
<name>Laats bekende positie</name>
</Placemark>
</Change>
<Change>
<Point targetId="p123">
<coordinates>4.36010115937,51.8579722222,0</coordinates>
</Point>
</Change>
<Change>
<LookAt targetId="la123">
<longitude>4.36010115937</longitude>
<latitude>51.8579722222</latitude>
<range>500</range>
<tilt>0</tilt>
<heading>0</heading>
<altitudeMode>relativeToGround</altitudeMode>
</LookAt>
</Change>



</Update>

</NetworkLinkControl>
</kml>



Thank you for taking time to look at it.

L01

svens

unread,
Oct 25, 2006, 7:54:27 AM10/25/06
to KML Discussions
Point.kml will be updated but is not reactivated.
If you click it, it will have a changed lookat.
You might try a refreshMode onChange in its calling networklink.

What will work for sure, is the updater have its own LookAt:

Code:
<Document>
<LookAt>

<longitude>4.36010115937</longitude>
<latitude>51.8579722222</latitude>
<range>500</range>
<tilt>0</tilt>
<heading>0</heading>
<altitudeMode>relativeToGround</altitudeMode>
</LookAt>
</Document>


</kml>

L01

unread,
Oct 25, 2006, 9:46:41 AM10/25/06
to KML Discussions
[dutchmode]
Geweldig! hier ben ik zeker al 2 dagen naar op zoek! thnx man!
[dutchmode]

Thnx mate, you're awsome! it works verry well!

ManoM

unread,
Oct 25, 2006, 11:54:42 AM10/25/06
to KML Discussions
Hi svens,

This produces a fly-to effect when you launch the Update-Load file? That doesn't happen for me. What version of GE are you using?

ManoM

svens

unread,
Oct 25, 2006, 2:19:24 PM10/25/06
to KML Discussions
GE4
You need to set the flytoview of the updating network link to 1
So it will fly to the view of the updating file instead of flying to the view of the updated file

nwl data (flytoview off)
file data (doesn't need lookat)
nwl update (flytoview on)
file update (add document containing lookat after networklinkcontrol)

example

svens

unread,
Oct 25, 2006, 2:22:24 PM10/25/06
to KML Discussions
have a look at my other productions:list of messages
Reply all
Reply to author
Forward
0 new messages