[OpenLayers-Dev] feature event / highlight a feature

Tim Schaub noreply at geocartic.com
Fri Mar 30 13:44:45 EDT 2007


Hello Christine-

Christine Spietz wrote:
> In the example is a vector-Layer and I'm able to paint polygons in the
> Vector-layer and then select them.
> 
> But I do not only want to paint polygons, I want to paint "real" features
> like:
> 
> <gml:featureMember>
> ... GML nonsense
> </gml:featureMember>
> 

If you want use GML to create vector features see:

http://openlayers.org/dev/examples/gml-layer.html

and

http://openlayers.org/dev/examples/GMLParser.html

The first example uses a Layer.GML - a subclass of Layer.Vector.  With 
the GML layer, you construct it with a title and the path to your GML. 
All the features in the GML will be added to your layer.

The second example uses the Format.GML - a GML parser.  In this example, 
you can see how to construct a Format.GML and call the read method to 
get an array of features.  Then you can do whatever you want with these 
features (like add them to a vector layer to have them displayed).

Hope that helps,

Tim



More information about the Dev mailing list