You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When converting from openlayer style to geoserver style, the rectangle shape fails to parse correctly for ol.style.RegularShape. The reason for this is because the scale doesn't get parsed correctly. For rectangle shapes the scale have an array of two numbers and for shapes that are not of rectangle have a scale with one number stored.
A clear and concise description of what the bug is.
Run the following code
var OlStyleParser = new GeoStylerOpenlayersParser.OlStyleParser(ol);
const rectangleStyle = new ol.style.Style({
image: new ol.style.RegularShape({
fill: new ol.style.Fill({ color: 'rgba(0,0,0,1)', width: 1}),
stroke: new ol.style.Stroke({ color: 'rgba(0,0,0,1)', width: 1}),
radius: 10 / Math.SQRT2,
radius2: 10,
points: 4,
angle: 0,
scale: [1, 0.5], // <------- note
rotation: null
})
});
// To geoserver style
const olStyleOriginal = await OlStyleParser.readStyle(rectangleStyle );
const geoserverStyle = olStyleOriginal .output;
// back to ol style
var olStyleParser = await OlStyleParser.writeStyle(geoserverStyle );
const olStyleNew = olStyleParser.output;
Note the the following:
rectangleStyle:
images -> scale_ = [1, 0.5]
olStyleNew
images -> scale_ = 1
Expected behavior
It is expected that the rectangle shape can be parsed correctly from openlayer style to geoserver style.
Screenshots
If applicable, add screenshots to help explain your problem.
Screenshot showing original rectangleStyle
Screenshot showing ol style to geoserver style
screenshot showing geoserver style converted back to ol style
Desktop (please complete the following information):
OS: Windows 10
Browser: Chrome
Version: Version 96.0.4664.45 (Official Build) (64-bit)
The text was updated successfully, but these errors were encountered:
Bug
Describe the bug
When converting from openlayer style to geoserver style, the rectangle shape fails to parse correctly for ol.style.RegularShape. The reason for this is because the scale doesn't get parsed correctly. For rectangle shapes the scale have an array of two numbers and for shapes that are not of rectangle have a scale with one number stored.
A clear and concise description of what the bug is.
rectangleStyle:
images -> scale_ = [1, 0.5]
olStyleNew
images -> scale_ = 1
Expected behavior
It is expected that the rectangle shape can be parsed correctly from openlayer style to geoserver style.
Screenshots
If applicable, add screenshots to help explain your problem.
Screenshot showing original rectangleStyle
Screenshot showing ol style to geoserver style
screenshot showing geoserver style converted back to ol style
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: