| 漏洞 ID 编号 |
BUG-000123451 |
| 已提交 | July 1, 2019 |
| 上次修改时间 | June 5, 2024 |
| 适用范围 | ArcGIS API for JavaScript |
| 找到的版本 | 4.12 |
| 状态 | Non-Reproducible
在开发团队测试过程中,此问题不可重现。 为问题分配此状态的可能原因包括:问题无法重现,或不再与软件的开发版本相关,但未安装特定修复程序来解决该问题。 问题的“其他信息”部分可能包含进一步说明。
|
附加信息
GraphicsLayer is added before the view is ready. Update the code to the following and it works correctly:
var layer = new GraphicsLayer();
const map = new WebMap({ portalItem: { id: '3acfce904368451f82b60d5c8a120f82' }});
const view = new MapView({
container: "viewDiv",
map: map,
zoom: 5,
center: [-74, 45]
});
view.when(function(evt) {
map.add(layer);
var sketch = new Sketch({
layer: layer,
view: view
});
view.ui.add(sketch, "top-right");
})
解决办法
Repeat the above steps with this jsbin: https://jsbin.com/tatatedece/edit?html,output
The workaround is to add the image service directly to the map versus adding in the web map and consuming it via ArcGIS API for JavaScript.
重现步骤