Select to view content in your preferred language

Map popups don't respect MapView.ViewPadding

587
2
Jump to solution
06-21-2023 06:03 PM
JosephGrist
New Contributor

'padding' on a MapView does a great job of making Esri widgets avoid the obstructed area of the UI, and centering the zooming.  However,  popups do not respect the padding and still appear under the obscured area of the UI.

Is this a bug, or expected behaviour?  Wondering if there is a workaround that doesn't involve manipulating the DOM to position sidebars, etc. underneath the Esri popups....

Tags (2)
1 Solution

Accepted Solutions
UndralBatsukh
Esri Regular Contributor

Hi there, 

How are you setting the padding? 

Please set the view.padding wholly: view.padding = { bottom: 400 }, not view.padding.bottom = 400. Doing so works as expected.  This codepen shows how to setting the padding wholly: https://codepen.io/U_B_U/pen/RwqGdmJ?editors=1000

We have an issue improve this down the road. Hope this helps,

View solution in original post

0 Kudos
2 Replies
UndralBatsukh
Esri Regular Contributor

Hi there, 

How are you setting the padding? 

Please set the view.padding wholly: view.padding = { bottom: 400 }, not view.padding.bottom = 400. Doing so works as expected.  This codepen shows how to setting the padding wholly: https://codepen.io/U_B_U/pen/RwqGdmJ?editors=1000

We have an issue improve this down the road. Hope this helps,

0 Kudos
JosephGrist
New Contributor

Hi there.  Thanks, this is very helpful.  In this CodePen, the popup is behaving quite differently (and much better) to how it does in our solution. It looks like we have something in our environment that is interfering.  I will use this CodePen as a starting point for debugging what appears to be a fault run our code.  Thanks!

0 Kudos