Page 1 of 2
Using a Map in a Form popover is not acting correctly RDMLX
Posted: Tue Apr 22, 2014 5:58 am
by dhnaigles
I want to display a map in a popover. I want the popover to have a height of 60% and I want the map to take the entire space of the popover. I have code that looks like this:
#COM_OWNER.Set_Form Name('/Form.Popover') Grid_Row_N(1) Grid_Row_Height(60%) Show_Popover(True)
#COM_OWNER.Set_Form Name('/Form.Popover') Grid_Col_N(1) Grid_Col_Width(100%)
#COM_OWNER.Set_Map Name('/Form.Popover.fields.map') Layout_Col(1) Layout_Row(1)
The popover does take up 60% of the height of the form, but the Map only takes up 60% of the height of the popover
I believe this is a bug, but I may be wrong. Please prove me wrong.
Re: Using a Map in a Form popover is not acting correctly RD
Posted: Tue Apr 22, 2014 10:25 am
by Paul
There are a couple of things to this.
Firstly, the first line in the supplied code is setting grid row 1 of the popover form to a height of 60%. The map occupies grid row 1 of the popover form and so only takes up 60% of the popover.
This line of code is not necessary if the map is to take up 100% of the popover height.
Secondly, the popover is determining its own size based on content. You don't seem to be having a problem with the Popover size but if you wanted to control this you would have to set the popover form's layout height and width properties.
With popover size and position, it's important to remember that the OS will have the last say and will fit the popover where it can if it is pushed for space.
Re: Using a Map in a Form popover is not acting correctly RD
Posted: Tue Apr 22, 2014 11:27 am
by stevec
The goal is to make the popover 60% of the screen size. This accomplished that but the map only takes up 60% of the popover and I want it to be 100% of the popover (60%). I've tried many combinations and cannot find a solution.
Any Ideas?
Re: Using a Map in a Form popover is not acting correctly RD
Posted: Tue Apr 22, 2014 2:36 pm
by Paul
The example code David provided is not setting the size of the popover. It's setting the height of the grid row of the popover that the map is on.
That's why the map is only taking up 60% of the popover. The popover is determining it's own size based on content.
Try setting the Grid_Row_Height in the first line of the code to 'Fit'.
Re: Using a Map in a Form popover is not acting correctly RD
Posted: Wed Apr 23, 2014 3:51 am
by dhnaigles
Paul, as I am stuggling to understand the exact code to perform what I want to do, could you please just provide a sample that will solve this situation. Thanks.
Re: Using a Map in a Form popover is not acting correctly RD
Posted: Wed Apr 23, 2014 9:30 am
by Paul
Yes, I will try this out when I get a chance and post a sample.
Re: Using a Map in a Form popover is not acting correctly RD
Posted: Wed Apr 23, 2014 11:41 am
by Paul
Set the main form to show a popover
Code: Select all
#COM_OWNER.Set_Form Show_Popover(True)
Set up a form popover
Code: Select all
#COM_OWNER.Set_Form Name('/Form.Popover') Grid_Col_N(1) Grid_Col_Width(100%)
Add a map to the popover
Code: Select all
#COM_OWNER.Set_Map Name('/Form.Popover.fields.map') Layout_Col(1) Layout_Row(1) Layout_Height(400)
This produces a popover roughly 60% of my iPad screen by controlling the size of the map and letting the popover determine its own size. The Layout_Height and Layout_Width parameters of the set_Map method can be adjusted as desired. Note that percentage values are not valid for Layout_Height and Layout_Width parameters.
Re: Using a Map in a Form popover is not acting correctly RD
Posted: Wed Apr 23, 2014 1:46 pm
by stevec
Thanks Paul that worked good on my phone, will test ipad and galaxy tomorrow at work.
Re: Using a Map in a Form popover is not acting correctly RD
Posted: Wed Apr 23, 2014 11:03 pm
by stevec
Well it is no where near the 60% size I want on my Ipad, more like 40%. That is what I expected with your hard coded pixel size. But it looked right on iphone.
How can I set the pop over map to 60% of my screen, help!
Re: Using a Map in a Form popover is not acting correctly RD
Posted: Thu Apr 24, 2014 12:58 am
by dhnaigles
Use this:
Code: Select all
If Cond(#COM_OWNER.ScreenOrientation = 'PORTRAIT')
#std_num := #com_owner.DevicePixelHeight * .60
Else
#std_num := #com_owner.DevicePixelWidth * .60
Endif
#COM_OWNER.Set_Form Show_Popover(True)
#COM_OWNER.Set_Form Name('/Form.Popover') Grid_Col_N(1) Grid_Col_Width(100%)
#COM_OWNER.Set_Map Name('/Form.Popover.fields.map') Layout_Col(1) Layout_Row(1) Layout_Height(#std_num)