Skip to content

Latest commit

 

History

History
111 lines (77 loc) · 3.3 KB

README.md

File metadata and controls

111 lines (77 loc) · 3.3 KB

LeafletMap

LeafletMap is a JavaFX component for displaying an OpenStreetMap based map inside a JavaFX WebView by using the Leaflet JavaScript library.

There is a demo application inside the test directory which shows how to use the LeafletMap component.

Both the LeafletMap component and the demo application are written in Kotlin.

Dependencies and used libraries

Status

  • map viewer features:
    • supports OpenStreetMap, OpenCycleMap, HikeBikeMap, MtbMap and MapBox layers, more can be added easily
    • MapBox layer: a project specific token is required for MapBox! A test token for a limited time can be found in the Leaflet tutorial.
    • layers can be switched at runtime by the user
    • zoom and scale controls can be configured
    • scale supports metric and imperial units
    • markers in multiple colors can be displayed
    • tracks (routes) can be displayed
    • the map is zoomed properly to fit the track
    • tooltips can be displayed on the map
  • colored markers are supported by the embedded "leaflet-color-markers" library (modified, e.g. added proper retina icon support)
  • the leaflet and the leaflet-color-markers libraries are included locally, no download at runtime needed
  • map viewer can be used offline, the route and the markers are shown without the map data
  • the LeafletMapView component API can also be used from Java without problems (default method parameters are supported via @JvmOverloads)
  • the demo application displays a GPS track read from a JSON file, the user can replay the track by using a position slider

Changelog

LeafletMap 1.1.4.1:

  • Bugfix

LeafletMap 1.1.4:

  • Improved support for customMarkers

LeafletMap 1.1.3:

  • Added Wrapper Class for Marker

LeafletMap 1.1.2:

  • Added Events
    • MarkerClickEvent
    • MapClickedEvent
    • MapMovedEvent

LeafletMap 1.1:

  • Added support for customMarkers
  • Added removeMarker function
  • Added changeIconOfMarker function

LeafletMap 1.0.2:

  • Updated to Kotlin 1.2.0

LeafletMap 1.0.1:

  • Updated to Kotlin 1.1.50
  • API: added methods for setting the center position and zoom level (was only possible for tracks before)

License

(C) 2017 Stefan Saring

(C) 2017 Niklas Kellner

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.

You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.