[OpenLayers-Users] Style WFS-Layer

Bart van den Eijnden bartvde at opengeo.org
Fri Sep 28 01:03:16 PDT 2012


Please check out this example:

http://www.openlayers.org/dev/examples/stylemap.html

Best regards,
Bart

-- 
Bart van den Eijnden
OpenGeo - http://opengeo.org
Expert service straight from the developers.



On Sep 28, 2012, at 9:56 AM, vGIS <valentino1s73s at gmx.net> wrote:

> I'd like to style several WFS-Layers with one StyleObject:
> 
> WFS-Layers look like these:
> 
> 		var wfs_point = new OpenLayers.Layer.Vector("Multi Point Feature", {
> 				strategies: [new OpenLayers.Strategy.BBOX(), save_point],
> 				styleMap: *StyleObjekt*,
> 				protocol: new OpenLayers.Protocol.WFS({
> 				    version: "1.1.0",
> 				    url: "http://localhost:8080/geoserver/wfs",
> 					featureType: "pkt",
> 				    featureNS :  "http://www.openplans.org/topp",
> 					srsName: "EPSG:31468",
> 				    maxExtent: bounds,
> 				    geometryName: "geom",
> 				    schema:
> "http://localhost:8080/geoserver/wfs/DescribeFeatureType?request=GetCapabilities&version=1.1.0&typename=topp:pkt"
> 				})
> 				});
> 
> This is my StyleObj:
> 		var *StyleObjekt *= new OpenLayers.StyleMap({
> 		'default' : dStyle,
> 		'select' : sStyle,
> 		'temporary' : tStyle
> 		});
> 
> This is a Style:
> 		var *dStyle *= new OpenLayers.Style({
> 		stroke: true,
> 		strokeColor: "#0000ff",
> 		fill: true,
> 		fillColor: "#0000ff"
> 		});
> 
> *But on the map, the WFS-Objects still have the OpenLayers default color*
> (def: yellow/orange, edit: blue ...).
> 
> 
> 
> 
> --
> View this message in context: http://osgeo-org.1560.n6.nabble.com/Style-WFS-Layer-tp5005123.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120928/ef27956c/attachment.html>


More information about the Users mailing list