geoview-core
    Preparing search index...

    Class GeometryApi

    Class used to manage vector geometries (Polyline, Polygon, Circle, Marker...)

    GeometryApi

    Index

    Constructors

    Properties

    activeGeometryGroupIndex: number = 0
    defaultGeometryGroupId: string = 'defaultGeomGroup'
    geometries: Feature<Geometry>[] = []
    geometryGroups: FeatureCollection[] = []
    mapViewer: MapViewer

    Reference on the map viewer

    Methods

    • Create a new circle

      Parameters

      • coordinate: Coordinate

        long lat coordinate of the circle

      • Optionaloptions: {
            geometryLayout?: "XY" | "XYZ" | "XYM" | "XYZM";
            projection?: number;
            style?: TypeFeatureCircleStyle;
        }

        circle options including styling

      • OptionaloptionalFeatureId: string

        an optional id to be used to manage this geometry

      • OptionalgroupId: string

        an optional group id in witch we want to add the geometry

      Returns Feature

      a geometry containing the id and the created geometry

    • Create a new marker icon

      Parameters

      • coordinate: Coordinate

        the long lat position of the marker

      • Optionaloptions: {
            geometryLayout?: "XY" | "XYZ" | "XYM" | "XYZM";
            projection?: number;
            style?: TypeIconStyle;
        }

        marker options including styling

      • OptionaloptionalFeatureId: string

        an optional id to be used to manage this geometry

      • OptionalgroupId: string

        an optional group id in witch we want to add the geometry

      Returns Feature

      a geometry containing the id and the created geometry

    • Create a new polygon

      Parameters

      • points: number[] | Coordinate[][]

        array of points to create the polygon

      • Optionaloptions: {
            geometryLayout?: "XY" | "XYZ" | "XYM" | "XYZM";
            projection?: number;
            style?: TypeFeatureStyle;
        }

        polygon options including styling

      • OptionaloptionalFeatureId: string

        an optional id to be used to manage this geometry

      • OptionalgroupId: string

        an optional group id in witch we want to add the geometry

      Returns Feature

      a geometry containing the id and the created geometry

    • Create a polyline using an array of lon/lat points

      Parameters

      • points: Coordinate

        points of lon/lat to draw a polyline

      • Optionaloptions: {
            geometryLayout?: "XY" | "XYZ" | "XYM" | "XYZM";
            projection?: number;
            style?: TypeFeatureStyle;
        }

        polyline options including styling

      • Optionalid: string

        an optional id to be used to manage this geometry

      • OptionalgroupId: string

        an optional group id in witch we want to add the geometry

      Returns Feature

      a geometry containing the id and the created geometry

    • Add a new geometry to the group whose identifier is equal to geometryGroupId. if geometryGroupId is not provided, use the active geometry group. If the geometry group doesn't exist, create it.

      Parameters

      • geometry: Feature

        the geometry to be added to the group

      • OptionalgeometryGroupId: string

        optional id of the group to add the geometry to

      Returns void

    • Create a new geometry group to manage multiple geometries at once

      Parameters

      • geometryGroupId: string

        the id of the group to use when managing this group

      • Optionaloptions: {
            vectorLayerOptions?: Options<
                Feature<Geometry>,
                VectorSource<Feature<Geometry>>,
            >;
            vectorSourceOptions?: Options<Feature<Geometry>>;
        }

        an optional vector layer and vector source options

      Returns FeatureCollection

      created geometry group

    • Delete all geometries from the geometry group but keep the group If geometryGroupid is not provided, the active geometry group is used.

      Parameters

      • OptionalgeometryGroupid: string

        optional group id

      Returns FeatureCollection

      the group with empty layers

    • Delete a specific feature from a group using the feature id If geometryGroupid is not provided, the active geometry group is used.

      Parameters

      • featureId: string

        the feature id to be deleted

      • OptionalgeometryGroupid: string

        optional group id

      Returns void

    • Delete a geometry group and all the geometries from the map. If geometryGroupid is not provided, the active geometry group is used. The default geometry group can't be deleted.

      Parameters

      • OptionalgeometryGroupid: string

        optional id of the geometry group to delete

      Returns void

    • Get the geometry group by using the ID specified when the group was created if geometryGroupid is not provided, return the active geometry group

      Parameters

      • OptionalgeometryGroupId: string

        the id of the geometry group to return

      Returns FeatureCollection | undefined

      the geomtry group

    • Find the groups that contain the geometry using it's id

      Parameters

      • featureId: string

        the id of the geometry

      Returns FeatureCollection[]

      the groups that contain the geometry

    • set the active geometry group (the geometry group used when adding geometries). If id is not specified, use the default geometry group.

      Parameters

      • Optionalid: string

        optional the id of the group to set as active

      Returns void

    • hide the identified geometry group from the map if groupId is not provided, use the active geometry group

      Parameters

      • OptionalgeometryGroupId: string

        optional the id of the group to show on the map

      Returns void

    • Show the identified geometry group on the map if geometryGroupId is not provided, use the active geometry group

      Parameters

      • OptionalgeometryGroupId: string

        optional the id of the group to show on the map

      Returns void