I could not use the way it shows here to add multiple components to different positions, only the first component gets added. Am I missing something? I am using API 4.11.
https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add
mapView.ui.add(
{
component: home,
position: "bottom-right",
index: 0
}, {
component: zoom,
position: "bottom-right",
index: 1
}, {
component: searchWidget,
position: "top-right"
}, {
component: scaleBar,
position: "bottom-left"
});
Solved! Go to Solution.
Your forgot the square brackets. The object has to be in an array.
mapView.ui.add([{
component: home,
position: "bottom-right",
index: 0
}, {
component: zoom,
position: "bottom-right",
index: 1
}, {
component: searchWidget,
position: "top-right"
}, {
component: scaleBar,
position: "bottom-left"
}]);
Your forgot the square brackets. The object has to be in an array.
mapView.ui.add([{
component: home,
position: "bottom-right",
index: 0
}, {
component: zoom,
position: "bottom-right",
index: 1
}, {
component: searchWidget,
position: "top-right"
}, {
component: scaleBar,
position: "bottom-left"
}]);
OMG.. how did I miss that! Thanks, Robert!