@antv/l7-map 2.5.36 → 2.5.37-mini

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/lib/camera.js.map +1 -1
  2. package/lib/earthmap.js +7 -26
  3. package/lib/earthmap.js.map +1 -1
  4. package/lib/handler/handler_manager.js +55 -33
  5. package/lib/handler/handler_manager.js.map +1 -1
  6. package/lib/handler/shim/drag_pan.js +10 -2
  7. package/lib/handler/shim/drag_pan.js.map +1 -1
  8. package/lib/handler/shim/touch_zoom_rotate.js +10 -2
  9. package/lib/handler/shim/touch_zoom_rotate.js.map +1 -1
  10. package/lib/hash.js +9 -4
  11. package/lib/hash.js.map +1 -1
  12. package/lib/map.js +39 -19
  13. package/lib/map.js.map +1 -1
  14. package/lib/util.js +7 -5
  15. package/lib/util.js.map +1 -1
  16. package/lib/utils/dom.js +66 -26
  17. package/lib/utils/dom.js.map +1 -1
  18. package/lib/utils/performance.js +4 -1
  19. package/lib/utils/performance.js.map +1 -1
  20. package/package.json +3 -3
  21. package/LICENSE.md +0 -21
  22. package/es/camera.d.ts +0 -82
  23. package/es/camera.js +0 -729
  24. package/es/camera.js.map +0 -1
  25. package/es/earthmap.d.ts +0 -67
  26. package/es/earthmap.js +0 -454
  27. package/es/earthmap.js.map +0 -1
  28. package/es/geo/edge_insets.d.ts +0 -54
  29. package/es/geo/edge_insets.js +0 -88
  30. package/es/geo/edge_insets.js.map +0 -1
  31. package/es/geo/lng_lat.d.ts +0 -18
  32. package/es/geo/lng_lat.js +0 -77
  33. package/es/geo/lng_lat.js.map +0 -1
  34. package/es/geo/lng_lat_bounds.d.ts +0 -24
  35. package/es/geo/lng_lat_bounds.js +0 -170
  36. package/es/geo/lng_lat_bounds.js.map +0 -1
  37. package/es/geo/mercator.d.ts +0 -28
  38. package/es/geo/mercator.js +0 -79
  39. package/es/geo/mercator.js.map +0 -1
  40. package/es/geo/point.d.ts +0 -40
  41. package/es/geo/point.js +0 -237
  42. package/es/geo/point.js.map +0 -1
  43. package/es/geo/simple.d.ts +0 -28
  44. package/es/geo/simple.js +0 -78
  45. package/es/geo/simple.js.map +0 -1
  46. package/es/geo/transform.d.ts +0 -198
  47. package/es/geo/transform.js +0 -663
  48. package/es/geo/transform.js.map +0 -1
  49. package/es/handler/IHandler.d.ts +0 -34
  50. package/es/handler/IHandler.js +0 -2
  51. package/es/handler/IHandler.js.map +0 -1
  52. package/es/handler/blockable_map_event.d.ts +0 -17
  53. package/es/handler/blockable_map_event.js +0 -84
  54. package/es/handler/blockable_map_event.js.map +0 -1
  55. package/es/handler/box_zoom.d.ts +0 -59
  56. package/es/handler/box_zoom.js +0 -184
  57. package/es/handler/box_zoom.js.map +0 -1
  58. package/es/handler/click_zoom.d.ts +0 -16
  59. package/es/handler/click_zoom.js +0 -64
  60. package/es/handler/click_zoom.js.map +0 -1
  61. package/es/handler/events/event.d.ts +0 -4
  62. package/es/handler/events/event.js +0 -14
  63. package/es/handler/events/event.js.map +0 -1
  64. package/es/handler/events/index.d.ts +0 -4
  65. package/es/handler/events/index.js +0 -5
  66. package/es/handler/events/index.js.map +0 -1
  67. package/es/handler/events/map_mouse_event.d.ts +0 -34
  68. package/es/handler/events/map_mouse_event.js +0 -65
  69. package/es/handler/events/map_mouse_event.js.map +0 -1
  70. package/es/handler/events/map_touch_event.d.ts +0 -57
  71. package/es/handler/events/map_touch_event.js +0 -75
  72. package/es/handler/events/map_touch_event.js.map +0 -1
  73. package/es/handler/events/map_wheel_event.d.ts +0 -33
  74. package/es/handler/events/map_wheel_event.js +0 -52
  75. package/es/handler/events/map_wheel_event.js.map +0 -1
  76. package/es/handler/events/render_event.d.ts +0 -5
  77. package/es/handler/events/render_event.js +0 -41
  78. package/es/handler/events/render_event.js.map +0 -1
  79. package/es/handler/handler_inertia.d.ts +0 -23
  80. package/es/handler/handler_inertia.js +0 -186
  81. package/es/handler/handler_inertia.js.map +0 -1
  82. package/es/handler/handler_manager.d.ts +0 -57
  83. package/es/handler/handler_manager.js +0 -655
  84. package/es/handler/handler_manager.js.map +0 -1
  85. package/es/handler/handler_util.d.ts +0 -4
  86. package/es/handler/handler_util.js +0 -10
  87. package/es/handler/handler_util.js.map +0 -1
  88. package/es/handler/keyboard.d.ts +0 -36
  89. package/es/handler/keyboard.js +0 -157
  90. package/es/handler/keyboard.js.map +0 -1
  91. package/es/handler/map_event.d.ts +0 -29
  92. package/es/handler/map_event.js +0 -120
  93. package/es/handler/map_event.js.map +0 -1
  94. package/es/handler/mouse/index.d.ts +0 -4
  95. package/es/handler/mouse/index.js +0 -5
  96. package/es/handler/mouse/index.js.map +0 -1
  97. package/es/handler/mouse/mouse_handler.d.ts +0 -22
  98. package/es/handler/mouse/mouse_handler.js +0 -131
  99. package/es/handler/mouse/mouse_handler.js.map +0 -1
  100. package/es/handler/mouse/mousepan_handler.d.ts +0 -10
  101. package/es/handler/mouse/mousepan_handler.js +0 -54
  102. package/es/handler/mouse/mousepan_handler.js.map +0 -1
  103. package/es/handler/mouse/mousepitch_hander.d.ts +0 -9
  104. package/es/handler/mouse/mousepitch_hander.js +0 -54
  105. package/es/handler/mouse/mousepitch_hander.js.map +0 -1
  106. package/es/handler/mouse/mouserotate_hander.d.ts +0 -9
  107. package/es/handler/mouse/mouserotate_hander.js +0 -54
  108. package/es/handler/mouse/mouserotate_hander.js.map +0 -1
  109. package/es/handler/mouse/util.d.ts +0 -6
  110. package/es/handler/mouse/util.js +0 -12
  111. package/es/handler/mouse/util.js.map +0 -1
  112. package/es/handler/scroll_zoom.d.ts +0 -93
  113. package/es/handler/scroll_zoom.js +0 -317
  114. package/es/handler/scroll_zoom.js.map +0 -1
  115. package/es/handler/shim/dblclick_zoom.d.ts +0 -40
  116. package/es/handler/shim/dblclick_zoom.js +0 -45
  117. package/es/handler/shim/dblclick_zoom.js.map +0 -1
  118. package/es/handler/shim/drag_pan.d.ts +0 -61
  119. package/es/handler/shim/drag_pan.js +0 -53
  120. package/es/handler/shim/drag_pan.js.map +0 -1
  121. package/es/handler/shim/drag_rotate.d.ts +0 -46
  122. package/es/handler/shim/drag_rotate.js +0 -51
  123. package/es/handler/shim/drag_rotate.js.map +0 -1
  124. package/es/handler/shim/touch_zoom_rotate.d.ts +0 -70
  125. package/es/handler/shim/touch_zoom_rotate.js +0 -80
  126. package/es/handler/shim/touch_zoom_rotate.js.map +0 -1
  127. package/es/handler/tap/single_tap_recognizer.d.ts +0 -20
  128. package/es/handler/tap/single_tap_recognizer.js +0 -127
  129. package/es/handler/tap/single_tap_recognizer.js.map +0 -1
  130. package/es/handler/tap/tap_drag_zoom.d.ts +0 -22
  131. package/es/handler/tap/tap_drag_zoom.js +0 -124
  132. package/es/handler/tap/tap_drag_zoom.js.map +0 -1
  133. package/es/handler/tap/tap_recognizer.d.ts +0 -17
  134. package/es/handler/tap/tap_recognizer.js +0 -72
  135. package/es/handler/tap/tap_recognizer.js.map +0 -1
  136. package/es/handler/tap/tap_zoom.d.ts +0 -22
  137. package/es/handler/tap/tap_zoom.js +0 -124
  138. package/es/handler/tap/tap_zoom.js.map +0 -1
  139. package/es/handler/touch/index.d.ts +0 -5
  140. package/es/handler/touch/index.js +0 -6
  141. package/es/handler/touch/index.js.map +0 -1
  142. package/es/handler/touch/touch_pan.d.ts +0 -30
  143. package/es/handler/touch/touch_pan.js +0 -139
  144. package/es/handler/touch/touch_pan.js.map +0 -1
  145. package/es/handler/touch/touch_pitch.d.ts +0 -13
  146. package/es/handler/touch/touch_pitch.js +0 -120
  147. package/es/handler/touch/touch_pitch.js.map +0 -1
  148. package/es/handler/touch/touch_rotate.d.ts +0 -12
  149. package/es/handler/touch/touch_rotate.js +0 -88
  150. package/es/handler/touch/touch_rotate.js.map +0 -1
  151. package/es/handler/touch/touch_zoom.d.ts +0 -12
  152. package/es/handler/touch/touch_zoom.js +0 -79
  153. package/es/handler/touch/touch_zoom.js.map +0 -1
  154. package/es/handler/touch/two_touch.d.ts +0 -23
  155. package/es/handler/touch/two_touch.js +0 -140
  156. package/es/handler/touch/two_touch.js.map +0 -1
  157. package/es/hash.d.ts +0 -15
  158. package/es/hash.js +0 -143
  159. package/es/hash.js.map +0 -1
  160. package/es/index.d.ts +0 -2
  161. package/es/index.js +0 -3
  162. package/es/index.js.map +0 -1
  163. package/es/interface.d.ts +0 -31
  164. package/es/interface.js +0 -2
  165. package/es/interface.js.map +0 -1
  166. package/es/map.d.ts +0 -67
  167. package/es/map.js +0 -454
  168. package/es/map.js.map +0 -1
  169. package/es/util.d.ts +0 -18
  170. package/es/util.js +0 -74
  171. package/es/util.js.map +0 -1
  172. package/es/utils/Aabb.d.ts +0 -12
  173. package/es/utils/Aabb.js +0 -134
  174. package/es/utils/Aabb.js.map +0 -1
  175. package/es/utils/dom.d.ts +0 -4
  176. package/es/utils/dom.js +0 -165
  177. package/es/utils/dom.js.map +0 -1
  178. package/es/utils/performance.d.ts +0 -17
  179. package/es/utils/performance.js +0 -57
  180. package/es/utils/performance.js.map +0 -1
  181. package/es/utils/primitives.d.ts +0 -6
  182. package/es/utils/primitives.js +0 -44
  183. package/es/utils/primitives.js.map +0 -1
  184. package/es/utils/task_queue.d.ts +0 -13
  185. package/es/utils/task_queue.js +0 -113
  186. package/es/utils/task_queue.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/geo/transform.ts"],"names":["mat2","mat4","vec3","vec4","Point","clamp","interpolate","wrap","EdgeInsets","LngLat","LngLatBounds","MercatorCoordinate","mercatorXfromLng","mercatorYfromLat","mercatorZfromAltitude","EXTENT","Transform","minZoom","maxZoom","minPitch","maxPitch","renderWorldCopies","tileSize","maxValidLatitude","_renderWorldCopies","undefined","_minZoom","_maxZoom","_minPitch","_maxPitch","setMaxBounds","width","height","_center","zoom","angle","_fov","_pitch","unmodified","edgeInsets","posMatrixCache","alignedPosMatrixCache","Math","max","min","pitch","scale","centerPoint","_sub","size","_div","PI","bearing","b","calcMatrices","rotationMatrix","create","rotate","p","fov","_zoom","z","zoomScale","tileZoom","floor","zoomFraction","constrain","center","lat","lng","toJSON","padding","equals","getCenter","project","clone","latRange","start","target","t","options","roundZoom","round","scaleZoom","pixelsToGLUnits","pow","log","LN2","lnglat","worldSize","point","x","y","toLngLat","a","pointCoordinate","loc","locationCoordinate","newCenter","coordinateLocation","targetZ","coord0","Float32Array","coord1","transformMat4","pixelMatrixInverse","w0","w1","x0","x1","y0","y1","z0","z1","extend","pointLocation","length","lngRange","bounds","getWest","getEast","getSouth","getNorth","mercatorMatrix","slice","coord","topPoint","pixelMatrix","cameraToCenterDistance","yOffset","tan","add","queryGeometry","c","getCameraPoint","minX","minY","maxX","maxY","fromValues","coordinatePoint","fromLngLat","projMatrix","constraining","sy","sx","x2","y2","s","unproject","h2","w2","halfFov","offset","centerOffset","groundAngle","fovAboveCenter","topHalfSurfaceDistance","sin","furthestDistance","cos","farZ","nearZ","m","perspective","translate","rotateX","rotateZ","invProjMatrix","invert","xShift","yShift","angleCos","angleSin","dx","dy","alignedM","alignedProjMatrix","labelPlaneMatrix","glCoordMatrix","multiply","Error"],"mappings":";;;;;;;;;;AACA,SAASA,IAAT,EAAeC,IAAf,EAAqBC,IAArB,EAA2BC,IAA3B,QAAuC,WAAvC;AACA,OAAOC,KAAP,MAAiC,cAAjC;AACA,SAASC,KAAT,EAAgBC,WAAhB,EAA6BC,IAA7B,QAAyC,SAAzC;AAGA,OAAOC,UAAP,MAA4C,eAA5C;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,kBAAP,IACEC,gBADF,EAEEC,gBAFF,EAGEC,qBAHF,QAIO,YAJP;AAKA,OAAO,IAAMC,MAAM,GAAG,IAAf;;IACcC,S;AAoNnB,qBACEC,OADF,EAEEC,OAFF,EAGEC,QAHF,EAIEC,QAJF,EAKEC,iBALF,EAME;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AA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AAL,EAAQ,CAAR,CAArB;AACA,WAAKe,gBAAL,GAAwBf,CAAxB;AAEAA,MAAAA,CAAC,GAAGlK,IAAI,CAACuD,MAAL,EAAJ;AACAvD,MAAAA,IAAI,CAAC6C,KAAL,CAAWqH,CAAX,EAAcA,CAAd,EAAiB,CAAC,CAAD,EAAI,CAAC,CAAL,EAAQ,CAAR,CAAjB;AACAlK,MAAAA,IAAI,CAACoK,SAAL,CAAeF,CAAf,EAAkBA,CAAlB,EAAqB,CAAC,CAAC,CAAF,EAAK,CAAC,CAAN,EAAS,CAAT,CAArB;AACAlK,MAAAA,IAAI,CAAC6C,KAAL,CAAWqH,CAAX,EAAcA,CAAd,EAAiB,CAAC,IAAI,KAAKpI,KAAV,EAAiB,IAAI,KAAKC,MAA1B,EAAkC,CAAlC,CAAjB;AACA,WAAKmJ,aAAL,GAAqBhB,CAArB;AAGA,WAAKpC,WAAL,GAAmB9H,IAAI,CAACmL,QAAL,CACjBnL,IAAI,CAACuD,MAAL,EADiB,EAEjB,KAAK0H,gBAFY,EAGjB,KAAKpC,UAHY,CAAnB;AAOAqB,MAAAA,CAAC,GAAGlK,IAAI,CAACwK,MAAL,CAAYxK,IAAI,CAACuD,MAAL,EAAZ,EAA2B,KAAKuE,WAAhC,CAAJ;;AACA,UAAI,CAACoC,CAAL,EAAQ;AACN,cAAM,IAAIkB,KAAJ,CAAU,yBAAV,CAAN;AACD;;AACD,WAAK5E,kBAAL,GAA0B0D,CAA1B;AAEA,WAAK3H,cAAL,GAAsB,EAAtB;AACA,WAAKC,qBAAL,GAA6B,EAA7B;AACD;;;;;;SA5+BkBzB,S","sourcesContent":["// @ts-ignore\nimport { mat2, mat4, vec3, vec4 } from 'gl-matrix';\nimport Point, { PointLike } from '../geo/point';\nimport { clamp, interpolate, wrap } from '../util';\nimport Aabb from '../utils/Aabb';\nimport Frustum from '../utils/primitives';\nimport EdgeInsets, { IPaddingOptions } from './edge_insets';\nimport LngLat from './lng_lat';\nimport LngLatBounds from './lng_lat_bounds';\nimport MercatorCoordinate, {\n mercatorXfromLng,\n mercatorYfromLat,\n mercatorZfromAltitude,\n} from './mercator';\nexport const EXTENT = 8192;\nexport default class Transform {\n get minZoom(): number {\n return this._minZoom;\n }\n set minZoom(zoom: number) {\n if (this._minZoom === zoom) {\n return;\n }\n this._minZoom = zoom;\n this.zoom = Math.max(this.zoom, zoom);\n }\n\n get maxZoom(): number {\n return this._maxZoom;\n }\n set maxZoom(zoom: number) {\n if (this._maxZoom === zoom) {\n return;\n }\n this._maxZoom = zoom;\n this.zoom = Math.min(this.zoom, zoom);\n }\n\n get minPitch(): number {\n return this._minPitch;\n }\n set minPitch(pitch: number) {\n if (this._minPitch === pitch) {\n return;\n }\n this._minPitch = pitch;\n this._pitch = Math.max(this._pitch, pitch);\n }\n\n get maxPitch(): number {\n return this._maxPitch;\n }\n set maxPitch(pitch: number) {\n if (this._maxPitch === pitch) {\n return;\n }\n this._maxPitch = pitch;\n this._pitch = Math.min(this._pitch, pitch);\n }\n\n get renderWorldCopies(): boolean {\n return this._renderWorldCopies;\n }\n set renderWorldCopies(renderWorldCopies: boolean) {\n if (renderWorldCopies === undefined) {\n renderWorldCopies = true;\n } else if (renderWorldCopies === null) {\n renderWorldCopies = false;\n }\n\n this._renderWorldCopies = renderWorldCopies;\n }\n\n get worldSize(): number {\n return this.tileSize * this.scale;\n }\n\n get centerOffset(): Point {\n return this.centerPoint._sub(this.size._div(2));\n }\n\n get size(): Point {\n return new Point(this.width, this.height);\n }\n\n get bearing(): number {\n return (-this.angle / Math.PI) * 180;\n }\n set bearing(bearing: number) {\n const b = (-wrap(bearing, -180, 180) * Math.PI) / 180;\n if (this.angle === b) {\n return;\n }\n this.unmodified = false;\n this.angle = b;\n this.calcMatrices();\n\n // 2x2 matrix for rotating points\n this.rotationMatrix = mat2.create();\n mat2.rotate(this.rotationMatrix, this.rotationMatrix, this.angle);\n }\n\n get pitch(): number {\n return (this._pitch / Math.PI) * 180;\n }\n set pitch(pitch: number) {\n const p = (clamp(pitch, this._minPitch, this._maxPitch) / 180) * Math.PI;\n if (this._pitch === p) {\n return;\n }\n this.unmodified = false;\n this._pitch = p;\n this.calcMatrices();\n }\n\n get fov(): number {\n return (this._fov / Math.PI) * 180;\n }\n\n set fov(fov: number) {\n fov = Math.max(0.01, Math.min(60, fov));\n if (this._fov === fov) {\n return;\n }\n this.unmodified = false;\n this._fov = (fov / 180) * Math.PI;\n this.calcMatrices();\n }\n\n get zoom(): number {\n return this._zoom;\n }\n\n set zoom(zoom: number) {\n const z = Math.min(Math.max(zoom, this._minZoom), this._maxZoom);\n if (this._zoom === z) {\n return;\n }\n this.unmodified = false;\n this._zoom = z;\n this.scale = this.zoomScale(z);\n this.tileZoom = Math.floor(z);\n this.zoomFraction = z - this.tileZoom;\n this.constrain();\n this.calcMatrices();\n }\n\n get center(): LngLat {\n return this._center;\n }\n\n set center(center: LngLat) {\n if (center.lat === this._center.lat && center.lng === this._center.lng) {\n return;\n }\n this.unmodified = false;\n this._center = center;\n this.constrain();\n this.calcMatrices();\n }\n\n get padding(): IPaddingOptions {\n return this.edgeInsets.toJSON();\n }\n\n set padding(padding: IPaddingOptions) {\n if (this.edgeInsets.equals(padding)) {\n return;\n }\n this.unmodified = false;\n // Update edge-insets inplace\n this.edgeInsets.interpolate(this.edgeInsets, padding, 1);\n this.calcMatrices();\n }\n\n /**\n * The center of the screen in pixels with the top-left corner being (0,0)\n * and +y axis pointing downwards. This accounts for padding.\n *\n * @readonly\n * @type {Point}\n * @memberof Transform\n */\n get centerPoint(): Point {\n return this.edgeInsets.getCenter(this.width, this.height);\n }\n\n get point(): Point {\n return this.project(this.center);\n }\n public tileSize: number;\n public tileZoom: number;\n public lngRange?: [number, number];\n public latRange?: [number, number];\n public maxValidLatitude: number;\n public scale: number;\n public width: number;\n public height: number;\n public angle: number;\n public rotationMatrix: mat2;\n public pixelsToGLUnits: [number, number];\n public cameraToCenterDistance: number;\n public mercatorMatrix: mat4;\n public projMatrix: mat4;\n public invProjMatrix: mat4;\n public alignedProjMatrix: mat4;\n public pixelMatrix: mat4;\n public pixelMatrixInverse: mat4;\n public glCoordMatrix: mat4;\n public labelPlaneMatrix: mat4;\n // tslint:disable:variable-name\n private _fov: number;\n private _pitch: number;\n private _zoom: number;\n private _renderWorldCopies: boolean;\n private _minZoom: number;\n private _maxZoom: number;\n private _minPitch: number;\n private _maxPitch: number;\n private _center: LngLat;\n // tslint:enable\n private zoomFraction: number;\n private unmodified: boolean;\n private edgeInsets: EdgeInsets;\n private constraining: boolean;\n private posMatrixCache: { [_: string]: Float32Array };\n private alignedPosMatrixCache: { [_: string]: Float32Array };\n constructor(\n minZoom: number,\n maxZoom: number,\n minPitch: number,\n maxPitch: number,\n renderWorldCopies: boolean | void,\n ) {\n this.tileSize = 512; // constant\n this.maxValidLatitude = 85.051129; // constant\n\n this._renderWorldCopies = (renderWorldCopies === undefined\n ? true\n : renderWorldCopies) as boolean;\n this._minZoom = minZoom || 0;\n this._maxZoom = maxZoom || 22;\n\n this._minPitch = minPitch === undefined || minPitch === null ? 0 : minPitch;\n this._maxPitch =\n maxPitch === undefined || maxPitch === null ? 60 : maxPitch;\n\n this.setMaxBounds();\n\n this.width = 0;\n this.height = 0;\n this._center = new LngLat(0, 0);\n this.zoom = 0;\n this.angle = 0;\n this._fov = 0.6435011087932844;\n this._pitch = 0;\n this.unmodified = true;\n this.edgeInsets = new EdgeInsets();\n this.posMatrixCache = {};\n this.alignedPosMatrixCache = {};\n }\n\n public clone(): Transform {\n const clone = new Transform(\n this._minZoom,\n this._maxZoom,\n this._minPitch,\n this._maxPitch,\n this._renderWorldCopies,\n );\n clone.tileSize = this.tileSize;\n clone.latRange = this.latRange;\n clone.width = this.width;\n clone.height = this.height;\n clone.center = this._center;\n clone.zoom = this.zoom;\n clone.angle = this.angle;\n clone.fov = this._fov;\n clone.pitch = this._pitch;\n clone.unmodified = this.unmodified;\n clone.edgeInsets = this.edgeInsets.clone();\n clone.calcMatrices();\n return clone;\n }\n\n /**\n * Returns if the padding params match\n *\n * @param {IPaddingOptions} padding\n * @returns {boolean}\n * @memberof Transform\n */\n public isPaddingEqual(padding: IPaddingOptions): boolean {\n return this.edgeInsets.equals(padding);\n }\n\n /**\n * Helper method to upadte edge-insets inplace\n *\n * @param {IPaddingOptions} target\n * @param {number} t\n * @memberof Transform\n */\n public interpolatePadding(\n start: IPaddingOptions,\n target: IPaddingOptions,\n t: number,\n ) {\n this.unmodified = false;\n this.edgeInsets.interpolate(start, target, t);\n this.constrain();\n this.calcMatrices();\n }\n\n /**\n * Return a zoom level that will cover all tiles the transform\n * @param {Object} options options\n * @param {number} options.tileSize Tile size, expressed in screen pixels.\n * @param {boolean} options.roundZoom Target zoom level. If true, the value will be rounded to the closest integer. Otherwise the value will be floored.\n * @returns {number} zoom level An integer zoom level at which all tiles will be visible.\n */\n public coveringZoomLevel(options: { roundZoom?: boolean; tileSize: number }) {\n const z = (options.roundZoom ? Math.round : Math.floor)(\n this.zoom + this.scaleZoom(this.tileSize / options.tileSize),\n );\n // At negative zoom levels load tiles from z0 because negative tile zoom levels don't exist.\n return Math.max(0, z);\n }\n\n /**\n * Return any \"wrapped\" copies of a given tile coordinate that are visible\n * in the current view.\n *\n * @private\n */\n // public getVisibleUnwrappedCoordinates(tileID: CanonicalTileID) {\n // const result = [new UnwrappedTileID(0, tileID)];\n // if (this._renderWorldCopies) {\n // const utl = this.pointCoordinate(new Point(0, 0));\n // const utr = this.pointCoordinate(new Point(this.width, 0));\n // const ubl = this.pointCoordinate(new Point(this.width, this.height));\n // const ubr = this.pointCoordinate(new Point(0, this.height));\n // const w0 = Math.floor(Math.min(utl.x, utr.x, ubl.x, ubr.x));\n // const w1 = Math.floor(Math.max(utl.x, utr.x, ubl.x, ubr.x));\n\n // // Add an extra copy of the world on each side to properly render ImageSources and CanvasSources.\n // // Both sources draw outside the tile boundaries of the tile that \"contains them\" so we need\n // // to add extra copies on both sides in case offscreen tiles need to draw into on-screen ones.\n // const extraWorldCopy = 1;\n\n // for (let w = w0 - extraWorldCopy; w <= w1 + extraWorldCopy; w++) {\n // if (w === 0) {\n // continue;\n // }\n // result.push(new UnwrappedTileID(w, tileID));\n // }\n // }\n // return result;\n // }\n\n /**\n * Return all coordinates that could cover this transform for a covering\n * zoom level.\n * @param {Object} options\n * @param {number} options.tileSize\n * @param {number} options.minzoom\n * @param {number} options.maxzoom\n * @param {boolean} options.roundZoom\n * @param {boolean} options.reparseOverscaled\n * @param {boolean} options.renderWorldCopies\n * @returns {Array<OverscaledTileID>} OverscaledTileIDs\n * @private\n */\n // public coveringTiles(options: {\n // tileSize: number;\n // minzoom?: number;\n // maxzoom?: number;\n // roundZoom?: boolean;\n // reparseOverscaled?: boolean;\n // renderWorldCopies?: boolean;\n // }): OverscaledTileID[] {\n // let z = this.coveringZoomLevel(options);\n // const actualZ = z;\n\n // if (options.minzoom !== undefined && z < options.minzoom) {\n // return [];\n // }\n // if (options.maxzoom !== undefined && z > options.maxzoom) {\n // z = options.maxzoom;\n // }\n\n // const centerCoord = MercatorCoordinate.fromLngLat(this.center);\n // const numTiles = Math.pow(2, z);\n // const centerPoint = [numTiles * centerCoord.x, numTiles * centerCoord.y, 0];\n // const cameraFrustum = Frustum.fromInvProjectionMatrix(\n // this.invProjMatrix,\n // this.worldSize,\n // z,\n // );\n\n // // No change of LOD behavior for pitch lower than 60 and when there is no top padding: return only tile ids from the requested zoom level\n // let minZoom = options.minzoom || 0;\n // // Use 0.1 as an epsilon to avoid for explicit == 0.0 floating point checks\n // if (this._pitch <= 60.0 && this.edgeInsets.top < 0.1) {\n // minZoom = z;\n // }\n\n // // There should always be a certain number of maximum zoom level tiles surrounding the center location\n // const radiusOfMaxLvlLodInTiles = 3;\n\n // const newRootTile = (wrap: number): any => {\n // return {\n // // All tiles are on zero elevation plane => z difference is zero\n // aabb: new Aabb(\n // [wrap * numTiles, 0, 0],\n // [(wrap + 1) * numTiles, numTiles, 0],\n // ),\n // zoom: 0,\n // x: 0,\n // y: 0,\n // wrap,\n // fullyVisible: false,\n // };\n // };\n\n // // Do a depth-first traversal to find visible tiles and proper levels of detail\n // const stack = [];\n // const result = [];\n // const maxZoom = z;\n // const overscaledZ = options.reparseOverscaled ? actualZ : z;\n\n // if (this._renderWorldCopies) {\n // // Render copy of the globe thrice on both sides\n // for (let i = 1; i <= 3; i++) {\n // stack.push(newRootTile(-i));\n // stack.push(newRootTile(i));\n // }\n // }\n\n // stack.push(newRootTile(0));\n\n // while (stack.length > 0) {\n // const it = stack.pop();\n // const x = it.x;\n // const y = it.y;\n // let fullyVisible = it.fullyVisible;\n\n // // Visibility of a tile is not required if any of its ancestor if fully inside the frustum\n // if (!fullyVisible) {\n // const intersectResult = it.aabb.intersects(cameraFrustum);\n\n // if (intersectResult === 0) {\n // continue;\n // }\n\n // fullyVisible = intersectResult === 2;\n // }\n\n // const distanceX = it.aabb.distanceX(centerPoint);\n // const distanceY = it.aabb.distanceY(centerPoint);\n // const longestDim = Math.max(Math.abs(distanceX), Math.abs(distanceY));\n\n // // We're using distance based heuristics to determine if a tile should be split into quadrants or not.\n // // radiusOfMaxLvlLodInTiles defines that there's always a certain number of maxLevel tiles next to the map center.\n // // Using the fact that a parent node in quadtree is twice the size of its children (per dimension)\n // // we can define distance thresholds for each relative level:\n // // f(k) = offset + 2 + 4 + 8 + 16 + ... + 2^k. This is the same as \"offset+2^(k+1)-2\"\n // const distToSplit =\n // radiusOfMaxLvlLodInTiles + (1 << (maxZoom - it.zoom)) - 2;\n\n // // Have we reached the target depth or is the tile too far away to be any split further?\n // if (\n // it.zoom === maxZoom ||\n // (longestDim > distToSplit && it.zoom >= minZoom)\n // ) {\n // result.push({\n // tileID: new OverscaledTileID(\n // it.zoom === maxZoom ? overscaledZ : it.zoom,\n // it.wrap,\n // it.zoom,\n // x,\n // y,\n // ),\n // distanceSq: vec2.sqrLen([\n // centerPoint[0] - 0.5 - x,\n // centerPoint[1] - 0.5 - y,\n // ]),\n // });\n // continue;\n // }\n\n // for (let i = 0; i < 4; i++) {\n // const childX = (x << 1) + (i % 2);\n // const childY = (y << 1) + (i >> 1);\n\n // stack.push({\n // aabb: it.aabb.quadrant(i),\n // zoom: it.zoom + 1,\n // x: childX,\n // y: childY,\n // wrap: it.wrap,\n // fullyVisible,\n // });\n // }\n // }\n\n // return result\n // .sort((a, b) => a.distanceSq - b.distanceSq)\n // .map((a) => a.tileID);\n // }\n\n public resize(width: number, height: number) {\n this.width = width;\n this.height = height;\n\n this.pixelsToGLUnits = [2 / width, -2 / height];\n this.constrain();\n this.calcMatrices();\n }\n\n public zoomScale(zoom: number) {\n return Math.pow(2, zoom);\n }\n public scaleZoom(scale: number) {\n return Math.log(scale) / Math.LN2;\n }\n\n public project(lnglat: LngLat) {\n const lat = clamp(\n lnglat.lat,\n -this.maxValidLatitude,\n this.maxValidLatitude,\n );\n return new Point(\n mercatorXfromLng(lnglat.lng) * this.worldSize,\n mercatorYfromLat(lat) * this.worldSize,\n );\n }\n\n public unproject(point: Point): LngLat {\n return new MercatorCoordinate(\n point.x / this.worldSize,\n point.y / this.worldSize,\n ).toLngLat();\n }\n\n public setLocationAtPoint(lnglat: LngLat, point: Point) {\n const a = this.pointCoordinate(point);\n const b = this.pointCoordinate(this.centerPoint);\n const loc = this.locationCoordinate(lnglat);\n const newCenter = new MercatorCoordinate(\n loc.x - (a.x - b.x),\n loc.y - (a.y - b.y),\n );\n this.center = this.coordinateLocation(newCenter);\n if (this._renderWorldCopies) {\n this.center = this.center.wrap();\n }\n }\n\n public pointCoordinate(p: Point) {\n const targetZ = 0;\n // since we don't know the correct projected z value for the point,\n // unproject two points to get a line and then find the point on that\n // line with z=0\n\n const coord0 = new Float32Array([p.x, p.y, 0, 1]);\n const coord1 = new Float32Array([p.x, p.y, 1, 1]);\n\n vec4.transformMat4(coord0, coord0, this.pixelMatrixInverse);\n vec4.transformMat4(coord1, coord1, this.pixelMatrixInverse);\n\n const w0 = coord0[3];\n const w1 = coord1[3];\n const x0 = coord0[0] / w0;\n const x1 = coord1[0] / w1;\n const y0 = coord0[1] / w0;\n const y1 = coord1[1] / w1;\n const z0 = coord0[2] / w0;\n const z1 = coord1[2] / w1;\n\n const t = z0 === z1 ? 0 : (targetZ - z0) / (z1 - z0);\n\n return new MercatorCoordinate(\n interpolate(x0, x1, t) / this.worldSize,\n interpolate(y0, y1, t) / this.worldSize,\n );\n }\n\n /**\n * Returns the map's geographical bounds. When the bearing or pitch is non-zero, the visible region is not\n * an axis-aligned rectangle, and the result is the smallest bounds that encompasses the visible region.\n * @returns {LngLatBounds} Returns a {@link LngLatBounds} object describing the map's geographical bounds.\n */\n public getBounds(): LngLatBounds {\n return new LngLatBounds()\n .extend(this.pointLocation(new Point(0, 0)))\n .extend(this.pointLocation(new Point(this.width, 0)))\n .extend(this.pointLocation(new Point(this.width, this.height)))\n .extend(this.pointLocation(new Point(0, this.height)));\n }\n\n /**\n * Returns the maximum geographical bounds the map is constrained to, or `null` if none set.\n * @returns {LngLatBounds} {@link LngLatBounds}\n */\n public getMaxBounds(): LngLatBounds | null {\n if (\n !this.latRange ||\n this.latRange.length !== 2 ||\n !this.lngRange ||\n this.lngRange.length !== 2\n ) {\n return null;\n }\n\n return new LngLatBounds(\n [this.lngRange[0], this.latRange[0]],\n [this.lngRange[1], this.latRange[1]],\n );\n }\n\n /**\n * Sets or clears the map's geographical constraints.\n * @param {LngLatBounds} bounds A {@link LngLatBounds} object describing the new geographic boundaries of the map.\n */\n public setMaxBounds(bounds?: LngLatBounds) {\n if (bounds) {\n this.lngRange = [bounds.getWest(), bounds.getEast()];\n this.latRange = [bounds.getSouth(), bounds.getNorth()];\n this.constrain();\n } else {\n this.lngRange = undefined;\n this.latRange = [-this.maxValidLatitude, this.maxValidLatitude];\n }\n }\n\n public customLayerMatrix(): number[] {\n return (this.mercatorMatrix as number[]).slice();\n }\n\n public maxPitchScaleFactor() {\n // calcMatrices hasn't run yet\n if (!this.pixelMatrixInverse) {\n return 1;\n }\n\n const coord = this.pointCoordinate(new Point(0, 0));\n const p = new Float32Array([\n coord.x * this.worldSize,\n coord.y * this.worldSize,\n 0,\n 1,\n ]);\n const topPoint = vec4.transformMat4(p, p, this.pixelMatrix);\n return topPoint[3] / this.cameraToCenterDistance;\n }\n\n /*\n * The camera looks at the map from a 3D (lng, lat, altitude) location. Let's use `cameraLocation`\n * as the name for the location under the camera and on the surface of the earth (lng, lat, 0).\n * `cameraPoint` is the projected position of the `cameraLocation`.\n *\n * This point is useful to us because only fill-extrusions that are between `cameraPoint` and\n * the query point on the surface of the earth can extend and intersect the query.\n *\n * When the map is not pitched the `cameraPoint` is equivalent to the center of the map because\n * the camera is right above the center of the map.\n */\n public getCameraPoint() {\n const pitch = this._pitch;\n const yOffset = Math.tan(pitch) * (this.cameraToCenterDistance || 1);\n return this.centerPoint.add(new Point(0, yOffset));\n }\n\n /*\n * When the map is pitched, some of the 3D features that intersect a query will not intersect\n * the query at the surface of the earth. Instead the feature may be closer and only intersect\n * the query because it extrudes into the air.\n *\n * This returns a geometry that includes all of the original query as well as all possible ares of the\n * screen where the *base* of a visible extrusion could be.\n * - For point queries, the line from the query point to the \"camera point\"\n * - For other geometries, the envelope of the query geometry and the \"camera point\"\n */\n public getCameraQueryGeometry(queryGeometry: Point[]): Point[] {\n const c = this.getCameraPoint();\n\n if (queryGeometry.length === 1) {\n return [queryGeometry[0], c];\n } else {\n let minX = c.x;\n let minY = c.y;\n let maxX = c.x;\n let maxY = c.y;\n for (const p of queryGeometry) {\n minX = Math.min(minX, p.x);\n minY = Math.min(minY, p.y);\n maxX = Math.max(maxX, p.x);\n maxY = Math.max(maxY, p.y);\n }\n return [\n new Point(minX, minY),\n new Point(maxX, minY),\n new Point(maxX, maxY),\n new Point(minX, maxY),\n new Point(minX, minY),\n ];\n }\n }\n\n /**\n * Given a coordinate, return the screen point that corresponds to it\n * @param {Coordinate} coord\n * @returns {Point} screen point\n * @private\n */\n public coordinatePoint(coord: MercatorCoordinate) {\n const p = vec4.fromValues(\n coord.x * this.worldSize,\n coord.y * this.worldSize,\n 0,\n 1,\n );\n vec4.transformMat4(p, p, this.pixelMatrix);\n return new Point(p[0] / p[3], p[1] / p[3]);\n }\n /**\n * Given a location, return the screen point that corresponds to it\n * @param {LngLat} lnglat location\n * @returns {Point} screen point\n * @private\n */\n public locationPoint(lnglat: LngLat) {\n return this.coordinatePoint(this.locationCoordinate(lnglat));\n }\n\n /**\n * Given a point on screen, return its lnglat\n * @param {Point} p screen point\n * @returns {LngLat} lnglat location\n * @private\n */\n public pointLocation(p: Point) {\n return this.coordinateLocation(this.pointCoordinate(p));\n }\n\n /**\n * Given a geographical lnglat, return an unrounded\n * coordinate that represents it at this transform's zoom level.\n * @param {LngLat} lnglat\n * @returns {Coordinate}\n * @private\n */\n public locationCoordinate(lnglat: LngLat) {\n return MercatorCoordinate.fromLngLat(lnglat);\n }\n\n /**\n * Given a Coordinate, return its geographical position.\n * @param {Coordinate} coord\n * @returns {LngLat} lnglat\n * @private\n */\n public coordinateLocation(coord: MercatorCoordinate) {\n return coord.toLngLat();\n }\n\n public getProjectionMatrix(): mat4 {\n return this.projMatrix;\n }\n /**\n * Calculate the posMatrix that, given a tile coordinate, would be used to display the tile on a map.\n * @param {UnwrappedTileID} unwrappedTileID;\n * @private\n */\n // private calculatePosMatrix(\n // unwrappedTileID: UnwrappedTileID,\n // aligned: boolean = false,\n // ): Float32Array {\n // const posMatrixKey = unwrappedTileID.key;\n // const cache = aligned ? this.alignedPosMatrixCache : this.posMatrixCache;\n // if (cache[posMatrixKey]) {\n // return cache[posMatrixKey];\n // }\n\n // const canonical = unwrappedTileID.canonical;\n // const scale = this.worldSize / this.zoomScale(canonical.z);\n // const unwrappedX =\n // canonical.x + Math.pow(2, canonical.z) * unwrappedTileID.wrap;\n\n // const posMatrix = mat4.identity(new Float64Array(16));\n // mat4.translate(posMatrix, posMatrix, [\n // unwrappedX * scale,\n // canonical.y * scale,\n // 0,\n // ]);\n // mat4.scale(posMatrix, posMatrix, [scale / EXTENT, scale / EXTENT, 1]);\n // mat4.multiply(\n // posMatrix,\n // aligned ? this.alignedProjMatrix : this.projMatrix,\n // posMatrix,\n // );\n\n // cache[posMatrixKey] = new Float32Array(posMatrix);\n // return cache[posMatrixKey];\n // }\n\n private constrain() {\n if (!this.center || !this.width || !this.height || this.constraining) {\n return;\n }\n\n this.constraining = true;\n\n let minY = -90;\n let maxY = 90;\n let minX = -180;\n let maxX = 180;\n let sy;\n let sx;\n let x2;\n let y2;\n const size = this.size;\n const unmodified = this.unmodified;\n\n if (this.latRange) {\n const latRange = this.latRange;\n minY = mercatorYfromLat(latRange[1]) * this.worldSize;\n maxY = mercatorYfromLat(latRange[0]) * this.worldSize;\n sy = maxY - minY < size.y ? size.y / (maxY - minY) : 0;\n }\n\n if (this.lngRange) {\n const lngRange = this.lngRange;\n minX = mercatorXfromLng(lngRange[0]) * this.worldSize;\n maxX = mercatorXfromLng(lngRange[1]) * this.worldSize;\n sx = maxX - minX < size.x ? size.x / (maxX - minX) : 0;\n }\n\n const point = this.point;\n\n // how much the map should scale to fit the screen into given latitude/longitude ranges\n const s = Math.max(sx || 0, sy || 0);\n\n if (s) {\n this.center = this.unproject(\n new Point(\n sx ? (maxX + minX) / 2 : point.x,\n sy ? (maxY + minY) / 2 : point.y,\n ),\n );\n this.zoom += this.scaleZoom(s);\n this.unmodified = unmodified;\n this.constraining = false;\n return;\n }\n\n if (this.latRange) {\n const y = point.y;\n const h2 = size.y / 2;\n\n if (y - h2 < minY) {\n y2 = minY + h2;\n }\n if (y + h2 > maxY) {\n y2 = maxY - h2;\n }\n }\n\n if (this.lngRange) {\n const x = point.x;\n const w2 = size.x / 2;\n\n if (x - w2 < minX) {\n x2 = minX + w2;\n }\n if (x + w2 > maxX) {\n x2 = maxX - w2;\n }\n }\n\n // pan the map if the screen goes off the range\n if (x2 !== undefined || y2 !== undefined) {\n this.center = this.unproject(\n new Point(\n x2 !== undefined ? x2 : point.x,\n y2 !== undefined ? y2 : point.y,\n ),\n );\n }\n\n this.unmodified = unmodified;\n this.constraining = false;\n }\n\n private calcMatrices() {\n if (!this.height) {\n return;\n }\n\n const halfFov = this._fov / 2;\n const offset = this.centerOffset;\n this.cameraToCenterDistance = (0.5 / Math.tan(halfFov)) * this.height;\n\n // Find the distance from the center point [width/2 + offset.x, height/2 + offset.y] to the\n // center top point [width/2 + offset.x, 0] in Z units, using the law of sines.\n // 1 Z unit is equivalent to 1 horizontal px at the center of the map\n // (the distance between[width/2, height/2] and [width/2 + 1, height/2])\n const groundAngle = Math.PI / 2 + this._pitch;\n const fovAboveCenter = this._fov * (0.5 + offset.y / this.height);\n const topHalfSurfaceDistance =\n (Math.sin(fovAboveCenter) * this.cameraToCenterDistance) /\n Math.sin(\n clamp(Math.PI - groundAngle - fovAboveCenter, 0.01, Math.PI - 0.01),\n );\n const point = this.point;\n const x = point.x;\n const y = point.y;\n\n // Calculate z distance of the farthest fragment that should be rendered.\n const furthestDistance =\n Math.cos(Math.PI / 2 - this._pitch) * topHalfSurfaceDistance +\n this.cameraToCenterDistance;\n // Add a bit extra to avoid precision problems when a fragment's distance is exactly `furthestDistance`\n const farZ = furthestDistance * 1.01;\n\n // The larger the value of nearZ is\n // - the more depth precision is available for features (good)\n // - clipping starts appearing sooner when the camera is close to 3d features (bad)\n //\n // Smaller values worked well for mapbox-gl-js but deckgl was encountering precision issues\n // when rendering it's layers using custom layers. This value was experimentally chosen and\n // seems to solve z-fighting issues in deckgl while not clipping buildings too close to the camera.\n const nearZ = this.height / 50;\n\n // matrix for conversion from location to GL coordinates (-1 .. 1)\n let m = mat4.create();\n mat4.perspective(m, this._fov, this.width / this.height, nearZ, farZ);\n\n // Apply center of perspective offset\n m[8] = (-offset.x * 2) / this.width;\n m[9] = (offset.y * 2) / this.height;\n\n mat4.scale(m, m, [1, -1, 1]);\n mat4.translate(m, m, [0, 0, -this.cameraToCenterDistance]);\n mat4.rotateX(m, m, this._pitch);\n mat4.rotateZ(m, m, this.angle);\n mat4.translate(m, m, [-x, -y, 0]);\n\n // The mercatorMatrix can be used to transform points from mercator coordinates\n // ([0, 0] nw, [1, 1] se) to GL coordinates.\n this.mercatorMatrix = mat4.scale(mat4.create(), m, [\n this.worldSize,\n this.worldSize,\n this.worldSize,\n ]);\n // scale vertically to meters per pixel (inverse of ground resolution):\n\n mat4.scale(\n m,\n m,\n vec3.fromValues(\n 1,\n 1,\n mercatorZfromAltitude(1, this.center.lat) * this.worldSize,\n ),\n );\n\n this.projMatrix = m;\n this.invProjMatrix = mat4.invert(mat4.create(), this.projMatrix);\n\n // Make a second projection matrix that is aligned to a pixel grid for rendering raster tiles.\n // We're rounding the (floating point) x/y values to achieve to avoid rendering raster images to fractional\n // coordinates. Additionally, we adjust by half a pixel in either direction in case that viewport dimension\n // is an odd integer to preserve rendering to the pixel grid. We're rotating this shift based on the angle\n // of the transformation so that 0°, 90°, 180°, and 270° rasters are crisp, and adjust the shift so that\n // it is always <= 0.5 pixels.\n const xShift = (this.width % 2) / 2;\n const yShift = (this.height % 2) / 2;\n const angleCos = Math.cos(this.angle);\n const angleSin = Math.sin(this.angle);\n const dx = x - Math.round(x) + angleCos * xShift + angleSin * yShift;\n const dy = y - Math.round(y) + angleCos * yShift + angleSin * xShift;\n const alignedM = mat4.clone(m);\n mat4.translate(alignedM, alignedM, [\n dx > 0.5 ? dx - 1 : dx,\n dy > 0.5 ? dy - 1 : dy,\n 0,\n ]);\n this.alignedProjMatrix = alignedM;\n\n m = mat4.create();\n mat4.scale(m, m, [this.width / 2, -this.height / 2, 1]);\n mat4.translate(m, m, [1, -1, 0]);\n this.labelPlaneMatrix = m;\n\n m = mat4.create();\n mat4.scale(m, m, [1, -1, 1]);\n mat4.translate(m, m, [-1, -1, 0]);\n mat4.scale(m, m, [2 / this.width, 2 / this.height, 1]);\n this.glCoordMatrix = m;\n\n // matrix for conversion from location to screen coordinates\n this.pixelMatrix = mat4.multiply(\n mat4.create(),\n this.labelPlaneMatrix,\n this.projMatrix,\n );\n\n // inverse matrix for conversion from screen coordinaes to location\n m = mat4.invert(mat4.create(), this.pixelMatrix);\n if (!m) {\n throw new Error('failed to invert matrix');\n }\n this.pixelMatrixInverse = m;\n\n this.posMatrixCache = {};\n this.alignedPosMatrixCache = {};\n }\n}\n"],"file":"transform.js"}
@@ -1,34 +0,0 @@
1
- import { EarthMap } from '../earthmap';
2
- import Point from '../geo/point';
3
- import { Map } from '../map';
4
- export interface IHandlerResult {
5
- panDelta?: Point;
6
- zoomDelta?: number;
7
- bearingDelta?: number;
8
- pitchDelta?: number;
9
- around?: Point | null;
10
- pinchAround?: Point | null;
11
- cameraAnimation?: (map: Map | EarthMap) => any;
12
- originalEvent?: any;
13
- needsRenderFrame?: boolean;
14
- noInertia?: boolean;
15
- }
16
- export interface IHandler {
17
- touchstart?: (e: TouchEvent, points: Point[], mapTouches: Touch[]) => IHandlerResult | void;
18
- touchmove?: (e: TouchEvent, points: Point[], mapTouches: Touch[]) => IHandlerResult | void;
19
- touchend?: (e: TouchEvent, points: Point[], mapTouches: Touch[]) => IHandlerResult | void;
20
- touchcancel?: (e: TouchEvent, points: Point[], mapTouches: Touch[]) => IHandlerResult | void;
21
- mousedown?: (e: MouseEvent, point: Point) => IHandlerResult | void;
22
- mousemove?: (e: MouseEvent, point: Point) => IHandlerResult | void;
23
- mouseup?: (e: MouseEvent, point: Point) => IHandlerResult | void;
24
- dblclick?: (e: MouseEvent, point: Point) => IHandlerResult | void;
25
- wheel?: (e: WheelEvent, point: Point) => IHandlerResult | void;
26
- keydown?: (e: KeyboardEvent) => IHandlerResult | void;
27
- keyup?: (e: KeyboardEvent) => IHandlerResult | void;
28
- renderFrame?: () => IHandlerResult | void;
29
- enable(options?: any): void;
30
- disable(): void;
31
- isEnabled(): boolean;
32
- isActive(): boolean;
33
- reset(): void;
34
- }
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=IHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"IHandler.js"}
@@ -1,17 +0,0 @@
1
- import { EarthMap } from '../earthmap';
2
- import { Map } from '../map';
3
- export default class BlockableMapEventHandler {
4
- private map;
5
- private delayContextMenu;
6
- private contextMenuEvent;
7
- constructor(map: Map | EarthMap);
8
- reset(): void;
9
- mousemove(e: MouseEvent): void;
10
- mousedown(): void;
11
- mouseup(): void;
12
- contextmenu(e: MouseEvent): void;
13
- isEnabled(): boolean;
14
- isActive(): boolean;
15
- enable(): boolean;
16
- disable(): boolean;
17
- }
@@ -1,84 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- import { MapMouseEvent } from './events';
5
-
6
- var BlockableMapEventHandler = function () {
7
- function BlockableMapEventHandler(map) {
8
- _classCallCheck(this, BlockableMapEventHandler);
9
-
10
- _defineProperty(this, "map", void 0);
11
-
12
- _defineProperty(this, "delayContextMenu", void 0);
13
-
14
- _defineProperty(this, "contextMenuEvent", void 0);
15
-
16
- this.map = map;
17
- }
18
-
19
- _createClass(BlockableMapEventHandler, [{
20
- key: "reset",
21
- value: function reset() {
22
- this.delayContextMenu = false;
23
- delete this.contextMenuEvent;
24
- }
25
- }, {
26
- key: "mousemove",
27
- value: function mousemove(e) {
28
- this.map.emit(e.type, new MapMouseEvent(e.type, this.map, e));
29
- }
30
- }, {
31
- key: "mousedown",
32
- value: function mousedown() {
33
- this.delayContextMenu = true;
34
- }
35
- }, {
36
- key: "mouseup",
37
- value: function mouseup() {
38
- this.delayContextMenu = false;
39
-
40
- if (this.contextMenuEvent) {
41
- this.map.emit('contextmenu', new MapMouseEvent('contextmenu', this.map, this.contextMenuEvent));
42
- delete this.contextMenuEvent;
43
- }
44
- }
45
- }, {
46
- key: "contextmenu",
47
- value: function contextmenu(e) {
48
- if (this.delayContextMenu) {
49
- this.contextMenuEvent = e;
50
- } else {
51
- this.map.emit(e.type, new MapMouseEvent(e.type, this.map, e));
52
- }
53
-
54
- if (this.map.listeners('contextmenu')) {
55
- e.preventDefault();
56
- }
57
- }
58
- }, {
59
- key: "isEnabled",
60
- value: function isEnabled() {
61
- return true;
62
- }
63
- }, {
64
- key: "isActive",
65
- value: function isActive() {
66
- return false;
67
- }
68
- }, {
69
- key: "enable",
70
- value: function enable() {
71
- return true;
72
- }
73
- }, {
74
- key: "disable",
75
- value: function disable() {
76
- return false;
77
- }
78
- }]);
79
-
80
- return BlockableMapEventHandler;
81
- }();
82
-
83
- export { BlockableMapEventHandler as default };
84
- //# sourceMappingURL=blockable_map_event.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/handler/blockable_map_event.ts"],"names":["MapMouseEvent","BlockableMapEventHandler","map","delayContextMenu","contextMenuEvent","e","emit","type","listeners","preventDefault"],"mappings":";;;AAIA,SAASA,aAAT,QAA4D,UAA5D;;IACqBC,wB;AAKnB,oCAAYC,GAAZ,EAAiC;AAAA;;AAAA;;AAAA;;AAAA;;AAC/B,SAAKA,GAAL,GAAWA,GAAX;AACD;;;;WAED,iBAAe;AACb,WAAKC,gBAAL,GAAwB,KAAxB;AAEA,aAAO,KAAKC,gBAAZ;AACD;;;WAED,mBAAiBC,CAAjB,EAAgC;AAE9B,WAAKH,GAAL,CAASI,IAAT,CAAcD,CAAC,CAACE,IAAhB,EAAsB,IAAIP,aAAJ,CAAkBK,CAAC,CAACE,IAApB,EAA0B,KAAKL,GAA/B,EAAoCG,CAApC,CAAtB;AACD;;;WAED,qBAAmB;AACjB,WAAKF,gBAAL,GAAwB,IAAxB;AACD;;;WAED,mBAAiB;AACf,WAAKA,gBAAL,GAAwB,KAAxB;;AACA,UAAI,KAAKC,gBAAT,EAA2B;AACzB,aAAKF,GAAL,CAASI,IAAT,CACE,aADF,EAEE,IAAIN,aAAJ,CAAkB,aAAlB,EAAiC,KAAKE,GAAtC,EAA2C,KAAKE,gBAAhD,CAFF;AAKA,eAAO,KAAKA,gBAAZ;AACD;AACF;;;WACD,qBAAmBC,CAAnB,EAAkC;AAChC,UAAI,KAAKF,gBAAT,EAA2B;AAEzB,aAAKC,gBAAL,GAAwBC,CAAxB;AACD,OAHD,MAGO;AAEL,aAAKH,GAAL,CAASI,IAAT,CAAcD,CAAC,CAACE,IAAhB,EAAsB,IAAIP,aAAJ,CAAkBK,CAAC,CAACE,IAApB,EAA0B,KAAKL,GAA/B,EAAoCG,CAApC,CAAtB;AACD;;AAGD,UAAI,KAAKH,GAAL,CAASM,SAAT,CAAmB,aAAnB,CAAJ,EAAuC;AACrCH,QAAAA,CAAC,CAACI,cAAF;AACD;AACF;;;WAED,qBAAmB;AACjB,aAAO,IAAP;AACD;;;WAED,oBAAkB;AAChB,aAAO,KAAP;AACD;;;WACD,kBAAgB;AACd,aAAO,IAAP;AACD;;;WACD,mBAAiB;AACf,aAAO,KAAP;AACD;;;;;;SA9DkBR,wB","sourcesContent":["// @ts-ignore\nimport { EarthMap } from '../earthmap';\nimport Point from '../geo/point';\nimport { Map } from '../map';\nimport { MapMouseEvent, MapTouchEvent, MapWheelEvent } from './events';\nexport default class BlockableMapEventHandler {\n private map: Map | EarthMap;\n private delayContextMenu: boolean;\n private contextMenuEvent: MouseEvent;\n\n constructor(map: Map | EarthMap) {\n this.map = map;\n }\n\n public reset() {\n this.delayContextMenu = false;\n // @ts-ignore\n delete this.contextMenuEvent;\n }\n\n public mousemove(e: MouseEvent) {\n // mousemove map events should not be fired when interaction handlers (pan, rotate, etc) are active\n this.map.emit(e.type, new MapMouseEvent(e.type, this.map, e));\n }\n\n public mousedown() {\n this.delayContextMenu = true;\n }\n\n public mouseup() {\n this.delayContextMenu = false;\n if (this.contextMenuEvent) {\n this.map.emit(\n 'contextmenu',\n new MapMouseEvent('contextmenu', this.map, this.contextMenuEvent),\n );\n // @ts-ignore\n delete this.contextMenuEvent;\n }\n }\n public contextmenu(e: MouseEvent) {\n if (this.delayContextMenu) {\n // Mac: contextmenu fired on mousedown; we save it until mouseup for consistency's sake\n this.contextMenuEvent = e;\n } else {\n // Windows: contextmenu fired on mouseup, so fire event now\n this.map.emit(e.type, new MapMouseEvent(e.type, this.map, e));\n }\n\n // prevent browser context menu when necessary\n if (this.map.listeners('contextmenu')) {\n e.preventDefault();\n }\n }\n\n public isEnabled() {\n return true;\n }\n\n public isActive() {\n return false;\n }\n public enable() {\n return true;\n }\n public disable() {\n return false;\n }\n}\n"],"file":"blockable_map_event.js"}
@@ -1,59 +0,0 @@
1
- import { EarthMap } from '../earthmap';
2
- import Point from '../geo/point';
3
- import { Map } from '../map';
4
- /**
5
- * The `BoxZoomHandler` allows the user to zoom the map to fit within a bounding box.
6
- * The bounding box is defined by clicking and holding `shift` while dragging the cursor.
7
- */
8
- declare class BoxZoomHandler {
9
- private map;
10
- private el;
11
- private container;
12
- private enabled;
13
- private active;
14
- private startPos;
15
- private lastPos;
16
- private box;
17
- private clickTolerance;
18
- /**
19
- * @private
20
- */
21
- constructor(map: Map | EarthMap, options: {
22
- clickTolerance: number;
23
- });
24
- /**
25
- * Returns a Boolean indicating whether the "box zoom" interaction is enabled.
26
- *
27
- * @returns {boolean} `true` if the "box zoom" interaction is enabled.
28
- */
29
- isEnabled(): boolean;
30
- /**
31
- * Returns a Boolean indicating whether the "box zoom" interaction is active, i.e. currently being used.
32
- *
33
- * @returns {boolean} `true` if the "box zoom" interaction is active.
34
- */
35
- isActive(): boolean;
36
- /**
37
- * Enables the "box zoom" interaction.
38
- *
39
- * @example
40
- * map.boxZoom.enable();
41
- */
42
- enable(): void;
43
- /**
44
- * Disables the "box zoom" interaction.
45
- *
46
- * @example
47
- * map.boxZoom.disable();
48
- */
49
- disable(): void;
50
- mousedown(e: MouseEvent, point: Point): void;
51
- mousemoveWindow(e: MouseEvent, point: Point): void;
52
- mouseupWindow(e: MouseEvent, point: Point): {
53
- cameraAnimation: (map: Map) => boolean | Map;
54
- } | undefined;
55
- keydown(e: KeyboardEvent): void;
56
- reset(): void;
57
- fireEvent(type: string, e: any): boolean;
58
- }
59
- export default BoxZoomHandler;
@@ -1,184 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- import DOM from '../utils/dom';
5
- import { Event } from './events/event';
6
-
7
- var BoxZoomHandler = function () {
8
- function BoxZoomHandler(map, options) {
9
- _classCallCheck(this, BoxZoomHandler);
10
-
11
- _defineProperty(this, "map", void 0);
12
-
13
- _defineProperty(this, "el", void 0);
14
-
15
- _defineProperty(this, "container", void 0);
16
-
17
- _defineProperty(this, "enabled", void 0);
18
-
19
- _defineProperty(this, "active", void 0);
20
-
21
- _defineProperty(this, "startPos", void 0);
22
-
23
- _defineProperty(this, "lastPos", void 0);
24
-
25
- _defineProperty(this, "box", void 0);
26
-
27
- _defineProperty(this, "clickTolerance", void 0);
28
-
29
- this.map = map;
30
- this.el = map.getCanvasContainer();
31
- this.container = map.getContainer();
32
- this.clickTolerance = options.clickTolerance || 1;
33
- }
34
-
35
- _createClass(BoxZoomHandler, [{
36
- key: "isEnabled",
37
- value: function isEnabled() {
38
- return !!this.enabled;
39
- }
40
- }, {
41
- key: "isActive",
42
- value: function isActive() {
43
- return !!this.active;
44
- }
45
- }, {
46
- key: "enable",
47
- value: function enable() {
48
- if (this.isEnabled()) {
49
- return;
50
- }
51
-
52
- this.enabled = true;
53
- }
54
- }, {
55
- key: "disable",
56
- value: function disable() {
57
- if (!this.isEnabled()) {
58
- return;
59
- }
60
-
61
- this.enabled = false;
62
- }
63
- }, {
64
- key: "mousedown",
65
- value: function mousedown(e, point) {
66
- if (!this.isEnabled()) {
67
- return;
68
- }
69
-
70
- if (!(e.shiftKey && e.button === 0)) {
71
- return;
72
- }
73
-
74
- DOM.disableDrag();
75
- this.startPos = this.lastPos = point;
76
- this.active = true;
77
- }
78
- }, {
79
- key: "mousemoveWindow",
80
- value: function mousemoveWindow(e, point) {
81
- if (!this.active) {
82
- return;
83
- }
84
-
85
- var pos = point;
86
-
87
- if (this.lastPos.equals(pos) || !this.box && pos.dist(this.startPos) < this.clickTolerance) {
88
- return;
89
- }
90
-
91
- var p0 = this.startPos;
92
- this.lastPos = pos;
93
-
94
- if (!this.box) {
95
- this.box = DOM.create('div', 'l7-boxzoom', this.container);
96
- this.container.classList.add('l7-crosshair');
97
- this.fireEvent('boxzoomstart', e);
98
- }
99
-
100
- var minX = Math.min(p0.x, pos.x);
101
- var maxX = Math.max(p0.x, pos.x);
102
- var minY = Math.min(p0.y, pos.y);
103
- var maxY = Math.max(p0.y, pos.y);
104
- DOM.setTransform(this.box, "translate(".concat(minX, "px,").concat(minY, "px)"));
105
-
106
- if (this.box) {
107
- this.box.style.width = "".concat(maxX - minX, "px");
108
- this.box.style.height = "".concat(maxY - minY, "px");
109
- }
110
- }
111
- }, {
112
- key: "mouseupWindow",
113
- value: function mouseupWindow(e, point) {
114
- var _this = this;
115
-
116
- if (!this.active) {
117
- return;
118
- }
119
-
120
- if (e.button !== 0) {
121
- return;
122
- }
123
-
124
- var p0 = this.startPos;
125
- var p1 = point;
126
- this.reset();
127
- DOM.suppressClick();
128
-
129
- if (p0.x === p1.x && p0.y === p1.y) {
130
- this.fireEvent('boxzoomcancel', e);
131
- } else {
132
- this.map.emit('boxzoomend', new Event('boxzoomend', {
133
- originalEvent: e
134
- }));
135
- return {
136
- cameraAnimation: function cameraAnimation(map) {
137
- return map.fitScreenCoordinates(p0, p1, _this.map.getBearing(), {
138
- linear: true
139
- });
140
- }
141
- };
142
- }
143
- }
144
- }, {
145
- key: "keydown",
146
- value: function keydown(e) {
147
- if (!this.active) {
148
- return;
149
- }
150
-
151
- if (e.keyCode === 27) {
152
- this.reset();
153
- this.fireEvent('boxzoomcancel', e);
154
- }
155
- }
156
- }, {
157
- key: "reset",
158
- value: function reset() {
159
- this.active = false;
160
- this.container.classList.remove('l7-crosshair');
161
-
162
- if (this.box) {
163
- DOM.remove(this.box);
164
- this.box = null;
165
- }
166
-
167
- DOM.enableDrag();
168
- delete this.startPos;
169
- delete this.lastPos;
170
- }
171
- }, {
172
- key: "fireEvent",
173
- value: function fireEvent(type, e) {
174
- return this.map.emit(type, new Event(type, {
175
- originalEvent: e
176
- }));
177
- }
178
- }]);
179
-
180
- return BoxZoomHandler;
181
- }();
182
-
183
- export default BoxZoomHandler;
184
- //# sourceMappingURL=box_zoom.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/handler/box_zoom.ts"],"names":["DOM","Event","BoxZoomHandler","map","options","el","getCanvasContainer","container","getContainer","clickTolerance","enabled","active","isEnabled","e","point","shiftKey","button","disableDrag","startPos","lastPos","pos","equals","box","dist","p0","create","classList","add","fireEvent","minX","Math","min","x","maxX","max","minY","y","maxY","setTransform","style","width","height","p1","reset","suppressClick","emit","originalEvent","cameraAnimation","fitScreenCoordinates","getBearing","linear","keyCode","remove","enableDrag","type"],"mappings":";;;AAIA,OAAOA,GAAP,MAAgB,cAAhB;AACA,SAASC,KAAT,QAAsB,gBAAtB;;IAMMC,c;AAcJ,0BACEC,GADF,EAEEC,OAFF,EAKE;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AACA,SAAKD,GAAL,GAAWA,GAAX;AACA,SAAKE,EAAL,GAAUF,GAAG,CAACG,kBAAJ,EAAV;AACA,SAAKC,SAAL,GAAiBJ,GAAG,CAACK,YAAJ,EAAjB;AACA,SAAKC,cAAL,GAAsBL,OAAO,CAACK,cAAR,IAA0B,CAAhD;AACD;;;;WAOD,qBAAmB;AACjB,aAAO,CAAC,CAAC,KAAKC,OAAd;AACD;;;WAOD,oBAAkB;AAChB,aAAO,CAAC,CAAC,KAAKC,MAAd;AACD;;;WAQD,kBAAgB;AACd,UAAI,KAAKC,SAAL,EAAJ,EAAsB;AACpB;AACD;;AACD,WAAKF,OAAL,GAAe,IAAf;AACD;;;WAQD,mBAAiB;AACf,UAAI,CAAC,KAAKE,SAAL,EAAL,EAAuB;AACrB;AACD;;AACD,WAAKF,OAAL,GAAe,KAAf;AACD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8C,aAAxD,CADe;AAAA;AADZ,SAAP;AAMD;AACF;;;WAED,iBAAerC,CAAf,EAAiC;AAC/B,UAAI,CAAC,KAAKF,MAAV,EAAkB;AAChB;AACD;;AAED,UAAIE,CAAC,CAACsC,OAAF,KAAc,EAAlB,EAAsB;AACpB,aAAKR,KAAL;AACA,aAAKf,SAAL,CAAe,eAAf,EAAgCf,CAAhC;AACD;AACF;;;WAED,iBAAe;AACb,WAAKF,MAAL,GAAc,KAAd;AAEA,WAAKJ,SAAL,CAAemB,SAAf,CAAyB0B,MAAzB,CAAgC,cAAhC;;AAEA,UAAI,KAAK9B,GAAT,EAAc;AACZtB,QAAAA,GAAG,CAACoD,MAAJ,CAAW,KAAK9B,GAAhB;AACA,aAAKA,GAAL,GAAW,IAAX;AACD;;AAEDtB,MAAAA,GAAG,CAACqD,UAAJ;AAEA,aAAO,KAAKnC,QAAZ;AAEA,aAAO,KAAKC,OAAZ;AACD;;;WAED,mBAAiBmC,IAAjB,EAA+BzC,CAA/B,EAAuC;AACrC,aAAO,KAAKV,GAAL,CAAS0C,IAAT,CAAcS,IAAd,EAAoB,IAAIrD,KAAJ,CAAUqD,IAAV,EAAgB;AAAER,QAAAA,aAAa,EAAEjC;AAAjB,OAAhB,CAApB,CAAP;AACD;;;;;;AAGH,eAAeX,cAAf","sourcesContent":["// @ts-ignore\nimport { EarthMap } from '../earthmap';\nimport Point from '../geo/point';\nimport { Map } from '../map';\nimport DOM from '../utils/dom';\nimport { Event } from './events/event';\n\n/**\n * The `BoxZoomHandler` allows the user to zoom the map to fit within a bounding box.\n * The bounding box is defined by clicking and holding `shift` while dragging the cursor.\n */\nclass BoxZoomHandler {\n private map: Map | EarthMap;\n private el: HTMLElement;\n private container: HTMLElement;\n private enabled: boolean;\n private active: boolean;\n private startPos: Point;\n private lastPos: Point;\n private box: HTMLElement | null;\n private clickTolerance: number;\n\n /**\n * @private\n */\n constructor(\n map: Map | EarthMap,\n options: {\n clickTolerance: number;\n },\n ) {\n this.map = map;\n this.el = map.getCanvasContainer();\n this.container = map.getContainer();\n this.clickTolerance = options.clickTolerance || 1;\n }\n\n /**\n * Returns a Boolean indicating whether the \"box zoom\" interaction is enabled.\n *\n * @returns {boolean} `true` if the \"box zoom\" interaction is enabled.\n */\n public isEnabled() {\n return !!this.enabled;\n }\n\n /**\n * Returns a Boolean indicating whether the \"box zoom\" interaction is active, i.e. currently being used.\n *\n * @returns {boolean} `true` if the \"box zoom\" interaction is active.\n */\n public isActive() {\n return !!this.active;\n }\n\n /**\n * Enables the \"box zoom\" interaction.\n *\n * @example\n * map.boxZoom.enable();\n */\n public enable() {\n if (this.isEnabled()) {\n return;\n }\n this.enabled = true;\n }\n\n /**\n * Disables the \"box zoom\" interaction.\n *\n * @example\n * map.boxZoom.disable();\n */\n public disable() {\n if (!this.isEnabled()) {\n return;\n }\n this.enabled = false;\n }\n\n public mousedown(e: MouseEvent, point: Point) {\n if (!this.isEnabled()) {\n return;\n }\n if (!(e.shiftKey && e.button === 0)) {\n return;\n }\n\n DOM.disableDrag();\n this.startPos = this.lastPos = point;\n this.active = true;\n }\n\n public mousemoveWindow(e: MouseEvent, point: Point) {\n if (!this.active) {\n return;\n }\n\n const pos = point;\n\n if (\n this.lastPos.equals(pos) ||\n (!this.box && pos.dist(this.startPos) < this.clickTolerance)\n ) {\n return;\n }\n\n const p0 = this.startPos;\n this.lastPos = pos;\n\n if (!this.box) {\n this.box = DOM.create('div', 'l7-boxzoom', this.container);\n this.container.classList.add('l7-crosshair');\n this.fireEvent('boxzoomstart', e);\n }\n const minX = Math.min(p0.x, pos.x);\n const maxX = Math.max(p0.x, pos.x);\n const minY = Math.min(p0.y, pos.y);\n const maxY = Math.max(p0.y, pos.y);\n\n DOM.setTransform(this.box, `translate(${minX}px,${minY}px)`);\n if (this.box) {\n this.box.style.width = `${maxX - minX}px`;\n this.box.style.height = `${maxY - minY}px`;\n }\n }\n\n public mouseupWindow(e: MouseEvent, point: Point) {\n if (!this.active) {\n return;\n }\n\n if (e.button !== 0) {\n return;\n }\n\n const p0 = this.startPos;\n const p1 = point;\n\n this.reset();\n\n DOM.suppressClick();\n\n if (p0.x === p1.x && p0.y === p1.y) {\n this.fireEvent('boxzoomcancel', e);\n } else {\n this.map.emit(\n 'boxzoomend',\n new Event('boxzoomend', { originalEvent: e }),\n );\n return {\n cameraAnimation: (map: Map) =>\n map.fitScreenCoordinates(p0, p1, this.map.getBearing(), {\n linear: true,\n }),\n };\n }\n }\n\n public keydown(e: KeyboardEvent) {\n if (!this.active) {\n return;\n }\n\n if (e.keyCode === 27) {\n this.reset();\n this.fireEvent('boxzoomcancel', e);\n }\n }\n\n public reset() {\n this.active = false;\n\n this.container.classList.remove('l7-crosshair');\n\n if (this.box) {\n DOM.remove(this.box);\n this.box = null;\n }\n\n DOM.enableDrag();\n // @ts-ignore\n delete this.startPos;\n // @ts-ignore\n delete this.lastPos;\n }\n\n public fireEvent(type: string, e: any) {\n return this.map.emit(type, new Event(type, { originalEvent: e }));\n }\n}\n\nexport default BoxZoomHandler;\n"],"file":"box_zoom.js"}
@@ -1,16 +0,0 @@
1
- import { EarthMap } from '../earthmap';
2
- import Point from '../geo/point';
3
- import { Map } from '../map';
4
- export default class ClickZoomHandler {
5
- private enabled;
6
- private active;
7
- constructor();
8
- reset(): void;
9
- dblclick(e: MouseEvent, point: Point): {
10
- cameraAnimation: (map: Map | EarthMap) => void;
11
- };
12
- enable(): void;
13
- disable(): void;
14
- isEnabled(): boolean;
15
- isActive(): boolean;
16
- }
@@ -1,64 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
-
5
- var ClickZoomHandler = function () {
6
- function ClickZoomHandler() {
7
- _classCallCheck(this, ClickZoomHandler);
8
-
9
- _defineProperty(this, "enabled", void 0);
10
-
11
- _defineProperty(this, "active", void 0);
12
-
13
- this.reset();
14
- }
15
-
16
- _createClass(ClickZoomHandler, [{
17
- key: "reset",
18
- value: function reset() {
19
- this.active = false;
20
- }
21
- }, {
22
- key: "dblclick",
23
- value: function dblclick(e, point) {
24
- e.preventDefault();
25
- return {
26
- cameraAnimation: function cameraAnimation(map) {
27
- map.easeTo({
28
- duration: 300,
29
- zoom: map.getZoom() + (e.shiftKey ? -1 : 1),
30
- around: map.unproject(point)
31
- }, {
32
- originalEvent: e
33
- });
34
- }
35
- };
36
- }
37
- }, {
38
- key: "enable",
39
- value: function enable() {
40
- this.enabled = true;
41
- }
42
- }, {
43
- key: "disable",
44
- value: function disable() {
45
- this.enabled = false;
46
- this.reset();
47
- }
48
- }, {
49
- key: "isEnabled",
50
- value: function isEnabled() {
51
- return this.enabled;
52
- }
53
- }, {
54
- key: "isActive",
55
- value: function isActive() {
56
- return this.active;
57
- }
58
- }]);
59
-
60
- return ClickZoomHandler;
61
- }();
62
-
63
- export { ClickZoomHandler as default };
64
- //# sourceMappingURL=click_zoom.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/handler/click_zoom.ts"],"names":["ClickZoomHandler","reset","active","e","point","preventDefault","cameraAnimation","map","easeTo","duration","zoom","getZoom","shiftKey","around","unproject","originalEvent","enabled"],"mappings":";;;;IAKqBA,gB;AAInB,8BAAc;AAAA;;AAAA;;AAAA;;AACZ,SAAKC,KAAL;AACD;;;;WAED,iBAAe;AACb,WAAKC,MAAL,GAAc,KAAd;AACD;;;WAED,kBAAgBC,CAAhB,EAA+BC,KAA/B,EAA6C;AAC3CD,MAAAA,CAAC,CAACE,cAAF;AACA,aAAO;AACLC,QAAAA,eAAe,EAAE,yBAACC,GAAD,EAAyB;AACxCA,UAAAA,GAAG,CAACC,MAAJ,CACE;AACEC,YAAAA,QAAQ,EAAE,GADZ;AAEEC,YAAAA,IAAI,EAAEH,GAAG,CAACI,OAAJ,MAAiBR,CAAC,CAACS,QAAF,GAAa,CAAC,CAAd,GAAkB,CAAnC,CAFR;AAGEC,YAAAA,MAAM,EAAEN,GAAG,CAACO,SAAJ,CAAcV,KAAd;AAHV,WADF,EAME;AAAEW,YAAAA,aAAa,EAAEZ;AAAjB,WANF;AAQD;AAVI,OAAP;AAYD;;;WAED,kBAAgB;AACd,WAAKa,OAAL,GAAe,IAAf;AACD;;;WACD,mBAAiB;AACf,WAAKA,OAAL,GAAe,KAAf;AACA,WAAKf,KAAL;AACD;;;WAED,qBAAmB;AACjB,aAAO,KAAKe,OAAZ;AACD;;;WAED,oBAAkB;AAChB,aAAO,KAAKd,MAAZ;AACD;;;;;;SA1CkBF,gB","sourcesContent":["// @ts-ignore\nimport { EarthMap } from '../earthmap';\nimport Point from '../geo/point';\nimport { Map } from '../map';\n\nexport default class ClickZoomHandler {\n private enabled: boolean;\n private active: boolean;\n\n constructor() {\n this.reset();\n }\n\n public reset() {\n this.active = false;\n }\n\n public dblclick(e: MouseEvent, point: Point) {\n e.preventDefault();\n return {\n cameraAnimation: (map: Map | EarthMap) => {\n map.easeTo(\n {\n duration: 300,\n zoom: map.getZoom() + (e.shiftKey ? -1 : 1),\n around: map.unproject(point),\n },\n { originalEvent: e },\n );\n },\n };\n }\n\n public enable() {\n this.enabled = true;\n }\n public disable() {\n this.enabled = false;\n this.reset();\n }\n\n public isEnabled() {\n return this.enabled;\n }\n\n public isActive() {\n return this.active;\n }\n}\n"],"file":"click_zoom.js"}
@@ -1,4 +0,0 @@
1
- export declare class Event {
2
- type: string;
3
- constructor(type: string, data?: any);
4
- }