ThinkGeo.com    |     Blog    |     Wiki    |     Support

How to use embedded WFS styles on the map

I am attempting to add a WFS layer to a custom map. As far as I understand it, WFS changes must be made on the server side. In the example code I have found for adding a WFS layer, ZoomLevel01.DefaultAreaStyle (just an example style type) is set explicitly. How am I to interpret what type of “style” I am to use? From what I see, there is nothing explicit in the URL to dictate what style is used by each individual layer?

Hi Thomas,

It looks our API don’t support embedded style, you still need to set the default style just like the other layer.

If you want to support that, you should want to write custom function to parse server side style and convert it to our style, then assign to the layer.

Regards,

Ethan

Hey Ethan,

I agree that I need something that parses the information provided by the URL and converts it to your style, however I am not sure which information provided by a given URL would lead me to the correct style. Take this URL for instance:
https://demo.boundlessgeo.com/geoserver/wfs?service=wfs&request=GetCapabilities and look at the FeatureType with the Name “medford:bikelanes”. From what is provided here, how can I tell which ThinkGeo style would be appropriate? If it is not in this FeatureType, where else in the information provided could I find which style to assign?

Hi Thomas,

The uri is only a description about the WFS service.

For WFS it have some operations for example:

GetCapabilities
DescribeFeatureType
GetFeature
Transaction

I tried to build a DescribeFeatureType link for the sample type “medford:bikelanes” like this:

https://demo.boundlessgeo.com/geoserver/wfs?service=wfs&version=1.0.0&request=DescribeFeatureType&typeName=medford:bikelanes

It looks contains more detail information about the element for this type.

And I think the GetFeature function is what you need, but the parameter is more complex than the DescribeFeatureType, so I hadn’t build a sample link for you.

You can get more detail information here: http://www.opengeospatial.org/standards/wfs

Wish that’s helpful.

Regards,

Ethan