I am trying to wrap my head around how I can use the goToOverride with Bookmarks to slow down the change of view with the duration option. I can get the scale work which is part of the target set of options.
It looks like any time goTo is used, a target is required and the options are optional which is my hang up. How do I specify in the goToOverride to use the selected book mark as the target.
Code below does not work with line 8 being the issue. I have tried a few different options here. How do I reference the selected bookmark?
Thanks!
const bookmarks = new Bookmarks({
view: view,
// goToOvverideTesting not working
goToOverride: function (view, options){
console.log(options);
// options.easing= "ease-in";
options.duration= 2000;
return view.goTo(bookmarks.viewpoint, options);
},
// goToOverrideTesting
bookmarks:[
new Bookmark({
name: "Carp",
viewpoint: {
targetGeometry: {
type: "extent",
spatialReference: {
wkid: 102100
},
xmin: -8467000,
ymin: 5674000,
xmax: -8461000,
ymax: 5677700
}
}
}),
new Bookmark({
name: "Kemptville",
viewpoint: {
targetGeometry: {
type: "extent",
spatialReference: {
wkid: 102100
},
xmin: -8438000,
ymin: 5608300,
xmax: -8405300,
ymax: 5635200
}
}
}),
]
});
Solved! Go to Solution.
Try something like this for the goToOverride:
goToOverride: (view, goToParams) => {
const options = {
duration: 2000
};
return view.goTo(goToParams.target, options);
},
The original target will be stored in that 2nd parameter of the goToOverride function.
Try something like this for the goToOverride:
goToOverride: (view, goToParams) => {
const options = {
duration: 2000
};
return view.goTo(goToParams.target, options);
},
The original target will be stored in that 2nd parameter of the goToOverride function.
Thanks Anne, this worked!