Maps

The add-on helps you to enrich your application with visual representation and intuitive manipulation for spatial data. You can use a preferable map provider that meets your needs.

The component integrates spatial types (point, polyline, polygon) from JTS Topology Suite (JTS) — the most popular Java library for working with spatial data.

The add-on supports a traditional multi-layer structure commonly used in professional GIS systems. The layers are represented as structural units of maps.

You can use the following types of layers:

structure

The add-on supports drawing and interactive editing of geo-entities and provides features for geoanalysis: heatmaps and clustering.

Installation

To include Maps in your application, follow the steps below.

  1. Add your Jmix premium repository credentials to the ~/.gradle/gradle.properties file (create the file if it doesn’t exist). For example:

    premiumRepoUser=123456789012
    premiumRepoPass=abcdefghkilm
  2. Add Jmix premium repository to your build.gradle file:

    repositories {
        mavenCentral()
        maven {
            url 'https://nexus.jmix.io/repository/public'
        }
        maven {
            url('https://nexus.jmix.io/repository/premium')
            credentials {
                username("${rootProject['premiumRepoUser']}")
                password("${rootProject['premiumRepoPass']}")
            }
        }
  3. Add the following dependencies to your build.gradle file:

    implementation 'io.jmix.maps:jmix-maps-starter'
    implementation 'io.jmix.maps:jmix-maps-ui-starter'
    widgets 'io.jmix.ui:jmix-ui-widgets'
    widgets 'io.jmix.maps:jmix-maps-ui-widgets'

    Also, remove implementation 'io.jmix.ui:jmix-ui-widgets-compiled' dependency because it is not needed.

  4. Add the compileWidgets task to your build.gradle file and specify an arbitrary widgetset name matching the <base-package>.widgets.<name> pattern, for example:

    compileWidgets {
        generate 'maps.ex1.widgets.CustomWidgetSet'
    }
  5. Add the jmix.ui.widgetSet property to your application.properties file and set the compiled widgetset name in it, for example:

    jmix.ui.widgetSet = maps.ex1.widgets.CustomWidgetSet