Visualizing GML data on a map requires two steps:
-
Create a
FeatureModel
by creating aStore
for the GML data. -
Use a
FeatureLayer
to visualize the model.
//Create a Store with a GeoJson 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);