Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function addGeoJsonDataSource(baseUrl: string, spaceId: string, token: string) {
// snippet:xyz_1.ts
const xyzDataProvider = new XYZDataProvider({ baseUrl, spaceId, token });
const geoJsonDataSource = new GeoJsonDataSource({
dataProvider: xyzDataProvider,
name: "geojson"
});
mapView.addDataSource(geoJsonDataSource).then(() => {
updateGeoJsonTheme(defaultTheme);
});
// end:xyz_1.ts
}