InteractionDialog over a MapContainer (Google Maps API)

42 views
Skip to first unread message

rass...@gmail.com

unread,
Oct 21, 2015, 11:15:46 PM10/21/15
to CodenameOne Discussions
Hi, 

I would to show an InteractionDialog popup over a map.
I am experiencing some difficulties with the Google Map API.

The InteractionDialog popup works fine with OpenStreetMap, both in the simulator & with an Android 4.4 device.
But, when I am using Google Maps with an Android device , the popup seems to appear under the map layer.

Any help is welcomed.

Here is my code :

// Non modal dialog pop up
final InteractionDialog dlg = new InteractionDialog("ネットワークエラー");
dlg.setLayout(new BorderLayout());
TextArea ta = new TextArea("あなたの電話のインターネット接続を確認してください");
ta.setEditable(false);
dlg.addComponent(BorderLayout.CENTER, ta);

Button close = new Button("OK");
close.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
dlg.dispose();
}
});

dlg.addComponent(BorderLayout.SOUTH, close);
dlg.showPopupDialog(ta);

Thanks in advance.

rass...@gmail.com

unread,
Oct 22, 2015, 9:05:41 PM10/22/15
to CodenameOne Discussions, rass...@gmail.com
Problem solved.
I added the InterractionDialog to the MapContainer.

Here is the code :


// Non modal dialog pop up
TextArea ta = new TextArea("あなたの電話のインターネット接続を確認してください");
ta.setEditable(false);
;
final InteractionDialog dia = new InteractionDialog("ネットワークエラー");
dia.setLayout(new BorderLayout());
dia.addComponent(BorderLayout.CENTER, ta);

Button close = new Button("OK");
close.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
dia.dispose();
}
});
//cnt is the MapContainer
dia.addComponent(BorderLayout.SOUTH, close);
cnt.addComponent(BorderLayout.NORTH, dia);

Shai Almog

unread,
Oct 22, 2015, 11:33:04 PM10/22/15
to CodenameOne Discussions, rass...@gmail.com
No. That will only work for you in the simulator and not on the device.
Its impossible to do this with the native maps: https://www.codenameone.com/blog/understanding-peer-native-components-why-codename-one-is-so-portable.html

rass...@gmail.com

unread,
Oct 24, 2015, 8:41:01 AM10/24/15
to CodenameOne Discussions, rass...@gmail.com
Thanks for your reply.
I will try to find an other solution.
Best regards.
Reply all
Reply to author
Forward
0 new messages