[OpenLayers-Users] Use WMS or WFS? In combination with style

Paul Meems bontepaarden at gmail.com
Wed Aug 28 02:44:02 PDT 2013


I have Geoserver layers of points. Most layers have less than 500 features
so using WFS should be possible.

My problem is that I need to select a point and show its attributes, this
is not smoothly working on a mobile device because the points are very
small at hight zoom levels.
I tried solving this using additional rules in my SLD but those new rules
are also shown in my legend graphic, creating a new problem.

Next I tried using WFS. After registering to the zoomend event I can
dynamically resize my points:
function zoomChanged() {
  zoom = map.getZoom();
  if (zoom >= 15){
    wfs.styleMap.styles["default"].defaultStyle.pointRadius = zoom - 10;
  } else {
    // Reset to default values.
    wfs.styleMap.styles["default"].defaultStyle.pointRadius = 4;
  }
  wfs.redraw();
}
This works great, but now my SLD is not used so I have all black points
instead of green, yellow and red ones (depending on an attribute).

What I think I need is a combination of the above.
Display my points using my SLD and resize my points at different zoom
levels.

I will have 10+ layers which all have the same attributes structure and
will be using the same SLD.
I'm looking for a solution that will not require a lot of duplicate code.

Any idea will be much appreciated.

Thanks,

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


More information about the Users mailing list