[OpenLayers-Dev] Format KML, network link, strategies

Jachym Cepicky jachym.cepicky at gmail.com
Tue Jan 15 01:16:46 PST 2013


Hi,

I have some design question about current OL.Format.KML implementation,
of the networklink element and it's usage.

Current implementation of usage of KML format in OpenLayers is, that you
define vector layer, url, strategies (which  can modify the url),
protocol (Script would be nice, but HTTP in this case) and format
(OL.Format.KML).

1) Strategy (e.g. OL.Strategy.BBOX) can add (using defaultFilter for
example) bounding box element to the URL (&bbox=minx,miny,maxx,maxy) or
other parameters (as said, using defaultFilter and custom filterToParams
method). Again: the url of the KML file *can be modified*.

The KML read() method parses the comming data. But KML does not need to
include any features, but just some raw dataset definition with network
link, from where the features can be downloaded. The target can be
server component, which serves dynamically desired features, based on
incomming parameters (e.g. bbox, but also time and others). Some of the
parameters are appended to the URL for example by Google Earth
automatically.

BUT OpenLayers.Format.KML does not enable (or I did not found any way
how to do that) way, how to append custom parameters to network-link
url. In the format, there is no reference to the layer - the format is
not "aware of" any mapping context. And so, it is not possible to apply
any filter/strategy to network-link KML.

And I would consider this as missing feature. I've found some solution
to this (manually adding layer attribute to the format and redefine the
OpenLayers.Format.KML.fetchLink(href) method (and fix the href). But is
that the proper way?

I hope, you understand my point, thanks for your comments.

Jachym


-- 
Jachym Cepicky
Help Service - Remote Sensing s.r.o.
jachym.cepicky at gmail.com
HS-RS: jachym at hsrs.cz http://bnhelp.cz
http://les-ejk.cz

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20130115/84c67705/attachment.pgp>


More information about the Dev mailing list