[OpenLayers-Users] dynamic generated kml-layer

Eric Lemoine eric.c2c at gmail.com
Mon Jun 16 17:21:25 EDT 2008


Roald, using Layer.WFS with Format.KML requires having a WFS service
sending features represented in the KML format. Are you aware of any
server capable of that? Maybe GeoServer? Hmm or FeatureServer? Thanks.
Eric

2008/6/16, Roald de Wit <roald.dewit at lisasoft.com>:
> Hi  Christian,
>
> Christian Schanz wrote:
>> what is the best way to add a dynamically generated kml-layer to a map?
>> The kml is generated by passing the current extent of the view and so
>> the layer should be updated after zooming or moving.
>>
> What you describe here is effectively the behaviour of a WFS layer. If I
> remember correctly, since 2.6 (current stable release) you can create a
> WFS layer and define what the format should be. In your case, that would
> be OpenLayers.Format.KML:
>
>     var layer = new OpenLayers.Layer.WFS( "KML Layer ", url, params,
>     {format: OpenLayers.Format.KML, extractStyles: true,
>     extractAttributes: true} );
>
> It will automatically add a bbox parameter to the request string. If
> that is enough for you, then you're ready to go. If not: in your params
> parameter you can put anything you'd like to send to the server.  Not
> sure how to dynamically add the current zoomlevel etc. Make sure you use
> Firebug in Firefox to test what requests are sent to your server.
>
> I hope this helps you in the right direction.
>
> Kind regards,
>
> Roald
>
> --
> Roald de Wit
> Software Engineer
> roald.dewit at lisasoft.com
>
> Commercial Support for Open Source GIS Software
> http://lisasoft.com/LISAsoft/SupportedProducts/
>
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>



More information about the Users mailing list