Skip to content

Commit 0f5cd1b

Browse files
committed
Added dialog check to demo
1 parent b1f8c7e commit 0f5cd1b

File tree

1 file changed

+19
-3
lines changed
  • vaadin-maps-leaflet-flow-demo/src/main/java/software/xdev/vaadin/maps/leaflet/flow/demo

1 file changed

+19
-3
lines changed

vaadin-maps-leaflet-flow-demo/src/main/java/software/xdev/vaadin/maps/leaflet/flow/demo/LeafletView.java

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55

66
import com.vaadin.flow.component.ClickEvent;
77
import com.vaadin.flow.component.button.Button;
8+
import com.vaadin.flow.component.dialog.Dialog;
9+
import com.vaadin.flow.component.icon.Icon;
10+
import com.vaadin.flow.component.icon.VaadinIcon;
811
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
912
import com.vaadin.flow.router.Route;
1013

@@ -22,9 +25,23 @@
2225
@Route("")
2326
public class LeafletView extends VerticalLayout
2427
{
28+
private boolean viewLunch = false;
2529

30+
/**
31+
* UI-Components
32+
*/
2633
private final Button btnLunch = new Button("Where do XDEV employees go for lunch?");
27-
private boolean viewLunch = false;
34+
private final Button btnOpenDialog = new Button("Open dialog over map", ev ->
35+
{
36+
final Icon icoClose = VaadinIcon.CLOSE.create();
37+
38+
final Dialog dialog = new Dialog(icoClose);
39+
dialog.setWidth("50vw");
40+
dialog.setHeight("50vh");
41+
dialog.open();
42+
43+
icoClose.addClickListener(iev -> dialog.close());
44+
});
2845

2946
private LMap map;
3047

@@ -44,7 +61,7 @@ public LeafletView()
4461
this.initMapComponents();
4562

4663
this.btnLunch.addClickListener(this::btnLunchClick);
47-
this.add(this.btnLunch);
64+
this.add(this.btnLunch, this.btnOpenDialog);
4865
}
4966

5067
private void btnLunchClick(final ClickEvent<Button> event)
@@ -132,7 +149,6 @@ private void initMapComponents()
132149
this.markerLeberkaese = new LMarker(49.673800, 12.160113);
133150
this.markerLeberkaese.setPopup("Fast food like Leberkäsesemmeln");
134151

135-
136152
this.map = new LMap(49.675126, 12.160733, 17);
137153

138154
this.map.setHeight("700px");

0 commit comments

Comments
 (0)