1
0

MapControls.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>MapControls - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Controls.html">Controls</a> → <a href="OrbitControls.html">OrbitControls</a> → </p>
  13. <h1 translate="no">MapControls</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This class is intended for transforming a camera over a map from bird's eye perspective.
  17. The class shares its implementation with <a href="OrbitControls.html">OrbitControls</a> but uses a specific preset
  18. for mouse/touch interaction and disables screen space panning by default.</p>
  19. <ul>
  20. <li>Orbit: Right mouse, or left mouse + ctrl/meta/shiftKey / touch: two-finger rotate.</li>
  21. <li>Zoom: Middle mouse, or mousewheel / touch: two-finger spread or squish.</li>
  22. <li>Pan: Left mouse, or arrow keys / touch: one-finger move.</li>
  23. </ul></div>
  24. </header>
  25. <article>
  26. <h2 class="subsection-title">Import</h2>
  27. <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>
  28. <pre><code class="language-js">import { MapControls } from 'three/addons/controls/MapControls.js';</code></pre>
  29. <div class="container-overview">
  30. <h2>Constructor</h2>
  31. <h3 class="name name-method" id="MapControls" translate="no">new <a href="#MapControls">MapControls</a><span class="signature">()</span> </h3>
  32. <div class="method">
  33. </div>
  34. </div>
  35. <h2 class="subsection-title">Properties</h2>
  36. <div class="member">
  37. <h3 class="name" id="mouseButtons" translate="no">.<a href="#mouseButtons">mouseButtons</a><span class="type-signature"> : Object</span> </h3>
  38. <div class="description">
  39. <p>This object contains references to the mouse actions used by the controls.</p>
  40. <pre><code class="language-js">controls.mouseButtons = {
  41. LEFT: THREE.MOUSE.PAN,
  42. MIDDLE: THREE.MOUSE.DOLLY,
  43. RIGHT: THREE.MOUSE.ROTATE
  44. }
  45. </code></pre>
  46. </div>
  47. <dl class="details">
  48. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="OrbitControls.html#mouseButtons">OrbitControls#mouseButtons</a></dt>
  49. </dl>
  50. </div>
  51. <div class="member">
  52. <h3 class="name" id="screenSpacePanning" translate="no">.<a href="#screenSpacePanning">screenSpacePanning</a><span class="type-signature"> : boolean</span> </h3>
  53. <div class="description">
  54. <p>Overwritten and set to <code>false</code> to pan orthogonal to world-space direction <code>camera.up</code>.</p>
  55. <p>Default is <code>false</code>.</p>
  56. </div>
  57. <dl class="details">
  58. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="OrbitControls.html#screenSpacePanning">OrbitControls#screenSpacePanning</a></dt>
  59. </dl>
  60. </div>
  61. <div class="member">
  62. <h3 class="name" id="touches" translate="no">.<a href="#touches">touches</a><span class="type-signature"> : Object</span> </h3>
  63. <div class="description">
  64. <p>This object contains references to the touch actions used by the controls.</p>
  65. <pre><code class="language-js">controls.mouseButtons = {
  66. ONE: THREE.TOUCH.PAN,
  67. TWO: THREE.TOUCH.DOLLY_ROTATE
  68. }
  69. </code></pre>
  70. </div>
  71. <dl class="details">
  72. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="OrbitControls.html#touches">OrbitControls#touches</a></dt>
  73. </dl>
  74. </div>
  75. <h2 class="subsection-title">Source</h2>
  76. <p>
  77. <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>
  78. </p>
  79. </article>
  80. </section>
  81. <script src="../scripts/linenumber.js"></script>
  82. <script src="../scripts/page.js"></script>
  83. </body>
  84. </html>
粤ICP备19079148号