ArcGIS API for JavaScript 4.x的鹰眼我想要鹰眼动,主地图也动,就是可以用鹰眼来控制主地图,这是目前代码,求告知如何写。vue3框架,现在只能主地图控制鹰眼。
addOverViewMap(view,map) {
loadModules(["esri/views/MapView",
"esri/Map", "esri/core/watchUtils", "esri/Graphic",
]).then(([MapView, Map, watchUtils, Graphic]) => {
// eslint-disable-next-line no-unused-vars
const overViewMap = new Map({
basemap: "streets",
});
const overView = new MapView({
container: "overViewDiv",
map: overViewMap,
zoom: 2,
constraints: {
rotationEnabled: false
}
});
overView.ui.components = [];
overView.when(() => {
view.when(() => {
setup();
});
});
function setup() {
const extentGraphic = new Graphic({
geometry: null,
symbol: {
type: "simple-fill",
color: [0, 0, 0, 0.5],
outline: null
}
});
overView.graphics.add(extentGraphic);
watchUtils.init(view, "extent", (extent) => {
extentGraphic.geometry = extent;
});
watchUtils.when(view, "stationary", updateOverView);
}
function updateOverView() {
overView.goTo({
center: view.center,
scale: view.scale * 2 * Math.max(view.width /
overView.width,
view.height / overView.height)
});
}
})
},

我想要鹰眼动,主地图也动,交互。