Position "relativeto" question

685
2
Jump to solution
11-16-2016 06:53 PM
TimHayes1
Occasional Contributor III

I have made 2 on-screen widgets that are located on the right side of the map window. When a user resizes their browser window or uses a smaller screen computer, these widgets shift offscreen or move towards the middle of the map window.

How do I make sure they stay where they are at, in the same location no matter how the window is resized or the size of the computer screen?

Here is my code snippet from the config.json:

{
"position": {
"left": 1150,
"bottom": 500,
"relativeTo": "map"
},

I have made 2 on-screen widgets that are located on the right side of the map window. When a user resizes their browser window or uses a smaller screen computer, these widgets shift offscreen or move towards the middle of the map window.

How do I make sure they are always visible in the map window no matter if the browser is resized or the size of the computer screen?

Here is my code snippet from the config.json:

{
"position": {
"left": 1150,
"bottom": 500,
"relativeTo": "map"
},

I have tried "relativeTo": "browser" and got the same results.

The first image is the position of the on-screen widgets in the map window when it is first opened:

When I resize the browser window, the widgets disappear (actually, they are off screen and reappear when I maximize the browser window). I would like them to stay inside the window like the HomeScreen and ZoomInZoomOut Widgets, but on the opposite side of the map window:

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor
Tim,


  If you want them to stay on the right then use right in your CSS instead of left.


View solution in original post

2 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor
Tim,


  If you want them to stay on the right then use right in your CSS instead of left.


TimHayes1
Occasional Contributor III

Thanks again, Robert, for bailing me out of another one. I hope with all the excellent work you have done in supporting the WAB Dev Community that Jack will at least buy you lunch one day! : )

0 Kudos