Please have a look at this site: https://kso.etjanster.lantmateriet.se/?lang=en# and click the binoculars in the left sidebar and search for e.g. "ESKILSTUNA KARLKULLA 1:2" you will see a multipolygon, one property with two sites, getting highlighted. I thought this was only possible to do with a WFS, but is it also possible to do with a WMS (it looks like they use WMS...?) - and if so, how is it done?

Or do you have any ideas how they have done it? Combining both WFS and WMS on top of each other?

I'm using GeoServer to cascade this remote WMS boundary layer and then display it on a Leaflet map.

  • 2
    Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. Please check out our short tour for more about how the site works. – Ian Turton Mar 19 at 8:27
  • If you examine network traffic you'll se that those polygons have nothing to do with WMS service. Application retrieves them as JSON objects, which are then rendered client side by OpenLayers. – TomazicM Mar 19 at 8:57
  • 1
    It is possible to use GetFeatureInfo for highligh by using some vector format as info_format if the WMS server supports any. See gis.stackexchange.com/questions/139832/… and docs.geoserver.org/latest/en/user/services/wms/reference.html. – user30184 Mar 19 at 9:53

You can restyle a WMS image using an external/public SLD reference (using the SLD parameter) , or URL-encoded SLD (using the SLD_BODY parameter), IF the underlying data is a vector format (we'll assume that here for your 'polygon' data) and if the service provider supports external SLD operations. In that way you can get the effect of highlighting a polygon in a WMS output.

|improve this answer|||||

In this particular case, it turned out to be a raster and not possible to style with external SLD. How they actually do to highlight the properties is that they first request the property id from an API using the property name entered in the search box, then they use this id to call another API and fetch the geojson of that property. Then they style that geojson and add it to the map.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.