相关疑难解决方法(0)

导入扩展类的模块

在寻找在Leaflet.js 中旋转标记的方法时,我找到了模块Leaflet-rotatedmarker。我是通过 npm 安装的,但现在我不知道如何实际使用它。

根据自述文件,它只扩展了现有的Marker类。据我了解,我现在应该可以调用Marker.setRotationAngle(),但该函数不存在。Marker从导入leaflet-rotatedmarker也不起作用。

如何正确导入扩展类或如何使用模块中的功能/属性扩展现有的传单类?谢谢。

我说的是import { XYZ } from 'leaflet-rotatedmarker'声明。

编辑:

如果我尝试rotationAngle在构造函数中设置它,它也不起作用:

const marker = L.marker([tmpAgv.Pos.X, tmpAgv.Pos.Y], { alt: tmpAgv.Id }, {rotationAngle: 180}).addTo(this.mapObject);
Run Code Online (Sandbox Code Playgroud)

标记仍未旋转。

leaflet node-modules typescript angular

2
推荐指数
1
解决办法
1313
查看次数

标签 统计

angular ×1

leaflet ×1

node-modules ×1

typescript ×1