i have generate a web map by using qgis2web plugin. The map contain 2 wms layers from my geoserver and one OSM basemap. the popup working nicely when click on the feature. but there is empty popup when click on any other area. Is there any where in the .js to mode so that no empty when click on area other than the wms layer feature.
This is not currently possible with the code generated by qgis2web. The code merely opens an iframe whose source is the getFeatureInfo URL. In other words, the client has no knowledge of whether a feature is present or not.
A solution could be developed to fetch the getFeatureInfo URL and analyse it, only then displaying the content if an appropriate response is received. However, I don't know whether getFeatureInfo responses comply with any standard. If they do, it could be done. If not, it would be extremely difficult, trying to detect possible "no feature" responses from various WMS servers.