MapboxGL的高效率点图层GraphicLayer部分方法报错
meatjam opened this issue · 1 comments
meatjam commented
Request a feature or report a bug? [这是一个需求还是一个缺陷]
这是一个缺陷
One-line summary [问题简述]
以官方示例:高效率点图层-纽约出租车145万上车点 为例,
创建graphicLayer对象后,将其添加到map中(map.addLayer(graphicLayer);)。随后调用graphicLayer的addGraphics或setGraphics方法会报错,导致程序无法继续执行。
Version [产品及版本]
- iClient product (for leaflet,for openlayers,for mapboxgl,classic)[iClient 产品]:iClient for mapboxgl
- iClient version [iClient 版本]:iClient 10i
- Browser version [浏览器类型和版本]:Google Chrome 78.0.3904.108
- OS Version [操作系统类型和版本]:win10
Actual Behavior [当前现象]
调用addGraphics或setGraphics时报错 Uncaught TypeError: Cannot read property 'changeFlags' of null
Expected Behavior [期望现象]
正常运行
Example of reproducing the issue [重现现象的例子]
graphicLayer = new mapboxgl.supermap.GraphicLayer("graphic", {
graphics: [new mapboxgl.supermap.Graphic(
{ lng: -73.91426, lat: 40.7594 }),new mapboxgl.supermap.Graphic(
{ lng: -73.92426, lat: 40.7694 })],
radius: graphicStyle.radius,
color: graphicStyle.color,
highlightColor: [255, 0, 0, 255]
});
map.addLayer(graphicLayer);
console.log('before!')
graphicLayer.addGraphics([new mapboxgl.supermap.Graphic(
{ lng: -73.93426, lat: 40.7794 }),new mapboxgl.supermap.Graphic(
{ lng: -73.94426, lat: 40.7994 })])
console.log('after!')
输出:
before!
deck.gl.min.js:12 Uncaught TypeError: Cannot read property 'changeFlags' of null
songyumeng commented
谢谢您报的缺陷。
这个问题已经被 3dc0431 提交修复。
下个版本发布,或者使用 dist 下的临时版本。