Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
For the geoJSON data, we can get the map to extend directly using getBounds function on the map object. The getBounds is not available for the WMS standard. So we can not get the map bounds and can not zoom the required WMS layer to the map dynamically. But Unfortunately, we can get the required bounding box information through getCapabilities request. I am using axios for the HTTP client as below,
The response from the above request will provide you the XML as the response data. Since the data output is in XML, first of all, you need to JSON and you can filter the bbox for the required layer. The easiest way to convert it is by using wms-capabilities. First of all, you need to include this library in your code.