Home

Awesome

V-Leaflet example project

This is a small usage example of V-Leaflet in a small Vaadin application. It is built to show how easy it can be to add some GIS features into typical Vaadin application - even without setting up a separate geoserver or its various commercial competitors. The app uses simple "domain driven JPA backend". The UI itself is rather rude and e.g. error handling is minimal, but the code should be easy to understand as a Leaflet usage example.

This example app is not trying to demonstrate all V-Leaflet features, but just to give an overall picture. For relevant V-Leaflet specific code examples, see at least these classes:

The app uses work in progress version of Hibernates spatial extensions, but that is by no means necessary with v-leaflet. The JPA session is used in J2SE style, but should be easy to adapt to e.g jboss, just use extended persistence context. This is fine for at least apps with moderate concurrent users. The used database is h2 (for portability), but I'd bet using PostgreSQL/PostGIS is a more tested combination for production usage.

To play with the project you just need to import it into your favorite IDE, execute "mvn package" and deploy it into server (or use "mvn jetty:run").

Things planned to improve the demo:

Links to projects that "make this possible"