Hello,
I am creating an application that shows the contiguous United States. I have set the view extent to load properly when opening the application on desktop. However, when opening on a mobile device or smaller screen, the map does not open at the same extent. It is more zoomed in than it should be. Any ideas on how to resolve this?
Thanks!
Solved! Go to Solution.
Version 3.x of the api has an option on the map's setExtent method to ensure the map shows the complete extent of what you've set. Unfortunately, version 4 doesn't have that option when setting the view's extent. You'll have to code that check yourself
view.when(() => {
if(!view.extent.contains(yourExtent){
view.zoom -= 1;
}
});
Version 3.x of the api has an option on the map's setExtent method to ensure the map shows the complete extent of what you've set. Unfortunately, version 4 doesn't have that option when setting the view's extent. You'll have to code that check yourself
view.when(() => {
if(!view.extent.contains(yourExtent){
view.zoom -= 1;
}
});
This worked, thanks so much!