Leaflet for Vaadin component provides a JAVA API for Leaflet maps library.
This component is based on leaflet4vaadin.
- map configuration
- interactive layers
- map and layer events
- markers
- tooltip and popup binding
- layer groups
- vector layers
- dark theme
- map controls (zoom, layers, scale)
- map state functions
- tile layers
- GeoJSON support
- support for Leaflet plugins:
- support for Esri Leaflet plugins:
- L.esri.DynamicMapLayer
- L.esri.TiledMapLayer
- L.esri.Vector.vectorBasemapLayer
Add the following dependencies in your pom.xml file:
<dependency>
<groupId>org.vaadin.addons.componentfactory</groupId>
<artifactId>vcf-leaflet</artifactId>
<version>X.Y.Z</version>
</dependency>
<repository>
<id>vaadin-addons</id>
<url>https://maven.vaadin.com/vaadin-addons</url>
</repository>
MapOptions options = new DefaultMapOptions();
options.setCenter(new LatLng(47.070121823, 19.204101562500004));
options.setZoom(7);
LeafletMap leafletMap = new LeafletMap(options );
leafletMap.setBaseUrl("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png");
add(leafletMap);
See more examples on vcf-leaflet-demo.
Starting the test/demo server:
- Run
mvn jetty:run
. - Open http://localhost:8080 in the browser.
This Add-on is distributed under Apache Licence 2.0.
Major pieces of development of this add-on has been sponsored by multiple customers of Vaadin. Read more about Expert on Demand at: Support and Pricing.