map.apps Bundle APIs 4.20.0
    Preparing search index...

    Interface ConstraintsMembers

    Documentation for instances of Constraints.

    interface ConstraintsMembers {
        altitude: SceneViewConstraintsAltitudeProperties;
        clipDistance: SceneViewConstraintsClipDistanceProperties;
        forViewmode(viewmode?: ViewMode): Record<string, any>;
        geometry:
            | undefined
            | null
            | Extent
            | Polygon
            | ExtentProperties
            | PolygonProperties;
        lods: undefined
        | null
        | (LOD | LODProperties)[];
        maxScale: number;
        maxZoom: number;
        minScale: number;
        minZoom: number;
        rotationEnabled: boolean;
        snapToZoom: boolean;
        tilt: SceneViewConstraintsTiltProperties;
    }
    Index

    Properties

    altitude: SceneViewConstraintsAltitudeProperties

    Specifies a constraint on the minimum and maximum allowed camera altitude. Only valid for 3D.

    constraints.altitude = {
    // The minimum allowed camera altitude (in meters).
    min: 1000,
    // The maximum allowed camera altitude (in meters).
    max: 100000
    }
    clipDistance: SceneViewConstraintsClipDistanceProperties

    Specifies the near and far webgl clip distances. Only valid for 3D.

    constraints.clipDistance  = {
    // The near clip distance.
    near: 100,

    // The far clip distance.
    far: 1000,

    // Specifies the mode of the constraint which is either auto or manual.
    // In auto mode, the near and far clip distance values are automatically determined.
    // In manual mode, the near and far clip distance values are user defined.
    mode: "manual"
    }
    geometry:
        | undefined
        | null
        | Extent
        | Polygon
        | ExtentProperties
        | PolygonProperties

    The area in which the user is allowed to navigate laterally. Only Extent and Polygon geometry types are supported

    lods: undefined | null | (LOD | LODProperties)[]

    An array of LODs. If not specified, this value is read from the Map. Only valid for 2D.

    maxScale: number

    The maximum scale the user is allowed to zoom to within the view. Only valid for 2D.

    maxZoom: number

    The maximum zoom level the user is allowed to zoom to within the view. Only valid for 2D.

    minScale: number

    The minimum scale the user is allowed to zoom to within the view. Only valid for 2D.

    minZoom: number

    The minimum zoom level the user is allowed to zoom to within the view. Only valid for 2D.

    rotationEnabled: boolean

    Indicates whether the user can rotate the map. Only valid for 2D.

    snapToZoom: boolean

    When true, the view snaps to the next LOD when zooming in or out. When false, the zoom is continuous. Only valid for 2D.

    tilt: SceneViewConstraintsTiltProperties

    Specifies a constraint on the amount of allowed tilting of the view. Only valid for 3D.

    constraints.tilt  = {
    // Specifies the maximum amount of tilt (in degrees) allowed in the view and may range from 0.5 to 179.5
    // degrees.
    max: 100,

    // Specifies the mode of the constraint.
    // There are two possible values: auto or manual.
    // In auto mode, the maximum tilt value is automatically determined based on the altitude of the view camera.
    // In manual mode, the maximum tilt value is a user defined.
    mode: "manual"
    }

    Methods

    • Query the constraints for a specified viewmode, that are not undefined.

      Parameters

      • Optionalviewmode: ViewMode

        The viewmode to get the constraints for. If empty, "2D" is assumed.

      Returns Record<string, any>

      the constraint values