All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.vaadin.addons.maplibre.GeoJsonHelper Maven / Gradle / Ivy

Go to download

An extension to Vaadin that provides a Java API for MapLibreGL slippy map component with modern vector layer support.

There is a newer version: 1.2.0
Show newest version
package org.vaadin.addons.maplibre;

import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.io.geojson.GeoJsonWriter;

public class GeoJsonHelper {
    static GeoJsonWriter writer = new GeoJsonWriter();

    static {
        writer.setEncodeCRS(false);
    }

    public static String toJs(Coordinate coord) {
        return "[" + coord.getX() + "," + coord.getY() + "]";
    }

    public static String toJs(org.locationtech.jts.geom.Geometry geometry) {
        return writer.write(geometry);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy