Visualizing GML data on a map requires two steps:
-
Create a
FeatureModelby creating aStorefor the GML data. -
Use a
FeatureLayerto 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);