I have a layer that is comprised of a number of different polygons and want to symbolize dynamically using the database. I have achieved this but the issue is in styling the image in the polygon is not fitting it is repeating when I zoom in. I want to fit the image fit in the polygon when I zoom in or out.
-
Here is the SLD that i am using now <Rule> <PolygonSymbolizer> <Fill> <GraphicFill> <Graphic> <ExternalGraphic> <OnlineResource xlink:type="simple" xlink:href="map-logos/${image_url}.png" /> <Format>image/png</Format> </ExternalGraphic> <Size>Auto</Size> </Graphic> </GraphicFill> </Fill> </PolygonSymbolizer> </Rule>– Saad ZahidCommented Dec 29, 2022 at 19:38
-
2Please do not comment on your own Question. Instead, Edit the question and delete the comment– VinceCommented Dec 29, 2022 at 20:43
1 Answer
There is no such thing as complete auto-scaling... what you could do may be to set the image size in ground units, so that when you zoom in, the size of the image also increases. That said, with a PNG the results of upscaling would look pretty bad (pixellated or blurry). A SVG image might give you better results.
Generally speaking, when using image fills, it's a good idea to make sure the images are seamless background images (that is, images that can be replicated on each side and will not show any interruption).