Howdy, I recently made the switch over to components, but I'm having trouble figuring out MapView related actions such as using popup buttons to rotate the MapView.
Since components don't use MapViews, how would I implement this using components? My old AMD code is as follows, where myView is an instance of a MapView. Thanks.
// The action object that defines the action.
let viewRotateAction = {
title: "Rotate",
id: "rotate",
className: "esri-icon-rotate"
};
// Add the action to the pop-up window's actions.
myView.popup.actions.push(viewRotateAction);
// The function defining the operation.
function rotateView() {
let rotateAngle = myView.rotation + 45;
myView.goTo({
rotation: rotateAngle
});
};
// Implement the event for the action.
myView.popup.on("trigger-action", function (event) {
console.log("Returned event: ", event)
if (event.action.id === "rotate") {
rotateView();
}
});