javascript - EagleView/Pictometry:无法读取 i._walkAnnotations 处未定义的属性“isCollection”
问题描述
我正在与 EagleView 的 Pictometry 地图 API 集成。
为什么在我提出标准addShapes()
请求时会出现此问题。这就是我正在做的事情:
我已经将 PictometryHost 实例化为,并且我有一个这样的 latLong 对this.ipa
数组:squares
{lat: xxx, lng: xxx}
const squarePolygons = squares.map((square) => {
const shape = {
type: this.ipa.SHAPE_TYPE.POLYGON,
coordinates: panel,
strokeColor: 'white',
strokeOpacity: 1.0,
strokeWeight: 1.0,
fillColor: '#000000',
fillOpacity: 1.0,
}
return shape
})
this.ipa.addShapes(panelPolygons)
解决方案
当您在shape
对象上发送无效属性时会发生这种情况。
显然,这不是一个非常有用的错误消息。终于想通了,我想我会把它放在这里以防它帮助别人。基本上,当 Pictometry API 接收到任何无效属性时,就会引发此不透明错误。
在这种情况下,该coordinates
属性是一个对象数组,这是正确的,但每个坐标必须采用格式{x: [], y: []}
而不是直接的 lat/lng 对。
有关更多信息,请参阅此处的addShapes
文档。
此外,Pictometry 无法识别 html 颜色,因此该strokeColor
属性必须是“ #FFFFFF
”而不是“白色”。
推荐阅读
- angular - IONIC 获取 500“内部服务器错误”表单发布 API 调用
- python - Python socketserver卡在接收数据上
- javascript - 如何使用 PWA 在 IOS 设备中显示主屏幕提示
- delphi - Delphi 延迟执行
- pyomo - 从 IPOPT Display Pyomo 获取价值
- c++ - 如何在OpenGL中更改枢轴?
- c++ - OpenH264 DecodeFrameNoDelay 输出格式
- c# - 在 c# 中创建另一个 Api 的 Web Api
- apache-kafka - Apache kafka 生产集群设置问题
- python - 在 Odoo 11 上基于 SQL 查询构建新视图或模型