Problems with NetworkLinkControl and servlet URLs

161 views
Skip to first unread message

Jason M

unread,
Nov 28, 2011, 6:05:20 PM11/28/11
to KML Developer Support - KML Server Side Scripting
The various tutorials either use a static KML via NetworkLinkControls
with absolute URLs or servlets whose NetworkLink and
NetworkLinkControl are handled from the same servlet [same base URL
with no parameters].

However, what's the trick to having a servlet with different
parameters in its URL with NetworkLinkControls to modify content.

Suppose the initial load creates a NetworkLink:

<kml xmlns="http://www.opengis.net/kml/2.2">
<NetworkLink>
<Link>
<href>http://localhost:8080/testServlet</href>
<httpQuery>fetch=kml&otherparameters...</httpQuery>
</Link>
</NetworkLink>
</kml>

Receiving the parameters loads the initial KML content:

<kml xmlns="http://www.opengis.net/kml/2.2">
<Placemark id="pm123">
<name>Placemark</name>
<description><![CDATA[Click <A href="http://localhost:
8080/testServlet?action=move">here</a> to move location
]]></description>
<Point>
<coordinates>...</coordinates>
</Point>
</Placemark>
</kml>

Now a move action generates this KML:

<kml xmlns="http://www.opengis.net/kml/2.2">
<NetworkLinkControl>
<Update>
<targetHref>http://localhost:8080/testServlet</targetHref>
<Change>
<Placemark targetId="pm123">
<name>Name changed by Update Change</name>
<Snippet>Snippet added by Update Change</Snippet>
</Placemark>
</Change>
</Update>
</NetworkLinkControl>
</kml>

But the original KML is unchanged..

Likewise, tried targetHref as http://localhost:8080/testServlet?fetch=kml&otherparameters..
to match the URL as would be modified via the HttpQuery parameter.

Patrick M. Tucker

unread,
Nov 29, 2011, 12:01:31 PM11/29/11
to KML Developer Support - KML Server Side Scripting
Parameters can be written into the cookie element of your
NetworkLinkControl element. Take a look and see if that helps...

> Likewise, tried targetHref ashttp://localhost:8080/testServlet?fetch=kml&otherparameters..

Reply all
Reply to author
Forward
0 new messages