Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// react on resize events
window.addEventListener("resize", () => {
map.resize(window.innerWidth, window.innerHeight);
});
return map;
}
const mapView = initializeMapView("mapCanvas");
// snippet:harp_gl_datasource_satellitetile_1.ts
const webTileDataSource = new WebTileDataSource({
appId,
appCode,
tileBaseAddress: WebTileDataSource.TILE_AERIAL_SATELLITE
});
// end:harp_gl_datasource_satellitetile_1.ts
// snippet:harp_gl_datasource_satellitetile_2.ts
mapView.addDataSource(webTileDataSource);
// end:harp_gl_datasource_satellitetile_2.ts
}
function main() {
const mapView = initializeMapView("mapCanvas");
// snippet:harp_gl_datasource_satellitetile_globe_1.ts
const webTileDataSource = new WebTileDataSource({
appId,
appCode,
tileBaseAddress: WebTileDataSource.TILE_AERIAL_SATELLITE
});
// end:harp_gl_datasource_satellitetile_globe_1.ts
mapView.setCameraGeolocationAndZoom(new GeoCoordinates(40.702, -74.01154), 3.6);
// snippet:harp_gl_datasource_satellitetile_globe_2.ts
mapView.addDataSource(webTileDataSource);
// end:harp_gl_datasource_satellitetile_globe_2.ts
}