Я новичок в ArcGIS API для Javscript 4.0 API. Использование образца кальцита на веб-сайте API. Где я могу добавить в Layer объекта к виду карты и сцене? По существу, я пытаюсь объединить образец слоя Feature здесь: https://developers.arcgis.com/javascript/latest/sample-code/layers-featurelayer/index.htmlArcgis API для Javascript 4 Кальцитная карта добавить функциональный слой
/********************
* Add feature layer
********************/
// Carbon storage of trees in Warren Wilson College.
var featureLayer = new FeatureLayer({
url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0"
});
map.add(featureLayer);
с кальцитом карты образцом здесь: https://developers.arcgis.com/javascript/latest/sample-code/frameworks-bootstrap/index.html
, но я не уверен, что часть, чтобы добавить слои. Я пробовал несколько раз. Смотри ниже. Thanks
/******************************************************************
*
* Create the map and scene view and ui components
*
******************************************************************/
// Map
var map = new Map({
basemap: app.basemap
});
app.mapView = new MapView({
container: "mapViewDiv",
map: map,
center: app.center,
scale: app.scale,
padding: app.viewPadding,
popup: new Popup({
dockOptions: app.dockOptions
}),
ui: {
components: app.uiComponents
}
});
// Scene
var mapScene = new Map({
basemap: app.basemap,
ground: "world-elevation"
});
app.sceneView = new SceneView({
container: "sceneViewDiv",
map: mapScene,
center: app.center,
scale: app.scale,
padding: app.viewPadding,
popup: new Popup({
dockOptions: app.dockOptions
}),
ui: {
components: app.uiComponents
}
});
// Set the active view to scene
app.activeView = app.mapView;
// Create the search widget and add it to the navbar instead of view
app.searchWidget = new Search({
view: app.activeView
}, "searchWidgetDiv");
app.searchWidget.startup();
// IS THIS WHERE I CAN ADD LAYERS??????????????????
var featureLayer = new FeatureLayer({
url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0"
});
app.mapView.map.add(featureLayer);
app.sceneView.map.add(featureLayer);
Если с этим сообщением что-то не так, сообщите, что это такое или дайте правильный ответ, чтобы это можно было обновить в интересах сообщества –