vaadin-component-factory / vcf-leaflet

vcf-leaflet provides a Java API for Leaflet.
Other
0 stars 1 forks source link

Leaflet for Vaadin

Leaflet for Vaadin component provides a JAVA API for Leaflet maps library.

This component is based on leaflet4vaadin.

Features

Using the component in a Flow application with maven

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>

Example usage

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.

Development instructions

Starting the test/demo server:

  1. Run mvn jetty:run.
  2. Open http://localhost:8080 in the browser.

License

This Add-on is distributed under Apache Licence 2.0.

Sponsored development

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.