Skip to content

Commit eaa40b1

Browse files
committed
Reworked z-index
1 parent bb7995c commit eaa40b1

File tree

2 files changed

+13
-6
lines changed
  • vaadin-maps-leaflet-flow/src/main

2 files changed

+13
-6
lines changed

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public LMap(final double lat, final double lon, final int zoom)
6868
super();
6969
this.center = new LCenter(lat, lon, zoom);
7070
this.setViewPoint(this.center);
71-
this.addClassName("leaflet-map");
71+
this.setFixZIndexEnabled(true);
7272
}
7373

7474
public LMap()
@@ -90,7 +90,18 @@ public void setTileLayer(final LTileLayer tl)
9090
{
9191
this.getElement().callJsFunction(TILE_LAYER_FUNCTION, tl.toJson());
9292
}
93-
93+
94+
/**
95+
* This fixes situations where the leafletmap overlays components like Dialogs
96+
*
97+
* @param enabled
98+
* enable or disable the fix
99+
*/
100+
protected void setFixZIndexEnabled(final boolean enabled)
101+
{
102+
this.getStyle().set("z-index", enabled ? "1" : null);
103+
}
104+
94105
/**
95106
* add a Leaflet Component to the map.
96107
*

vaadin-maps-leaflet-flow/src/main/resources/META-INF/resources/frontend/styles/LeafletMap.css

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)