GeoLeaf Core API - v3.19.0
    Preparing search index...

    Function representativePoint

    • One position that stands for a geometry.

      A point is itself; a multipoint, its first point; a line, its middle VERTEX — a position that lies on the line, which a route can be drawn to; anything else, the centre of its box. ⚠️ The centre of a concave polygon's box may fall outside it: this answers "where to look", not "a point inside".

      Parameters

      • geometry: unknown

        A GeoJSON geometry.

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

      { lat, lng }, or null when the geometry holds no valid position.

      representativePoint({ type: "Point", coordinates: [5.5, 45.25] }); // { lat: 45.25, lng: 5.5 }