Working with layers
Creating GeoJSON layers
From a URL
const layerResult = await felt.createLayersFromGeoJson({
source: {
type: "geoJsonUrl",
url: "https://example.com/data/neighborhoods.geojson",
// Optional: Auto-refresh every 30 seconds
refreshInterval: 30000
},
name: "Neighborhoods",
caption: "Neighborhood boundaries for the city", // Optional
description: "This layer shows the official neighborhood boundaries" // Optional
});
if (layerResult) {
console.log("Created layer group:", layerResult.layerGroup);
console.log("Created layers:", layerResult.layers);
}From a local file
From GeoJSON data
Styling by geometry type
Deleting layers
Refreshing GeoJSON layers
Last updated
Was this helpful?