A lightweight mapping alternative to popular mapping APIs like Google Maps and OpenLayers.
The library uses Leaflet, an open-source javascript library for mobile-friendly interactive maps by CloudMade, to implement a collection of mapping Widgets which GWT projects can use to implement mapping capabilites on the client-side of a GWT application. The Leaflet API is a third-party javascript and is integrated with GWT as Java classes using JSNI and Type Overlays.
Warning: This project is in flux. API, module structure and names can change at any time!
###Milestones###
- v0.1 (Medio Sep 2012) - Core parts of Leaflet API exposed
- v0.2 (Primo Nov 2012) - All relevant parts of Leaflet API exposed, start publishing snapshots (maven + jars)
- v0.3 (Ultimo Dec 2012) - Widgets: geolocation (field), first official release (maven + jars).
- v0.4 (Ultimo Sep 2015) - GWT upgraded to 2.7.0. Added leaflet.draw plugin.
###Core Module###
Dependency: Leaflet 0.7.3
Following parts of Leaflet API are implemented:
- L.Map - Leaflet Map class (partial)
- ILayer - Common layer interface
- L.TileLayer - Common Tile layer class
- L.TileLayer.WMS - WMS layer class
- IControl - Common control interface
- L.Control.Layers - Layer switcher control class
- L.Control.Attribution - Map and layer attribution class
- L.Control.Scale - Simple legend control class
- L.Control.Zoom - Simple zoom control class
- L.Point - Map point (coordinates in pixels)
- L.LatLng - Geographical point
- L.Transformation - Affine transformation
- ICRS - Coordinate reference system interface
- L.CRS - Base CRS class
- L.CRS.EPSG3395 - EPSG:3395
- L.CRS.EPSG3857 - EPSG:3857
- L.CRS.EPSG4326 - EPSG:4326
- L.CRS.Simple - Simple CRS (lat and lng into x and y directly)
###Widget Module (GWT)###
- MapWidget - GWT Widget displaying a Map instance (available from WindowBuilder Editor palette)
###Proj4 Module (GWT)###
Dependency: Proj4Leaflet master/74a5a8b170ff58e635cba139cfaa25cd4cd5d022 (git)
- Proj4 - Custom (local) CRS factory plugin to Leaflet (Proj4Leaflet)
###Search Module (GWT)###
Dependency: leaflet-search master/3b717c6ff2bbd5ad19ba4f851c152f67ca62b97d (git)
- Leaflet Search - Simple search plugin for Leaflet (leaflet-search)
###Label Module (GWT)###
Dependency: Leaflet.label version 0.2.1 (git)
- Leaflet label - Simple label plugin for Leaflet (Leaflet.label)
###Draw Module (GWT)###
Dependency: Leaflet.draw version 0.2.3 (git)
- Leaflet draw - Enables drawing features like polylines, polygons, rectangles, circles and markers through a very nice user-friendly interface with icons and hints. (Leaflet.draw)
###Ellipse Module (GWT)###
Dependency: Leaflet.ellipse version 66b8c2f23e833eed08389157f410cd735f8a3275 (git)
- Leaflet ellipse - A basic ellipse type for Leaflet, a JS library for interactive maps. Allows specification of semi-major and semi-minor axis as well as a tilt degrees from west. (Leaflet.ellipse)
###Measure Module (GWT)###
Dependency: Leaflet.MeasureControl version 97016995b7e15ccea62c6b3c84cddfd9d1a35f8f (git) Dependency: Leaflet.draw version 0.2.3 (git)
- Leaflet MeasureControl - A simple tool to measure distances on maps. (Leaflet.MeasureControl)
###Coordinates Module (GWT)###
Dependency: Leaflet.Coordinates version 0.1.4 (git)
- Leaflet Coordinates - A Leaflet plugin to view mouse coordinates. Also the user can change the coordinates and get a marker on that position viewing the coordinates. (Leaflet.Coordinates)
Goto gwtl-example.appspot.com to see a running example of the GWT example project.
This Git project structured as a Maven multi-gwt-module project setup, (see working with maven) and is developed using
- Maven (3+)
- Maven GWT Plugin - automatically downloaded by maven
- Eclipse IDE for Java Developers (3.7.2)
- Google Eclipse Plugin
- Window Builder Pro
- EGit
- Maven Integration for Eclipse 1.2
- Maven Integration for Eclipse WTP (Incubation) 0.16.0
Ensure that these are all installed and ready before you continue. To install from scratch, just
- Download and install Eclipse
- Download P2 software file import file and start Eclipse
- Open File -> Import -> "Install Software Items from File" wizard
- Enter path to p2f file downloaded in step 2
- Check "Contact all update sites during install to find required software"
- Press enter and follow the instructions.
When you are all done, just (linux)
- fork this repo on github
- clone the fork locally -
git clone https://github.com/<username>/gwt-leaflet.git
- change directory to -
cd gwt-leaflet/src
- and run the command -
mvn package
which should automatically download some stuff for you and prepare the projects for import into Eclipse.
- Switch to Eclipse and select File -> Import...
- Select Maven -> Existing Maven Projects
- Select Browse ... -> gwt-leaflet/src
- Finish
which should import all projects into current workspace.
You find more information in the developer guide.