As we have seen in the previous examples, using OpenLayers, you can create maps by mixing data from different servers. Although WMS is an excellent way to get a representation of data, sometimes, you may want to retrieve data in a raw form and process them on the client side. OpenLayers lets you create WFS requests to retrieve vector data. In this example, we will mix WMS and WFS requests.
- Open your text editor and insert the following piece of code in a new file. We will use the same properties of the previous examples. Call it WMSandWFS.html and save it in the Tomcat folder to publish it:
<!DOCTYPE html> <html> <head> <title>WFS - GetFeature</title> <link rel="stylesheet" href="https://openlayers.org/ en/v4.2.0/css/ol.css" ...