Closed pragmaeuge closed 1 year ago
According to the OpenLayers API, imgSize
is only applicable when using the img
instead of the src
property of ol/style/Icon
. In our parser, we use src
, since we usually provide a URL to an image.
We also have a closed PR (#549) that was trying to make use of the size
property, which was closed since it did not scale, but rather cut the image.
Unfortunately this approach is not working as i didn't read the API-Docs of OpenLayers carefully enough. The size property does not shrink or grow the selected image but cut a piece out of it...
source: https://github.com/geostyler/geostyler-openlayers-parser/pull/549#issuecomment-1153927001
We are also seeing this issue where basically icon sizes are being scaled up dramatically. So if you set size to 1, the icon is displayed at its normal size (size of the image file) and no scaling, but if you go higher than 1, the size increases in an exponential factor.
I feel like this line should say scale: symbolizer.scale || 1
:
https://github.com/geostyler/geostyler-openlayers-parser/blob/master/src/OlStyleParser.ts#L1125
https://github.com/openlayers/openlayers/pull/14364 is now merged and we are able to adapt the geostyler-openlayers-parser
with the next openlayers release. Until then we could remove the parsing of symbolizer.size
and add it to the unsupportedProperties
.
Any volunteers for a PR? :slightly_smiling_face:
Thix should be fixed with the latest release.
Question
Why Geostyler IconSymbolyzer size is parsed as Ol Icon scale?
Maybe Ol Icon imgSize should be preferred?