| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>MapControls - Three.js Docs</title>
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <script src="../scripts/highlight.min.js"></script>
- <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
- <link type="text/css" rel="stylesheet" href="../styles/page.css">
- </head>
- <body>
- <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Controls.html">Controls</a> → <a href="OrbitControls.html">OrbitControls</a> → </p>
- <h1 translate="no">MapControls</h1>
- <section>
- <header>
- <div class="class-description"><p>This class is intended for transforming a camera over a map from bird's eye perspective.
- The class shares its implementation with <a href="OrbitControls.html">OrbitControls</a> but uses a specific preset
- for mouse/touch interaction and disables screen space panning by default.</p>
- <ul>
- <li>Orbit: Right mouse, or left mouse + ctrl/meta/shiftKey / touch: two-finger rotate.</li>
- <li>Zoom: Middle mouse, or mousewheel / touch: two-finger spread or squish.</li>
- <li>Pan: Left mouse, or arrow keys / touch: one-finger move.</li>
- </ul></div>
- </header>
- <article>
- <h2 class="subsection-title">Import</h2>
- <p><span translate="no">MapControls</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank" rel="noopener">Installation#Addons</a>.</p>
- <pre><code class="language-js">import { MapControls } from 'three/addons/controls/MapControls.js';</code></pre>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="MapControls" translate="no">new <a href="#MapControls">MapControls</a><span class="signature">()</span> </h3>
- <div class="method">
- </div>
- </div>
- <h2 class="subsection-title">Properties</h2>
- <div class="member">
- <h3 class="name" id="mouseButtons" translate="no">.<a href="#mouseButtons">mouseButtons</a><span class="type-signature"> : Object</span> </h3>
- <div class="description">
- <p>This object contains references to the mouse actions used by the controls.</p>
- <pre><code class="language-js">controls.mouseButtons = {
- LEFT: THREE.MOUSE.PAN,
- MIDDLE: THREE.MOUSE.DOLLY,
- RIGHT: THREE.MOUSE.ROTATE
- }
- </code></pre>
- </div>
- <dl class="details">
- <dt class="tag-overrides"><strong>Overrides:</strong> <a href="OrbitControls.html#mouseButtons">OrbitControls#mouseButtons</a></dt>
- </dl>
- </div>
- <div class="member">
- <h3 class="name" id="screenSpacePanning" translate="no">.<a href="#screenSpacePanning">screenSpacePanning</a><span class="type-signature"> : boolean</span> </h3>
- <div class="description">
- <p>Overwritten and set to <code>false</code> to pan orthogonal to world-space direction <code>camera.up</code>.</p>
- <p>Default is <code>false</code>.</p>
- </div>
- <dl class="details">
- <dt class="tag-overrides"><strong>Overrides:</strong> <a href="OrbitControls.html#screenSpacePanning">OrbitControls#screenSpacePanning</a></dt>
- </dl>
- </div>
- <div class="member">
- <h3 class="name" id="touches" translate="no">.<a href="#touches">touches</a><span class="type-signature"> : Object</span> </h3>
- <div class="description">
- <p>This object contains references to the touch actions used by the controls.</p>
- <pre><code class="language-js">controls.mouseButtons = {
- ONE: THREE.TOUCH.PAN,
- TWO: THREE.TOUCH.DOLLY_ROTATE
- }
- </code></pre>
- </div>
- <dl class="details">
- <dt class="tag-overrides"><strong>Overrides:</strong> <a href="OrbitControls.html#touches">OrbitControls#touches</a></dt>
- </dl>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/controls/MapControls.js" translate="no" target="_blank" rel="noopener">examples/jsm/controls/MapControls.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|