Vue2的highmaps(highcharts)中如何连接“OpenStreetMap”模块“modules/tiledwebmap.js”?

问题描述 投票:0回答:1

如何在Vue的highmaps(highcharts)中导入并连接“OpenStreetMap”的模块“https://code.highcharts.com/maps/modules/tiledwebmap.js”? 如果您能发送一个示例演示,那就太好了。

highcharts
1个回答
0
投票

设置与 Vanilla JS 设置几乎相同,唯一的区别是您需要在应用程序中导入并初始化 TiledWebMap 模块。

import Highcharts from "highcharts";
import MapsModule from "highcharts/modules/map";
import TiledWebMap from "highcharts/modules/tiledwebmap";
import HighchartsVue from "highcharts-vue";

MapsModule(Highcharts);
TiledWebMap(Highcharts);

演示: https://codesandbox.io/p/sandbox/nostalgic-https-j59mgn?file=%2Fsrc%2Fmain.js%3A4%2C1-13%2C25

参考资料:
https://www.highcharts.com/docs/maps/tiledwebmap
https://github.com/highcharts/highcharts-vue?tab=readme-ov-file#importing-highcharts-modules

© www.soinside.com 2019 - 2024. All rights reserved.