Visualizing GML data on a map requires two steps:

  1. Create a FeatureModel by creating a Store for the GML data.

  2. Use a FeatureLayer to visualize the model.

// Create a store with a GML codec to decode the data
const store = new UrlStore({
  target: url,
  codec: new GMLCodec()
});

// Use the store to create a model
const model = new FeatureModel(store);

// Create a layer for the model
const layer = new FeatureLayer(model);

// Add the layer to the map
map.layerTree.addChild(layer);