@three-tile/plugin
    Preparing search index...

    Class TileMapControls

    Tile map controls

    Hierarchy

    • OrbitControls
      • TileMapControls
    Index

    Constructors

    • Parameters

      • camera: Camera
      • domElement: HTMLElement

      Returns TileMapControls

    Properties

    autoRotate: boolean

    Set to true to automatically rotate around the target. Note that if this is enabled, you must call .update() in your animation loop. If you want the auto-rotate speed to be independent of the frame rate (the refresh rate of the display), you must pass the time deltaTime, in seconds, to .update().

    autoRotateSpeed: number

    How fast to rotate around the target if .autoRotate is true. Default is 2.0, which equates to 30 seconds per orbit at 60fps. Note that if .autoRotate is enabled, you must call .update() in your animation loop.

    cursor: Vector3

    The focus point of the .minTargetRadius and .maxTargetRadius limits. It can be updated manually at any point to change the center of interest for the .target.

    dampingFactor: number

    The damping inertia used if .enableDamping is set to true. Default is 0.05. Note that for this to work, you must call .update() in your animation loop.

    domElement: HTMLElement | null

    The HTML element used for event listeners. If not provided via the constructor, .connect must be called after domElement has been set.

    dynamicMaxPolarAngle: boolean = true
    dynamicZoomSpeed: boolean = true

    Whether to use dynamic zoom speed whit distance, default is true

    enabled: boolean

    When set to false, the controls will not respond to user input. Default is true.

    enableDamping: boolean

    Set to true to enable damping (inertia), which can be used to give a sense of weight to the controls. Default is false. Note that if this is enabled, you must call .update() in your animation loop.

    enablePan: boolean

    Enable or disable camera panning. Default is true.

    enableRotate: boolean

    Enable or disable horizontal and vertical rotation of the camera. Default is true. Note that it is possible to disable a single axis by setting the min and max of the [polar angle].minPolarAngle or [azimuth angle].minAzimuthAngle to the same value, which will cause the vertical or horizontal rotation to be fixed at that value.

    enableZoom: boolean

    Enable or disable zooming (dollying) of the camera.

    keyPanSpeed: number

    How fast to pan the camera when the keyboard is used. Default is 7.0 pixels per keypress.

    keyRotateSpeed: number

    How fast to rotate the camera when the keyboard is used. Default is 1.

    keys: { BOTTOM: string; LEFT: string; RIGHT: string; UP: string }

    This object contains references to the keycodes for controlling camera panning. Default is the 4 arrow keys.

    mapMaxPolarAngle: number = ...

    Map max polar angle, default is Math.PI / 2.1

    maxAzimuthAngle: number

    How far you can orbit horizontally, upper limit. If set, the interval [ min, max ] must be a sub-interval of [ - 2 PI, 2 PI ], with ( max - min < 2 PI ). Default is Infinity.

    maxDistance: number

    How far you can dolly out ( PerspectiveCamera only ). Default is Infinity.

    maxPolarAngle: number

    How far you can orbit vertically, upper limit. Range is 0 to Math.PI radians, and default is Math.PI.

    maxTargetRadius: number

    How far you can move the target from the 3D .cursor. Default is Infinity.

    maxZoom: number

    How far you can zoom out ( OrthographicCamera only ). Default is Infinity.

    minAzimuthAngle: number

    How far you can orbit horizontally, lower limit. If set, the interval [ min, max ] must be a sub-interval of [ - 2 PI, 2 PI ], with ( max - min < 2 PI ). Default is Infinity.

    minDistance: number

    How far you can dolly in ( PerspectiveCamera only ). Default is 0.

    minPolarAngle: number

    How far you can orbit vertically, lower limit. Range is 0 to Math.PI radians, and default is 0.

    minTargetRadius: number

    How close you can get the target to the 3D .cursor. Default is 0.

    minZoom: number

    How far you can zoom in ( OrthographicCamera only ). Default is 0.

    mouseButtons: {
        LEFT?: MOUSE | null;
        MIDDLE?: MOUSE | null;
        RIGHT?: MOUSE | null;
    }

    This object contains references to the mouse actions used by the controls.

    object: Object3D

    The 3D object that is managed by the controls.

    panSpeed: number

    Speed of panning. Default is 1.

    position0: Vector3

    Used internally by the .saveState and .reset methods.

    restAzimuthDist: number = 8e6

    Rest azimuth when distance > restAzimuthDist, default is 8e6

    rotateSpeed: number

    Speed of rotation. Default is 1.

    screenSpacePanning: boolean

    Defines how the camera's position is translated when panning. If true, the camera pans in screen space. Otherwise, the camera pans in the plane orthogonal to the camera's up direction. Default is true.

    target: Vector3

    The focus point of the controls, the .object orbits around this. It can be updated manually at any point to change the focus of the controls.

    target0: Vector3

    Used internally by the .saveState and .reset methods.

    touches: { ONE?: TOUCH | null; TWO?: TOUCH | null }

    This object contains references to the touch actions used by the controls.

    zoom0: number

    Used internally by the .saveState and .reset methods.

    zoomSpeed: number

    Speed of zooming / dollying. Default is 1.

    zoomToCursor: boolean

    Setting this property to true allows to zoom to the cursor's position. Default is false.

    Accessors

    • get controlsMode(): "MAP" | "ORBIT"

      Returns "MAP" | "ORBIT"

    • set controlsMode(value: "MAP" | "ORBIT"): void

      Parameters

      • value: "MAP" | "ORBIT"

      Returns void

    Methods

    • Adds a listener to an event type.

      Type Parameters

      • T extends keyof OrbitControlsEventMap

      Parameters

      • type: T

        The type of event to listen to.

      • listener: EventListener<OrbitControlsEventMap[T], T, TileMapControls>

        The function that gets called when the event is fired.

      Returns void

    • Connects the controls to the DOM. This method has so called "side effects" since it adds the module's event listeners to the DOM.

      Returns void

    • Disconnects the controls from the DOM.

      Returns void

    • Fire an event type.

      Type Parameters

      • T extends keyof OrbitControlsEventMap

      Parameters

      • event: BaseEvent<T> & OrbitControlsEventMap[T]

        The event that gets fired.

      Returns void

    • Call this method if you no longer want use to the controls. It frees all internal resources and removes all event listeners.

      Returns void

    • Get the current horizontal rotation, in radians.

      Returns number

    • Returns the distance from the camera to the target.

      Returns number

    • Get the current vertical rotation, in radians.

      Returns number

    • Checks if listener is added to an event type.

      Type Parameters

      • T extends keyof OrbitControlsEventMap

      Parameters

      • type: T

        The type of event to listen to.

      • listener: EventListener<OrbitControlsEventMap[T], T, TileMapControls>

        The function that gets called when the event is fired.

      Returns boolean

    • Adds key event listeners to the given DOM element. window is a recommended argument for using this method.

      Parameters

      • domElement: HTMLElement | Window

      Returns void

    • Returns void

    • Removes a listener from an event type.

      Type Parameters

      • T extends keyof OrbitControlsEventMap

      Parameters

      • type: T

        The type of the listener that gets removed.

      • listener: EventListener<OrbitControlsEventMap[T], T, TileMapControls>

        The listener function that gets removed.

      Returns void

    • Reset the controls to their state from either the last time the .saveState was called, or the initial state.

      Returns void

    • Save the current state of the controls. This can later be recovered with .reset.

      Returns void

    • Removes the key event listener previously defined with .listenToKeyEvents().

      Returns void

    • Update the controls. Must be called after any manual changes to the camera's transform, or in the update loop if .autoRotate or .enableDamping are set. deltaTime, in seconds, is optional, and is only required if you want the auto-rotate speed to be independent of the frame rate (the refresh rate of the display).

      Parameters

      • OptionaldeltaTime: number | null

      Returns boolean