How to set "fit" in 4.x?
fit - "When true, for maps that contain tiled map service layers, you are guaranteed to have the input extent shown completely on the map. The default value is false. (As of v1.3)"
Solved! Go to Solution.
Makiko,
In the 4.x api the option is to use view.goTo(extent); There is no fit option, it will just choose the closest LOD. You can use view.extent.contains to check if the views new extent contains the whole extent you are going to after the fact and then set the views.zoom as one greater if it does not.
view.goTo(extent).then(function(evt){
if(!view.extent.contains(yourExtent){
view.zoom -= 1;
}
}).
Makiko,
In the 4.x api the option is to use view.goTo(extent); There is no fit option, it will just choose the closest LOD. You can use view.extent.contains to check if the views new extent contains the whole extent you are going to after the fact and then set the views.zoom as one greater if it does not.
view.goTo(extent).then(function(evt){
if(!view.extent.contains(yourExtent){
view.zoom -= 1;
}
}).
Hi Robert,
Perfect!! Thank you!! I got this but ")" need to be added before ".then".
OK I have updated the code block.