geoview-core
    Preparing search index...

    Class GeometryApi

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

    GeometryApi

    Index

    Constructors

    Properties

    defaultGeometryGroupId: string = 'defaultGeomGroup'
    geometries: Feature<Geometry>[] = []

    Methods

    • Create a new circle

      Parameters

      • coordinate: Coordinate

        The long lat coordinate of the circle

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

        The circle options including styling

      • OptionaloptionalFeatureId: string

        Optional id to be used to manage this geometry

      • OptionalgroupId: string

        Optional group id in which 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;
        }

        The marker options including styling

      • OptionaloptionalFeatureId: string

        Optional id to be used to manage this geometry

      • OptionalgroupId: string

        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[][]

        The array of points to create the polygon

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

        the polygon options including styling

      • OptionaloptionalFeatureId: string

        Optional id to be used to manage this geometry

      • OptionalgroupId: string

        Optional group id in which 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

        The points of lon/lat to draw a polyline

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

        Optional polyline options including styling

      • Optionalid: string

        Optional id to be used to manage this geometry

      • OptionalgroupId: string

        Optional group id in which 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 (z-index is infinity, set the index to change the behaviour)

      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>>;
        }

        Optional vector layer and vector source options

      Returns FeatureCollection

      created geometry group

    • Delete all geometries from the geometry group but keep the group

      Parameters

      • geometryGroupid: string

        The group id

      Returns FeatureCollection

      Group with empty layers

      If the provided geometry group id does not exist.

    • Delete a specific feature from a group using the feature id

      Parameters

      • featureId: string

        The feature id to be deleted

      • geometryGroupid: string

        The group id

      Returns void

      If the provided geometry group id does not exist.

    • Delete a geometry group and all the geometries from the map. The default geometry group can't be deleted.

      Parameters

      • geometryGroupid: string

        The id of the geometry group to delete

      Returns void

    • Get the geometry group by using the ID specified when the group was created

      Parameters

      • geometryGroupId: string

        The id of the geometry group to return

      Returns FeatureCollection

      the geomtry group

      If the provided geometry group id does not exist.

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

      Parameters

      • featureId: string

        The id of the geometry

      Returns FeatureCollection[]

      Groups that contain the geometry

    • Get the z-index of a geometry group's vector layer, undefined if group does not exist

      Parameters

      • geometryGroupId: string

        The id of the group

      Returns number

      The z-index value of the vector layer

      If the provided geometry group id does not exist.

    • 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

      Parameters

      • geometryGroupId: string

        The id of the group to show on the map

      Returns void

      If the provided geometry group id does not exist.

    • Show the identified geometry group on the map

      Parameters

      • geometryGroupId: string

        The id of the group to show on the map

      Returns void

      If the provided geometry group id does not exist.

    • Set the z-index of a geometry group's vector layer

      Parameters

      • geometryGroupId: string

        The id of the group

      • zIndex: number

        The z-index value to set

      Returns void

      If the provided geometry group id does not exist.