planetfederal / gxp

High level components for GeoExt based applications.
http://boundlessgeo.com/
Other
84 stars 97 forks source link

Vector Layer Styling #216

Open justb4 opened 10 years ago

justb4 commented 10 years ago

In addition to the GeoServer-REST-based WMS SLD Styling several users of Heron have asked for Vector Layer Styling. A Vector Layer may be a WFS Layer or from local origin like from Drawing (via OLEditor) or upload (Heron upload Vector file). By allowing local Vector Layer Styling not only colors for lines and fills may be set but using the OL Style system, even thematic maps may be created using Filter dialogues/expressions. The entire map may then be printed using MapFish Print. At this point no storage of Styles is required. So this makes it a client-only facility.

For the implementation I am building on the GXP Styling classes, as they are the most advanced. I started a crude implementation by overriding the WMSStylesDIalog widget and plugging in a VectorStyleWriter for persistence into the local Vector OL Layer. The sources are for now maintained in my GXP fork: https://github.com/justb4/gxp/ This is not the most optimal design, as a lot of behaviour-cancellation is performed in WMSStylesDIalog-overriding. A common StylesDialog baseclass would be more appropriate. Also many of the dialogues, especially for Labeling are unused/have no effect. I have a running example at: http://lib.heron-mc.org/heron/latest/examples/vectorstyler. Activate Vector styler via right-mouse context menu on Vector Layers in any Layer treepanel. There's quite some issues/bugs still, for one thing I had trouble using the OL Style(2) system, Symbolizers etc, especially for mixed geometry Layers and with feature rendering (may have to use GeoExt Feature Renderer).

So I realize this is not yet fit for a PR and I am waiting for new budget from users to continue development. But maybe others are interested so we may work jointly. Via this issue I am making this work public.

justb4 commented 10 years ago

There is a Heron example for GXP Vector Layer Styling: http://lib.heron-mc.org/heron/latest/examples/vectorstyler using various Vector Layers: local files, like GPX or GeoJSON files, WFS Layers and Drawing Layer (click drawing icon first). Click Help button for help. Always invoke Vector Styling via context menu of any Vector Layer.