planetfederal/gxp

Global OL defaultSymbolizer assignment in WMSStylesDialog creates conflict with OLEditor

Closed this issue · 1 comments

At line 1208: in WMSStylesDialog.js the object OpenLayers.Renderer.defaultSymbolizer is populated with settings that causes the OLEditor https://github.com/geops/ole to fail showing labels and makes Point objects square. This in apps that combine both GXP and the OLEditor.

I fixed this locally by renaming the object, like:

 // set SLD defaults for symbolizer
OpenLayers.Renderer.defaultSymbolizerGXP = {
fillColor: "#808080",
fillOpacity: 1,
strokeColor: "#000000",
strokeOpacity: 1,
strokeWidth: 1,
strokeDashstyle: "solid",
pointRadius: 3,
graphicName: "square",
fontColor: "#000000",
fontSize: 10,
haloColor: "#FFFFFF",
haloOpacity: 1,
haloRadius: 1,
labelAlign: 'cm'
};

And assigning OpenLayers.Renderer.defaultSymbolizerGXP wherever OpenLayers.Renderer.defaultSymbolizer was used. This affects the files

    src/script/widgets/FillSymbolizer.js
    src/script/widgets/StrokeSymbolizer.js
    src/script/widgets/TextSymbolizer.js
    src/script/widgets/WMSStylesDialog.js

I can issue a pull for this.

There is a reason for OpenLayers.Renderer.defaultSymbolizer being set to SLD defaults in WMSStylesDialog: GeoServer (which implements the same SLD defaults) and gxp need to agree on defaults, otherwise we cannot properly round-trip SLD. So if this causes problems in OLEditor, it should be fixed there.