| Numéro d’ID de bogue |
BUG-000123451 |
| Envoi | July 1, 2019 |
| Dernière modification | June 5, 2024 |
| S’applique à | ArcGIS API for JavaScript |
| Version trouvée | 4.12 |
| Statut | Non-Reproducible
Ce problème n’a pas pu être reproduit au cours des tests réalisés par l’équipe de développement. Ce statut peut être attribué aux problèmes qui sont impossibles à reproduire ou qui ne sont plus d’actualité dans une version de développement du logiciel, alors qu’aucun correctif spécifique n’a été installé pour résoudre le problème. Pour d’autres explications, reportez-vous à la section Informations supplémentaires correspondant au problème.
|
Informations supplémentaires
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");
})
Solution de contournement
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.
Étapes pour reproduire