NetworkLinkControl: Update: not so many files please

531 views
Skip to first unread message

gerryscat

unread,
Nov 10, 2009, 6:17:10 PM11/10/09
to KML Developer Support - KML Server Side Scripting
The example of updating a KML at http://code.google.com/apis/kml/documentation/updates.html
requires the user load 2 files, which is 1 too many.

We want the user to download 1 file from our server and that is all
they need to do. This file will contain a NetworkLink and a refresh
rate of 30 seconds. We do not want to download all the data every
time, so it would be nice to be able able to use the Update feature to
download changes only. But I haven't been able to get it to work
automatically. Any hints?

As a side note, the Create element must reference an existing
targetId. Seriously?

GG

unread,
Nov 12, 2009, 1:30:24 AM11/12/09
to KML Developer Support - KML Server Side Scripting

Arpad Borsos

unread,
Nov 27, 2009, 9:57:58 AM11/27/09
to KML Developer Support - KML Server Side Scripting
Thank you for your link GG, unfortunately it does not work for me. It
just doesn't update anything.

GG

unread,
Nov 30, 2009, 4:13:52 AM11/30/09
to KML Developer Support - KML Server Side Scripting
The example is taken from an working application, it works.
Is GE raising some errors? Check if GE is ignoring errors.

Arpad Borsos

unread,
Dec 1, 2009, 5:05:04 AM12/1/09
to KML Developer Support - KML Server Side Scripting
It is kind of strange, I got it partly working.

When I generate the kml myself, I got the updates working fine.

initial doc:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document id="doc"></Document>
</kml>

first update:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<NetworkLinkControl>
<Update>
<targetHref>http://localhost:10221/kml/</
targetHref><Create><Document targetId="doc">
<Placemark id="117545274">
<name>RP</name>
<description><![CDATA[Reichenhall]]></description>
<Point>
<coordinates>12.883438,47.730176,0</coordinates>
</Point>
</Placemark></Document></Create><Create><Document targetId="doc">
<Placemark id="1503374316">
<name>FH</name>
<description><![CDATA[Urstein]]></description>
<Point>
<coordinates>13.086905,47.723895,0</coordinates>
</Point>
</Placemark></Document></Create><Create><Document targetId="doc">
<Placemark id="32830322">
<LineString>
<extrude>1</extrude>
<tessellate>1</tessellate>
<coordinates>12.883438,47.730176,0 13.086905,47.723895,0
</coordinates>
</LineString>
</Placemark></Document></Create> </Update>
</NetworkLinkControl>
</kml>

but when I generate the kml using a library (which inserts some
useless nodes) the update does simply not show up, GE is not reporting
any errors whatsoever.

initial doc:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:atom="http://
www.w3.org/2005/Atom" xmlns:xal="urn:oasis:names:tc:ciq:xsdschema:xAL:
2.0" xmlns:gx="http://www.google.com/kml/ext/2.2">
<Document id="doc"/>
</kml>

first update:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:atom="http://
www.w3.org/2005/Atom" xmlns:xal="urn:oasis:names:tc:ciq:xsdschema:xAL:
2.0" xmlns:gx="http://www.google.com/kml/ext/2.2">
<NetworkLinkControl>
<minRefreshPeriod>0.0</minRefreshPeriod>
<maxSessionLength>-1.0</maxSessionLength>
<Update>
<targetHref>http://localhost:10221/kml/</targetHref>
<Create>
<Document targetId="doc">
<Placemark id="ce914a1a-a47b-4785-
bc23-2fb298de93cc">
<name>Reichenhall</name>
<description></description>
<Point>
<altitudeMode>clampToGround</altitudeMode>

<coordinates>12.876944444444,47.724722222222</coordinates>
</Point>
</Placemark>
</Document>
</Create>
<Create>
<Document targetId="doc">
<Placemark id="9c9985b5-b9c1-4614-
a7d6-5766e049d5e7">
<name>Salzburg</name>
<description></description>
<Point>
<altitudeMode>clampToGround</altitudeMode>
<coordinates>13.033333333333,47.8</
coordinates>
</Point>
</Placemark>
</Document>
</Create>
<Create>
<Document targetId="doc">
<Placemark id="a68dafc1-ead8-4787-
b3a3-00c1991bdbe8">
<LineString>
<extrude>true</extrude>
<tessellate>true</tessellate>
<altitudeMode>clampToGround</altitudeMode>

<coordinates>12.876944444444,47.724722222222 13.033333333333,47.8</
coordinates>
</LineString>
</Placemark>
</Document>
</Create>
</Update>
</NetworkLinkControl>
</kml>

tobermory

unread,
Jan 6, 2010, 2:54:52 PM1/6/10
to KML Developer Support - KML Server Side Scripting
Hi Arpad, I too had issues with Updates not working when my kml was
library generated, in my case using Java's jaxb binding to the
kml .xsd file.

I discovered that removing the third namespace, in your case the
xmlns:xal one, which is added by the library but probably not
referenced in your doc, caused the Updates to work.

This was last summer, I posted about it. Alas I can no longer re-
create the error. Maybe my GE version changed and some bug may have
been fixed. (hmm, my Update failure was in trying to 'move' a
placemark rather than re-name it. maybe I should investiate some
more)

hope this helps. Did you ever get to the bottom of it?

stuart
> <kml xmlns="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:xal="urn:oasis:names:tc:ciq:xsdschema:xAL:
> 2.0" xmlns:gx="http://www.google.com/kml/ext/2.2">
>     <Document id="doc"/>
> </kml>
>
> first update:
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <kml xmlns="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:xal="urn:oasis:names:tc:ciq:xsdschema:xAL:

tobermory

unread,
Jan 6, 2010, 3:26:38 PM1/6/10
to KML Developer Support - KML Server Side Scripting
Hi again, to follow up, my previous posting was in error. I CAN still
reproduce the failing update behaviour. I am using GE
5.1.3533.1731 on Mac OSX 10.5.8, using a local Tomcat to serve files.
Thus my urls are all http://localhost:8080/ if that matters (??)

Given 4 files as per the original Updates examples, but with an
attempt to move the placemark, i.e. set its Point to a new value on
each update, I can still see it NOT working (by not working I mean the
placemark is NOT repositioned on the map) when my update file is

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<kml xmlns="http://www.opengis.net/kml/2.2"
xmlns:ns2="http://www.w3.org/2005/Atom"
xmlns:ns3="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0">

<NetworkLinkControl>
<Update>
<targetHref>http://localhost:8080/kml/updates/placemark.kml</
targetHref>
<Change>
<Placemark targetId="p1">
<name>Name changed by Update Change</name>
<!-- coordinates remain the same -->
<Point>
<coordinates>-122,51.5 </coordinates>
</Point>
</Placemark>
</Change>
</Update>
</NetworkLinkControl>
</kml>


Yet if I remove the third namespace attribute definition from the root
kml element, on next update the placemark DOES move.


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<kml xmlns="http://www.opengis.net/kml/2.2"
xmlns:ns2="http://www.w3.org/2005/Atom">


<NetworkLinkControl>
<Update>
<targetHref>http://localhost:8080/kml/updates/placemark.kml</
targetHref>
<Change>
<Placemark targetId="p1">
<name>Name changed by Update Change</name>
<!-- coordinates remain the same -->
<Point>
<coordinates>-122,52.5 </coordinates>
</Point>
</Placemark>
</Change>
</Update>
</NetworkLinkControl>
</kml>

The lack of a visual update of the placemark is not seen as an error
that stops the repeating network link from asking for further
updates. I can see this by just tailing my www access logs.

So I still have NO idea why a seemingly innocuous namespace attribute
can interact with an Update like this. Maybe some element name clash
and a namespace bug?? I have no idea.

I had posted about this last year

http://markmail.org/message/sd4jf4lf2v7fmrri#query:kml%20xsd%20stuart+page:1+mid:sd4jf4lf2v7fmrri+state:results

but never followed up with Roman's suggestion to post all the files.

stuart

naren

unread,
Jan 14, 2010, 5:05:54 AM1/14/10
to KML Developer Support - KML Server Side Scripting
Hi,

i am showing information on map using kml file. like ..

geoXml = new GGeoXml("http://demo.somedomain.com/cta.kml");
map = new GMap2(document.getElementById("map_canvas"));

its working perfectly.
but if i use localhost insted of some domain. its not working..

geoXml = new GGeoXml("http://localhost/cta.kml");
map = new GMap2(document.getElementById("map_canvas"));

can you please help me to solve this problem ..

-Narendra


On Jan 7, 1:26 am, tobermory wrote:
> Hi again, to follow up, my previous posting was in error.  I CAN still
> reproduce the failing update behaviour. I am using GE
> 5.1.3533.1731 on Mac OSX 10.5.8, using a local Tomcat to serve files.
> Thus my urls are allhttp://localhost:8080/if that matters (??)
> http://markmail.org/message/sd4jf4lf2v7fmrri#query:kml%20xsd%20stuart...

ManoM

unread,
Jan 20, 2010, 9:31:32 PM1/20/10
to KML Developer Support - KML Server Side Scripting
Hi Narendra,

GGeoXml only works on publically accessible servers.

Mano

On Jan 14, 2:05 am, naren wrote:
> Hi,
>
> i a
m showing information on map using kml file. like ..
>
>         geoXml = new GGeoXml("http://demo.somedomain.com/cta.kml");
>         map = new GMap2(document.getElementById("map_canvas"));
>
> its working perfectly.
> but if i use localhost insted of some domain. its not working..
>
> geoXml = new GGeoXml("http://localhost/cta.kml");
> map = new GMap2(document.getElementById("map_canvas"));
>
> can you please help me to solve this problem ..
>
> -Narendra
>
> On Jan 7, 1:26 am, tobermory wrote:
>
>
>
> > Hi again, to follow up, my previous posting was in error.  I CAN still
> > reproduce the failing update behaviour. I am using GE
> > 5.1.3533.1731 on Mac OSX 10.5.8, using a local Tomcat to serve files.
> > Thus my urls are allhttp://localhost:8080/ifthat matters (??)
> > stuart- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages