Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function geoJsonTest(options: GeoJsoTestOptions) {
const ibct = new RenderingTestHelper(options.mochaTest, { module: "mapview" });
const canvas = document.createElement("canvas");
canvas.width = 400;
canvas.height = 300;
mapView = new MapView({
canvas,
theme: options.theme,
preserveDrawingBuffer: true,
pixelRatio: 1
});
const defaultLookAt: LookAtParams = {
latitute: 53.3,
longitude: 14.6,
distance: 200000,
tilt: 0,
const geoJsonDataSource = new OmvDataSource({
decoder: new OmvTileDecoder(),
dataProvider: new GeoJsonDataProvider(
"geojson",
typeof options.geoJson === "string"
? new URL(options.geoJson, window.location.href)
: options.geoJson,
{ tiler: new GeoJsonTiler() }
),
name: "geojson",
styleSetName: "geojson"
});
mapView.addDataSource(geoJsonDataSource);
await waitForEvent(mapView, MapViewEventNames.FrameComplete);
await ibct.assertCanvasMatchesReference(canvas, options.testImageName);
}
async getTile(_tileKey: TileKey, _abortSignal?: AbortSignal): Promise<ArrayBufferLike> {
return loadTestResource(this.moduleName, this.basePath, "arraybuffer");
}
}