[GIS] Convert Leaflet WMS layer to Leaflet GeoJSON layer

geojsongetfeatureinfojavascriptleafletwms

Using the Leaflet API I am adding a WMS layer through the L.tilelayer.WMS feature. This feature includes only a certain amount of options such as 'layers','crs','style' etc.

Through the Leaflet documentation I figured that the L.GeoJSON feature includes the 'onEachFeature' option. I would like to use this 'onEachFeature'' option within the WMS layer.

What would be a solution to apply an 'onEachFeature' option within a Leaflet WMS TileLayer?

Best Answer

You should take a look at this plugin : https://github.com/heigeo/leaflet.wms

It allows you to get info on a popup for each 'feature' of a wms layer.