Tafadzwa Moyo
Tafadzwa Moyo

Reputation: 157

CodenameOne Google Map showing half way on the form

Google map showing half way on a form. Not filling in the whole space. On a simulator it works but not on the device.

Map Problem

I have tried using the BoxLayout Y layout and also Border Layout but its not happening

private Container generateInstructionMap() throws IOException {

         Container root =  new Container(new BorderLayout());
         //BorderLayout.center(collected)..encloseY(info, collected); 
         root.add(BorderLayout.CENTER, cnt);
         root.add(BorderLayout.SOUTH, btnAddMarker);


    return root;
}

 public Container generateDashboard(final Form parent) {

        Container dash = new Container(new BoxLayout(BoxLayout.Y_AXIS));

                    Form wizard = new Form();
                    wizard.setLayout(BoxLayout.y());
                    wizard.setTitle("Order Delivery");
                    final Command back = new Command(null) {

                        public void actionPerformed(ActionEvent evt) {

                            //parent.showBack();
                        }
                    };
                    wizard.setBackCommand(back);
                    Tabs wizardtabs = new Tabs();
                   // wizardtabs.setLayout(BoxLayout.y());

                    wizardtabs.addTab("Info", 
                     generateDeliveryStepsWizard(parent));

 wizardtabs.addTab("Info", generateInstructionMap(parent));
   dash.setUIID("Form");
        return dash;

}

Please see the images for how its displaying

Upvotes: 1

Views: 26

Answers (1)

Shai Almog
Shai Almog

Reputation: 52760

You set the form to box layout Y which gives components their preferred height. Since a map doesn't have a "real" preferred height you get that.

If the form had a border layout and you would have placed the container with the map in the center it would have taken the full space of the form. Furthermore a form is scrollable by default, border layout disables scrolling so the behavior would have been closer to what you need as map is panned not scrolled.

Upvotes: 1

Related Questions