1

我想使用 openstreetmap 在 power-bi 上创建自定义可视化地图。因此,我创建了一个新的视觉项目:pbiviz new LeafletCustomVisual

之后我将 osm 安装为 :npm install osm --save 并编辑pbiviz.json

"externalJS": [
"node_modules/osm/index.js"
],

我还检查了https://www.npmjs.com/package/osm页面并尝试visual.ts如下:

import osm from 'osm';
export class Visual implements IVisual {

  private map: osm;
  constructor(options: VisualConstructorOptions) {
      this.target = options.element;
      this.map = osm().position(47.88038, 10.6222475);
      this.target.appendChild(this.map.show());
    }
}

但我只是没有工作。我不熟悉 node.js 和相关的东西

4

0 回答 0