Leaflet for Vaadin component provides a JAVA API for Leaflet maps library.
This component is based on leaflet4vaadin.
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:
mvn jetty:run
.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.