There are 2 ways to request data from a WMS server: either you use a tiled approach, or you request a single image.

This tutorial describes how to use the single-image approach. See Differences between WMSImageModel and WMSTileSetModel for more information about the different approaches.

Visualizing WMS data on a map requires two steps:

  1. Create a WMSImageModel by connecting to the WMS server.

  2. Use a RasterImageLayer to visualize the model.

WMSImageModel.createFromURL("", [{layer: "rivers"}])
    .then(function(model) {
      //Create a layer for the WMS model
      const layer = new RasterImageLayer(model);
      //Add the layer to the map

Use a WMSImageLayer instead of a RasterImageLayer when you need to support getFeatureInfo requests.