Interface MapConversionFunctions

All Superinterfaces:
ExecutableFunctions, Identifiable
All Known Implementing Classes:
LeafletMap

public interface MapConversionFunctions extends ExecutableFunctions
Map Conversion Methods
Since:
2020-03-16
Version:
1.1
Author:
Gabor Kokeny Email: kokeny19@gmail.com
  • Method Details

    • project

      default CompletableFuture<Point> project(LatLng latLng, int zoom)
      Projects a geographical coordinate LatLng according to the projection of the map's CRS, then scales it according to zoom and the CRS's Transformation. The result is pixel coordinate relative to the CRS origin.
      Parameters:
      latLng - the coordinate to be projected
      zoom - the zoom level
      Returns:
      the pixel coordinate relative to the CRS origin
    • unproject

      default CompletableFuture<LatLng> unproject(Point point, int zoom)
      Inverse of project.
      Parameters:
      point - the point to be unprojected
      zoom - the zoom level
      Returns:
      the geographical coordinate
    • layerPointToLatLng

      default CompletableFuture<LatLng> layerPointToLatLng(Point point)
      Given a pixel coordinate relative to the origin pixel, returns the corresponding geographical coordinate (for the current zoom level).
      Parameters:
      point - a pixel coordinate relative to the origin pixel
      Returns:
      the corresponding geographical coordinate
    • latLngToLayerPoint

      default CompletableFuture<Point> latLngToLayerPoint(LatLng latLng)
      Given a geographical coordinate, returns the corresponding pixel coordinate relative to the origin pixel.
      Parameters:
      latLng - a geographical coordinate
      Returns:
      the corresponding pixel coordinate
    • wrapLatLng

      default CompletableFuture<LatLng> wrapLatLng(LatLng latLng)
      Returns a LatLng where lat and lng has been wrapped according to the map's CRS's wrapLat and wrapLng properties, if they are outside the CRS's bounds. By default this means longitude is wrapped around the dateline so its value is between -180 and +180 degrees.
      Parameters:
      latLng - a geographical coordinate
      Returns:
      the wrapped latlng
    • wrapLatLngBounds

      default CompletableFuture<LatLngBounds> wrapLatLngBounds(LatLngBounds bounds)
      Returns a LatLngBounds with the same size as the given one, ensuring that its center is within the CRS's bounds. By default this means the center longitude is wrapped around the dateline so its value is between -180 and +180 degrees, and the majority of the bounds overlaps the CRS's bounds.
      Parameters:
      bounds - a LatLngBounds to be wrapped
      Returns:
      the wrapped LatLngBounds
      See Also:
    • distance

      default CompletableFuture<Double> distance(LatLng latLng1, LatLng latLng2)
      Returns the distance between two geographical coordinates according to the map's CRS. By default this measures distance in meters.
      Parameters:
      latLng1 - the first geographical coordinate
      latLng2 - the second geographical coordinate
      Returns:
      the distance between the given geographical coordinates
      See Also:
    • containerPointToLayerPoint

      default CompletableFuture<Point> containerPointToLayerPoint(Point point)
      Given a pixel coordinate relative to the map container, returns the corresponding pixel coordinate relative to the origin pixel.
      Parameters:
      point - a pixel coordinate relative to the map container
      Returns:
      the corresponding pixel coordinate relative to the origin pixel
      See Also:
    • layerPointToContainerPoint

      default CompletableFuture<Point> layerPointToContainerPoint(Point point)
      Given a pixel coordinate relative to the origin pixel, returns the corresponding pixel coordinate relative to the map container.
      Parameters:
      point - a pixel coordinate relative to the origin pixel
      Returns:
      the corresponding pixel coordinate relative to the map container
      See Also:
    • containerPointToLatLng

      default CompletableFuture<LatLng> containerPointToLatLng(Point point)
      Given a pixel coordinate relative to the map container, returns the corresponding geographical coordinate (for the current zoom level).
      Parameters:
      point - a pixel coordinate relative to the map container
      Returns:
      the corresponding geographical coordinate (for the current zoom level)
      See Also:
    • latLngToContainerPoint

      default CompletableFuture<Point> latLngToContainerPoint(LatLng latLng)
      Given a geographical coordinate, returns the corresponding pixel coordinate relative to the map container.
      Parameters:
      latLng - a geographical coordinate
      Returns:
      the corresponding pixel coordinate relative to the map container
      See Also:
    • mouseEventToContainerPoint

      default CompletableFuture<Point> mouseEventToContainerPoint(MouseEvent mouseEvent)
      Given a MouseEvent object, returns the pixel coordinate relative to the map container where the event took place.
      Parameters:
      mouseEvent - a MouseEvent object
      Returns:
      the pixel coordinate relative to the map container where the event took place
      See Also:
    • mouseEventToLayerPoint

      default CompletableFuture<Point> mouseEventToLayerPoint(MouseEvent mouseEvent)
      Given a MouseEvent object, returns the pixel coordinate relative to the origin pixel where the event took place.
      Parameters:
      mouseEvent - a MouseEvent object
      Returns:
      the origin pixel where the event took place
      See Also:
    • mouseEventToLatLng

      default CompletableFuture<LatLng> mouseEventToLatLng(MouseEvent mouseEvent)
      Given a MouseEvent object, returns geographical coordinate where the event took place.
      Parameters:
      mouseEvent - a MouseEvent object
      Returns:
      the geographical coordinate where the event took place.
      See Also: