1

How can I set up a form in HTML to query the attributes in my GeoServer WFS layer? I assume it has something to do with the action attribute but I'm not sure how it will work. Something like <form action="http://localhost:8080/geoserver/wfs *form created GET request here*" method="get">

Here is a screenshot of the map and form to give you a better idea of what I am trying to accomplish.

enter image description here

1
  • 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
    Commented Jun 18, 2022 at 7:27

1 Answer 1

0

I think the best way is to send the form is through JavaScript, something like below,

$("#formElement").on("click", function () {
var wfsLayer = L.Geoserver.wfs("http://localhost:8080/geoserver/wfs", {
  layers: "topp:tasmania_roads",
});
wfsLayer.addTo(map);
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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