enviroment
. /> Hightcharts 12.3.0 < /li>
Highcharts -Angular 5.1.0 < /li>
< /ol>
setup < /strong> < /p>
Похоже, что два способа установить tiledwebmap TiledWebmaps:
1)
Первый описан как ручной режим в компоненте, например:
Strong> map-test.ts> br/>>
Код: Выделить всё
import HC_map from 'highcharts/modules/map';
import TiledWebMap from 'highcharts/modules/tiledwebmap';
HC_map(Highcharts);
TiledWebMap(Highcharts);
< /code>
Если я попытаюсь загрузить tiledwebmap таким образом, я получаю ошибку: < /p>
✘ [ERROR] TS2349: This expression is not callable.
Type 'typeof import("/home/frontend/node_modules/highcharts/highcharts")' has no call signatures. [plugin angular-compiler]
src/app/components/map-test/map-test.ts:7:0:
7 │ TiledWebMap(Highcharts);
Второй метод, который использует остальная часть моего проекта, - это предоставление вспомогательного.
Код: Выделить всё
import { ApplicationConfig, provideBrowserGlobalErrorListeners, provideZoneChangeDetection, importProvidersFrom } from '@angular/core';
import { provideRouter } from '@angular/router';
import {provideHighcharts, providePartialHighcharts} from 'highcharts-angular'
import { provideHttpClient } from '@angular/common/http';
import { routes } from './app.routes';
export const appConfig: ApplicationConfig = {
providers: [
provideBrowserGlobalErrorListeners(),
provideZoneChangeDetection({ eventCoalescing: true }),
provideRouter(routes),
provideHighcharts(),
provideHttpClient(),
providePartialHighcharts({ modules: () => [
import('highcharts/esm/modules/map'),
import('highcharts/esm/modules/tiledwebmap')
],}),
]
};
Когда я добавляю несколько команд в журнал консоли доступных зарегистрированных типов в моем компоненте с этим:
Код: Выделить всё
ngOnInit(): void {
const availableSeries = Object.keys((Highcharts as any).seriesTypes || {});
console.log('Available Highcharts series types:', availableSeries);
[
"line",
"area",
"spline",
"areaspline",
"column",
"bar",
"scatter",
"pie",
"map",
"mapline",
"Mappoint",
"Bubble",
"mapbubble",
"Heatmap"
] < /p>
Обратите внимание на TiledWebMap. /> Что я делаю неправильно в обоих подходах - бонусные баллы, если вы можете показать StackBlitz с методом 2 и OpenStreetMaps.>
Подробнее здесь: https://stackoverflow.com/questions/797 ... -providers
Мобильная версия