Select to view content in your preferred language

Fullscreen World Map with without showing background grids on vertical scroll up or down in Android

1796
12
11-20-2023 08:41 PM
NishanKhadka
Emerging Contributor

Screenshot_20231121-103442.pngScreenshot_20231121-103722.pngScreenshot_20231121-103459.png

I want to achieve something similar to the images 1 and 2, a full screen world map with fixed min zoom/scale level. But with Esri SDK I find the MapView  scrolling beyond the actual map and show the background grid. How can I achieve something like that?
Thanks!

0 Kudos
12 Replies
ChanganShi1
Regular Contributor

You could set minScale and maxScale of the base layer to achieve it. You may also reset the background grid by changing the property backgroundGrid, like:

mapView.backgroundGrid = BackgroundGrid(
color = Color.fromRgba(167,214,255,255),
lineWidth = 0f)

 

0 Kudos
NishanKhadka
Emerging Contributor

Thank you for the suggestion. I can set the min Scale and max scale. But the map still can be scrolled, and it will show the background grid by scrolling beyond the actual map image. If I disable the scroll when min scale is reached, still it can be scrolled beyond the actual map once you zoom-in and start scrolling. 😞

0 Kudos
ChanganShi1
Regular Contributor

Could you try to use the InteractionOptions class to disable the Pan, Zoom, etc gestures you don't like the user to interact with on the map view? 

0 Kudos
ChanganShi1
Regular Contributor

Does the suggestion solve your problem?

0 Kudos
NishanKhadka
Emerging Contributor

Sorry, haven't given time to this issue and I haven't tried to implement the InteractionOptions. I have got few ideas (may be measure the distance from centre and stop panning once the distance is reached), but panning will disable both vertical/horizontal movement and not just the vertical movement, I do need the horizontal panning. Just gonna leave it for now!

0 Kudos
ChanganShi1
Regular Contributor

If you have a strong user story, we may consider adding the feature in future releases.

NishanKhadka
Emerging Contributor

I think having the feature to make it full screen makes the user have a more immersive and focused view of the geographical info in the map. When it's about map in android phones, I only want to display information that are relevant and not let the user get distracted from having half of the map gone out of the view due to an unintentional user action. It just doesn't look when the map is zoomed in. 

0 Kudos
ChanganShi1
Regular Contributor

Hi, NishanKhadka:

My colleague pointed out that the maxExtent property of ArcGISMap may solve your problem, you could set the maxExtent property to prevent users from zooming out further. Give it a try, you can also find the reference sample here.

0 Kudos
NishanKhadka
Emerging Contributor

I did try with maxExtent property before, but I messed up the wrapAround property of the map, and vertical panning started to behave strangely when zoomed (The more you zoom the more you restrict vertical panning the in the map area). Maybe I messed up with the implementation, I will give it a try once again. 👍

0 Kudos