terra-draw-monorepo
    Preparing search index...

    Hierarchy

    • unknown
      • TerraDrawGoogleMapsAdapter
    Index

    Constructors

    Methods

    • Returns the longitude and latitude coordinates from a given PointerEvent on the map.

      Parameters

      • event: PointerEvent | MouseEvent

        The PointerEvent or MouseEvent containing the screen coordinates of the pointer.

      Returns { lat: number; lng: number } | null

      An object with 'lng' and 'lat' properties representing the longitude and latitude, or null if the conversion is not possible.

    • Retrieves the HTML element of the Google Map element that handles interaction events

      Parameters

      • OptionaleventType:
            | "pointerdown"
            | "pointerup"
            | "pointermove"
            | "contextmenu"
            | "keyup"
            | "keydown"

      Returns HTMLElement

      The HTMLElement representing the map container.

    • Converts longitude and latitude coordinates to pixel coordinates in the map container.

      Parameters

      • lng: number

        The longitude coordinate to project.

      • lat: number

        The latitude coordinate to project.

      Returns { x: number; y: number }

      An object with 'x' and 'y' properties representing the pixel coordinates within the map container.

    • Renders GeoJSON features on the map using the provided styling configuration. Schedules actual mutations into requestAnimationFrame, applying: deletes -> updates -> creates

      Parameters

      • changes: TerraDrawChanges
      • styling: TerraDrawStylingFunction

      Returns void

    • Converts pixel coordinates in the map container to longitude and latitude coordinates.

      Parameters

      • x: number

        The x-coordinate in the map container to unproject.

      • y: number

        The y-coordinate in the map container to unproject.

      Returns { lat: number; lng: number }

      An object with 'lng' and 'lat' properties representing the longitude and latitude coordinates.