Update with different source and update network locations

1 view
Skip to first unread message

phelpsw

unread,
May 30, 2008, 12:08:52 AM5/30/08
to KML Developer Support - KML Server Side Scripting
I have gone through the Update tutorial and after struggling through
discovered an undocumented limitation of Update. This example is
based off the update tutorial: http://code.google.com/apis/kml/documentation/updates.html
To recreate the problem try the following combination of files:

point_load.kml: (Exactly the same as Point-load.kml from tutorial)

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<NetworkLink>
<name>Loads Point.kml</name>
<Link>
<href>http://code.google.com/apis/kml/documentation/Point.kml</
href>
</Link>
</NetworkLink>
</kml>


update_load.kml (Same as Update-load.kml from tutorial except
different href):

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<NetworkLink>
<name>Update</name>
<Link>
<href>http://williamslabs.com/update.kml</href>
</Link>
</NetworkLink>
</kml>

update.kml (Exactly the same as NetworkLinkControl-Update.kml from
tutorial) (file hosted at http://williamslabs.com/update.kml):

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<NetworkLinkControl>
<Update>
<targetHref>http://code.google.com/apis/kml/documentation/
Point.kml</targetHref>
<Change>
<Placemark targetId="pm123">
<name>Name changed by Update Change</name>
<!-- coordinates remain the same -->
</Placemark>
</Change>
</Update>
</NetworkLinkControl>
</kml>

This combination of files crashes Google Earth with no error message
displayed. It appears the use of two different urls, http://code.google.com
for the source and http://williamslabs.com for the update causes this
to break. When I host Point.kml as http://williamslabs.com/point.kml
then change <href> in point_load.kml to:
<href>http://williamslabs.com/point.kml</href>
Then I change <targetHref> in update.kml to the following:
<targetHref>http://williamslabs.com/point.kml</targetHref>

The example works as expected...Why do these urls need to be seemingly
coming from the same server? Is there a way around this? I wish to
use update to modify a kml document originating from another server.
Thanks.

phelpsw

unread,
May 30, 2008, 2:10:56 AM5/30/08
to KML Developer Support - KML Server Side Scripting
Might it be possible to embed the NetworkLinkControl in the
Point_load.kml document? After looking through the documentation I
see no reason this shouldn't work...though in trying it...clearly
things aren't so simple.

Is this 4 document update file structure really necessary? Where is
this documented? What is the reason for this limitation? Thank you.
> tutorial) (file hosted athttp://williamslabs.com/update.kml):
>
> <?xml version="1.0" encoding="UTF-8"?>
> <kml xmlns="http://earth.google.com/kml/2.1">
> <NetworkLinkControl>
> <Update>
> <targetHref>http://code.google.com/apis/kml/documentation/
> Point.kml</targetHref>
> <Change>
> <Placemark targetId="pm123">
> <name>Name changed by Update Change</name>
> <!-- coordinates remain the same -->
> </Placemark>
> </Change>
> </Update>
> </NetworkLinkControl>
> </kml>
>
> This combination of files crashes Google Earth with no error message
> displayed. It appears the use of two different urls,http://code.google.com
> for the source andhttp://williamslabs.comfor the update causes this
> to break. When I host Point.kml ashttp://williamslabs.com/point.kml

ManoM

unread,
Jun 3, 2008, 2:03:09 PM6/3/08
to KML Developer Support - KML Server Side Scripting
This is a security provision, to prevent someone from changing a KML
that someone else created.

Mano

On May 29, 9:08 pm, phelpsw wrote:
> tutorial) (file hosted athttp://williamslabs.com/update.kml):
>
> <?xml version="1.0" encoding="UTF-8"?>
> <kml xmlns="http://earth.google.com/kml/2.1">
> <NetworkLinkControl>
> <Update>
> <targetHref>http://code.google.com/apis/kml/documentation/
> Point.kml</targetHref>
> <Change>
> <Placemark targetId="pm123">
> <name>Name changed by Update Change</name>
> <!-- coordinates remain the same -->
> </Placemark>
> </Change>
> </Update>
> </NetworkLinkControl>
> </kml>
>
> This combination of files crashes Google Earth with no error message
> displayed. It appears the use of two different urls,http://code.google.com
> for the source andhttp://williamslabs.comfor the update causes this
> to break. When I host Point.kml ashttp://williamslabs.com/point.kml
Reply all
Reply to author
Forward
0 new messages