Network Link - refresh view/LookAt not working?

360 views
Skip to first unread message

Py

unread,
Dec 13, 2009, 2:38:11 PM12/13/09
to KML Developer Support - KML Server Side Scripting, pyz...@gmail.com
I am successfully updating a placemark name, position and also it's
LookAt property periodically every second via Network Link.

The place mark moves and changes it's label just fine. But I can not
manage to get the"View" (LookAt) to be refreshed (it is updated), I
have to click on it to force the update to reflect on the screen. How
can I get the lookat also refreshing without user interaction? Also I
am not able to use any of the gx: tags, I do have the proper extension
configured in the header:

<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://
www.google.com/kml/ext/2.2">

I alway get error messages "not supported gx:...". Using latest 5.1
google earth on Linux.

Great documentation so far!

--------
I use python to compute new positions and heading, all works, only the
"LookAt" does not refresh with out clicking on the updated object
(Placemark moves OK):
...
kml = (
'<?xml version="1.0" encoding="UTF-8"?>\n'
'<kml ' + kml_extensions + '>\n'
'<NetworkLinkControl>\n'
' <Update>\n'
' <targetHref>%s</targetHref>\n'%update_target +
' <Change>\n'
' <Placemark targetId="pmr1">\n'
' <name>"Rider at %s"</name>\n'%name +
' <Point>\n'
' <coordinates>%f,%f</coordinates>\n' %(longitude,
latitude) +
' </Point>\n'
' <LookAt>\n'
' <longitude>%f</longitude>\n'
' <latitude>%f</latitude>\n'
' <altitude>%f</altitude>\n'
' <heading>%f</heading>\n'
' <tilt>75</tilt>\n'
' <range>200</range>\n'
' <altitudeMode>absolute</altitudeMode>\n'
' </LookAt>\n' %(longitude,latitude,altitude,heading) +
' </Placemark>\n'
' </Change>\n'
' </Update>\n'
'</NetworkLinkControl>\n'
'</kml>\n' )
return kml

----------------------------------

Thanks.
-Percy

ManoM

unread,
Jan 7, 2010, 9:01:50 PM1/7/10
to KML Developer Support - KML Server Side Scripting
Hi Percy,

Don't know if you figured this out yet, but Update isn't designed to,
as you've discovered, change the view. The only way to automatically
change the view is to use flyToView:
http://code.google.com/apis/kml/documentation/kmlreference.html#flytoview

Mano

Py

unread,
Jan 10, 2010, 10:54:55 PM1/10/10
to KML Developer Support - KML Server Side Scripting
Hi Mano,

To bad. Yes, I know, fly to works exactly once on load of the Network-
Link -- but not on automatic updates of it's data.
I figured I can automatic update and load new network link(s) in a
badly recursive way... not so great.

My dumb solution so far: hold down the Enter key (with some weight) on
the place to refresh the view of...............

Is there any alternative way to do this? I like to real time visualize
a route like flight following some path.

-Percy

On Jan 7, 9:01 pm, ManoM wrote:
> Hi Percy,
>
> Don't know if you figured this out yet, but Update isn't designed to,
> as you've discovered, change the view. The only way to automatically
> change the view is to use flyToView:http://code.google.com/apis/kml/documentation/kmlreference.html#flyto...

ManoM

unread,
Jan 11, 2010, 3:06:26 PM1/11/10
to KML Developer Support - KML Server Side Scripting
How's this?

1) Have a NetworkLink with a flyToView of 1
2) Load in a NetworkLinkControl that either a) Updated/Changeda
LineString to change the coordinates or b) Update/Created a new
LineString (or Point or MultiGeometry)
3) Make sure your NLC has a LookAt or Camera on it

Mano
> > > -Percy- Hide quoted text -
>
> - Show quoted text -

Py

unread,
Jan 13, 2010, 8:10:52 PM1/13/10
to KML Developer Support - KML Server Side Scripting
I tried the FlyTo in the NLC, this works only once -- it does not
reload the NLC (regardless what I do with the NLC after initial load)
on the timed automatic updates, only the NL object positions are
updated correctly (and a LookAt in there is ignored).

What "worked and updated the view" but causes obviously some memory
issue after some time is this:
if I actually update/load the same (modified) Networklink again via
this NLC itself (recursively) this then loads (in addition, not reload/
update) as fast as it processes the NLC and I get a deep tree of
NLCs.... growing and growing.

ManoM

unread,
Jan 20, 2010, 9:29:54 PM1/20/10
to KML Developer Support - KML Server Side Scripting
Any chance you can let us look at what you produced?

Mano
> > > - Show quoted text -- Hide quoted text -
Reply all
Reply to author
Forward
0 new messages