Мы используем harp.gl в приложении ng angular, но у нас проблемы с подключением к источникам данных так же, как в нашей демонстрации yarn.
Мы создаем источник данных как:
const dataSource = new OmvDataSource({
baseUrl: "https://vector.hereapi.com/v2/vectortiles/base/mc",
apiFormat: APIFormat.XYZOMV,
styleSetName: "tilezen",
authenticationCode: apikey,
authenticationMethod: {
method: AuthenticationMethod.QueryString,
name: "apikey"
}
});
и создайте MapView как:
const mapView = new MapView({
canvas: mapCanvas,
theme: "assets/resources/berlin_tilezen_base.json",
// note, this URL may vary depending on configuration of webpack
// for this example, it is assumed that app is server from project root
decoderUrl: "harp-gl-decoders.bundle.js"
// note, this URL may vary depending on configuration of webpack
// for this example, it is assumed that webpack emits bundles to project root
});
и добавьте источник данных таким образом:
mapView.addDataSource(dataSource);
и увидите это в консоли:
[WDS] App updated. Reloading...
Angular is running in the development mode. Call enableProdMode() to enable the production mode.
MapView: Failed to connect to datasource anonymous-datasource#1: Error during worker initialization
[WDS] Live Reloading enabled.
и это в консоли отладки веб-страницы:
:4200/decoder.bundle.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
ConsoleChannel.js:15 MapView: Failed to connect to datasource anonymous-datasource#1: Error during worker initialization
Я потратил много часов на str aws и приму любую помощь.