Skip to content

Commit df530b9

Browse files
committed
Add maplibre-gl-leaflet plugin + Rename _ to -
1 parent ed4a1f5 commit df530b9

File tree

12 files changed

+528
-10
lines changed

12 files changed

+528
-10
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
Add the following lines to your pom:
9191
```XML
9292
<dependency>
93-
<groupId>software.xdev.vaadin.maps_leaflet</groupId>
93+
<groupId>software.xdev.vaadin.maps-leaflet</groupId>
9494
<artifactId>flow</artifactId>
9595
<version>${{ steps.version.outputs.release }}</version>
9696
</dependency>

bom/pom.xml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66

7-
<groupId>software.xdev.vaadin.maps_leaflet</groupId>
7+
<groupId>software.xdev.vaadin.maps-leaflet</groupId>
88
<artifactId>bom</artifactId>
99
<version>5.0.0-SNAPSHOT</version>
1010
<packaging>pom</packaging>
1111

12-
<name>bom</name>
12+
<name>LeafletMap for Vaadin - BOM</name>
1313
<description>LeafletMap for Vaadin - BOM</description>
1414
<url>https://github.com/xdev-software/vaadin-maps-leaflet-flow</url>
1515

@@ -49,10 +49,15 @@
4949
<dependencyManagement>
5050
<dependencies>
5151
<dependency>
52-
<groupId>software.xdev.vaadin.maps_leaflet</groupId>
52+
<groupId>software.xdev.vaadin.maps-leaflet</groupId>
5353
<artifactId>flow</artifactId>
5454
<version>5.0.0-SNAPSHOT</version>
5555
</dependency>
56+
<dependency>
57+
<groupId>software.xdev.vaadin.maps-leaflet.plugins</groupId>
58+
<artifactId>maplibre-gl-leaflet</artifactId>
59+
<version>5.0.0-SNAPSHOT</version>
60+
</dependency>
5661
</dependencies>
5762
</dependencyManagement>
5863

@@ -137,4 +142,4 @@
137142
</build>
138143
</profile>
139144
</profiles>
140-
</project>
145+
</project>

flow-demo/pom.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66

77
<parent>
8-
<groupId>software.xdev.vaadin.maps_leaflet</groupId>
8+
<groupId>software.xdev.vaadin.maps-leaflet</groupId>
99
<artifactId>root</artifactId>
1010
<version>5.0.0-SNAPSHOT</version>
1111
</parent>
@@ -94,10 +94,15 @@
9494
</exclusions>
9595
</dependency>
9696
<dependency>
97-
<groupId>software.xdev.vaadin.maps_leaflet</groupId>
97+
<groupId>software.xdev.vaadin.maps-leaflet</groupId>
9898
<artifactId>flow</artifactId>
9999
<version>${project.version}</version>
100100
</dependency>
101+
<dependency>
102+
<groupId>software.xdev.vaadin.maps-leaflet.plugins</groupId>
103+
<artifactId>maplibre-gl-leaflet</artifactId>
104+
<version>${project.version}</version>
105+
</dependency>
101106

102107
<!-- Spring -->
103108
<dependency>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import software.xdev.vaadin.maps.leaflet.flow.demo.FreeingUpResourceBenchmarkDemo;
1919
import software.xdev.vaadin.maps.leaflet.flow.demo.GeoJSONDemo;
2020
import software.xdev.vaadin.maps.leaflet.flow.demo.InitialResizeDemo;
21+
import software.xdev.vaadin.maps.leaflet.flow.demo.MaplibreGLDemo;
2122
import software.xdev.vaadin.maps.leaflet.flow.demo.MinimalisticDemo;
2223
import software.xdev.vaadin.maps.leaflet.flow.demo.MultiLayerWithPyramidDemo;
2324
import software.xdev.vaadin.maps.leaflet.flow.demo.NotOfThisEarthDemo;
@@ -103,6 +104,11 @@ protected void onAttach(final AttachEvent attachEvent)
103104
FreeingUpResourceBenchmarkDemo.NAV,
104105
"Freeing up resources Benchmark",
105106
"Benchmark for showcasing how resources a freed up when handling huge amounts of components"
107+
),
108+
new Example(
109+
MaplibreGLDemo.NAV,
110+
"MapLibre GL Leaflet",
111+
"Showcases how vector tile servers can be used with MapLibre GL Leaflet"
106112
)
107113
));
108114
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
package software.xdev.vaadin.maps.leaflet.flow.demo;
2+
3+
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
4+
import com.vaadin.flow.router.Route;
5+
6+
import software.xdev.vaadin.maps.leaflet.MapContainer;
7+
import software.xdev.vaadin.maps.leaflet.basictypes.LLatLng;
8+
import software.xdev.vaadin.maps.leaflet.layer.ui.LMarker;
9+
import software.xdev.vaadin.maps.leaflet.layer.vector.maplibregl.LMaplibreGL;
10+
import software.xdev.vaadin.maps.leaflet.map.LMap;
11+
import software.xdev.vaadin.maps.leaflet.registry.LComponentManagementRegistry;
12+
import software.xdev.vaadin.maps.leaflet.registry.LDefaultComponentManagementRegistry;
13+
14+
15+
// @NpmPackage(value = "maplibre-gl", version = "5.6.1")
16+
// @NpmPackage(value = "@maplibre/maplibre-gl-leaflet", version = "0.1.3")
17+
// @JsModule("maplibre-gl/dist/maplibre-gl.js")
18+
// @CssImport("maplibre-gl/dist/maplibre-gl.css")
19+
// @JsModule("@maplibre/maplibre-gl-leaflet/leaflet-maplibre-gl.js")
20+
@Route(MaplibreGLDemo.NAV)
21+
@SuppressWarnings("checkstyle:MagicNumber")
22+
public class MaplibreGLDemo extends VerticalLayout
23+
{
24+
public static final String NAV = "/maplibre-gl";
25+
26+
public MaplibreGLDemo()
27+
{
28+
// Let the view use 100% of the site
29+
this.setSizeFull();
30+
31+
// Create the registry which is needed so that components can be reused and their methods invoked
32+
// Note: You normally don't need to invoke any methods of the registry and just hand it over to the components
33+
final LComponentManagementRegistry reg = new LDefaultComponentManagementRegistry(this);
34+
35+
// Create and add the MapContainer (which contains the map) to the UI
36+
final MapContainer mapContainer = new MapContainer(reg);
37+
mapContainer.setSizeFull();
38+
this.add(mapContainer);
39+
40+
final LMap map = mapContainer.getlMap();
41+
42+
// Add a (default) TileLayer so that we can see something on the map
43+
new LMaplibreGL(reg, "https://demotiles.maplibre.org/style.json").addTo(map);
44+
45+
// Set what part of the world should be shown
46+
map.setView(new LLatLng(reg, 49.6751, 12.1607), 5);
47+
48+
// Create a new marker
49+
new LMarker(reg, new LLatLng(reg, 49.6756, 12.1610))
50+
// Bind a popup which is displayed when clicking the marker
51+
.bindPopup("XDEV Software")
52+
// Add it to the map
53+
.addTo(map);
54+
}
55+
}

flow/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66

7-
<groupId>software.xdev.vaadin.maps_leaflet</groupId>
7+
<groupId>software.xdev.vaadin.maps-leaflet</groupId>
88
<artifactId>flow</artifactId>
99
<version>5.0.0-SNAPSHOT</version>
1010
<packaging>jar</packaging>

0 commit comments

Comments
 (0)