@openglobus/og 0.12.3 → 0.13.1

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 (93) hide show
  1. package/README.md +0 -2
  2. package/dist/@openglobus/og.esm.js +2 -2
  3. package/dist/@openglobus/og.esm.js.map +1 -1
  4. package/dist/@openglobus/og.umd.js +2 -2
  5. package/dist/@openglobus/og.umd.js.map +1 -1
  6. package/package.json +7 -7
  7. package/src/og/Extent.js +3 -3
  8. package/src/og/Globe.js +277 -275
  9. package/src/og/ImageCanvas.js +3 -3
  10. package/src/og/LonLat.js +9 -9
  11. package/src/og/QueueArray.js +2 -2
  12. package/src/og/Rectangle.js +5 -5
  13. package/src/og/bv/Box.js +1 -1
  14. package/src/og/bv/Sphere.js +2 -2
  15. package/src/og/camera/Camera.js +1 -1
  16. package/src/og/camera/PlanetCamera.js +649 -646
  17. package/src/og/control/LayerSwitcher.js +1 -1
  18. package/src/og/control/MouseNavigation.js +22 -13
  19. package/src/og/control/MouseWheelZoomControl.js +2 -2
  20. package/src/og/control/ScaleControl.js +1 -1
  21. package/src/og/control/TouchNavigation.js +319 -319
  22. package/src/og/control/ZoomControl.js +132 -132
  23. package/src/og/control/visibleExtent/Segment.js +12 -12
  24. package/src/og/ellipsoid/Ellipsoid.js +577 -567
  25. package/src/og/entity/BillboardHandler.js +878 -1051
  26. package/src/og/entity/Entity.js +1 -1
  27. package/src/og/entity/EntityCollection.js +847 -857
  28. package/src/og/entity/GeoObjectHandler.js +2 -2
  29. package/src/og/entity/LabelHandler.js +888 -1040
  30. package/src/og/entity/LabelWorker.js +0 -6
  31. package/src/og/entity/PointCloud.js +495 -495
  32. package/src/og/entity/Polyline.js +2218 -2222
  33. package/src/og/entity/RayHandler.js +1 -1
  34. package/src/og/layer/CanvasTiles.js +6 -3
  35. package/src/og/layer/GeoImage.js +1 -1
  36. package/src/og/layer/KML.js +5 -5
  37. package/src/og/layer/Layer.js +804 -752
  38. package/src/og/layer/Vector.js +997 -1010
  39. package/src/og/layer/XYZ.js +359 -357
  40. package/src/og/math/Line2.js +4 -4
  41. package/src/og/math/Quat.js +2 -2
  42. package/src/og/math/Ray.js +2 -2
  43. package/src/og/math/Vec2.js +524 -524
  44. package/src/og/math/Vec3.js +900 -900
  45. package/src/og/math/Vec4.js +261 -261
  46. package/src/og/math.js +397 -398
  47. package/src/og/quadTree/EntityCollectionNode.js +389 -387
  48. package/src/og/renderer/Renderer.js +14 -20
  49. package/src/og/renderer/RendererEvents.js +1034 -1045
  50. package/src/og/scene/Planet.js +12 -9
  51. package/src/og/scene/RenderNode.js +347 -354
  52. package/src/og/segment/Segment.js +3 -1
  53. package/src/og/segment/SegmentLonLat.js +1 -4
  54. package/src/og/shaders/billboard.js +220 -204
  55. package/src/og/shaders/drawnode.js +603 -603
  56. package/src/og/shaders/label.js +595 -456
  57. package/src/og/shaders/polyline.js +365 -361
  58. package/src/og/terrain/MapboxTerrain.js +1 -1
  59. package/src/og/utils/FontAtlas.js +209 -200
  60. package/src/og/utils/GeoImageCreator.js +4 -5
  61. package/src/og/utils/TextureAtlas.js +4 -4
  62. package/src/og/utils/VectorTileCreator.js +414 -414
  63. package/src/og/utils/shared.js +1 -1
  64. package/src/og/webgl/Handler.js +28 -60
  65. package/src/og/webgl/Multisample.js +260 -260
  66. package/src/og/webgl/Program.js +411 -396
  67. package/types/bv/Box.d.ts +1 -1
  68. package/types/bv/Sphere.d.ts +1 -1
  69. package/types/camera/PlanetCamera.d.ts +3 -3
  70. package/types/control/LayerSwitcher.d.ts +1 -1
  71. package/types/ellipsoid/Ellipsoid.d.ts +9 -2
  72. package/types/entity/BillboardHandler.d.ts +0 -4
  73. package/types/entity/EntityCollection.d.ts +0 -8
  74. package/types/entity/LabelHandler.d.ts +0 -2
  75. package/types/entity/Polyline.d.ts +1 -1
  76. package/types/layer/KML.d.ts +11 -11
  77. package/types/layer/Layer.d.ts +5 -0
  78. package/types/layer/Vector.d.ts +1 -8
  79. package/types/math/Line2.d.ts +4 -4
  80. package/types/math/Ray.d.ts +2 -2
  81. package/types/math/Vec2.d.ts +1 -1
  82. package/types/math/Vec3.d.ts +1 -1
  83. package/types/math/Vec4.d.ts +2 -2
  84. package/types/math.d.ts +1 -1
  85. package/types/renderer/Renderer.d.ts +1 -1
  86. package/types/renderer/RendererEvents.d.ts +1 -1
  87. package/types/shaders/label.d.ts +1 -1
  88. package/types/utils/FontAtlas.d.ts +3 -2
  89. package/types/utils/TextureAtlas.d.ts +3 -3
  90. package/types/utils/VectorTileCreator.d.ts +4 -4
  91. package/types/utils/shared.d.ts +1 -1
  92. package/types/webgl/Handler.d.ts +6 -31
  93. package/types/webgl/Program.d.ts +2 -0
@@ -1,316 +1,320 @@
1
- /**
2
- * @module og/layer/Layer
3
- */
4
-
5
- "use strict";
6
-
7
- import * as utils from "../utils/shared.js";
8
- import * as mercator from "../mercator.js";
9
- import { Events } from "../Events.js";
10
- import { Extent } from "../Extent.js";
11
- import { LonLat } from "../LonLat.js";
12
- import { Material } from "./Material.js";
13
- import { Vec3 } from "../math/Vec3.js";
14
-
15
- export const FADING_FACTOR = 0.29;
16
-
17
- /**
18
- * @classdesc
19
- * Base class; normally only used for creating subclasses and not instantiated in apps.
20
- * A visual representation of raster or vector map data well known as a layer.
21
- * @class
22
- * @param {String} [name="noname"] - Layer name.
23
- * @param {Object} [options] - Layer options:
24
- * @param {number} [options.opacity=1.0] - Layer opacity.
25
- * @param {number} [options.minZoom=0] - Minimal visibility zoom level.
26
- * @param {number} [options.maxZoom=0] - Maximal visibility zoom level.
27
- * @param {string} [options.attribution] - Layer attribution that displayed in the attribution area on the screen.
28
- * @param {boolean} [options.isBaseLayer=false] - This is a base layer.
29
- * @param {boolean} [options.visibility=true] - Layer visibility.
30
- * @param {boolean} [options.isSRGB=false] - Layer image webgl nternal format.
31
- * @param {Extent} [options.extent=[[-180.0, -90.0], [180.0, 90.0]]] - Visible extent.
32
- * @param {string} [options.textureFilter="anisotropic"] - Image texture filter. Available values: "nearest", "linear", "mipmap" and "anisotropic".
33
- *
34
- * @fires og.Layer#visibilitychange
35
- * @fires og.Layer#add
36
- * @fires og.Layer#remove
37
- * @fires og.layer.Vector#mousemove
38
- * @fires og.layer.Vector#mouseenter
39
- * @fires og.layer.Vector#mouseleave
40
- * @fires og.layer.Vector#lclick
41
- * @fires og.layer.Vector#rclick
42
- * @fires og.layer.Vector#mclick
43
- * @fires og.layer.Vector#ldblclick
44
- * @fires og.layer.Vector#rdblclick
45
- * @fires og.layer.Vector#mdblclick
46
- * @fires og.layer.Vector#lup
47
- * @fires og.layer.Vector#rup
48
- * @fires og.layer.Vector#mup
49
- * @fires og.layer.Vector#ldown
50
- * @fires og.layer.Vector#rdown
51
- * @fires og.layer.Vector#mdown
52
- * @fires og.layer.Vector#lhold
53
- * @fires og.layer.Vector#rhold
54
- * @fires og.layer.Vector#mhold
55
- * @fires og.layer.Vector#mousewheel
56
- * @fires og.layer.Vector#touchmove
57
- * @fires og.layer.Vector#touchstart
58
- * @fires og.layer.Vector#touchend
59
- * @fires og.layer.Vector#doubletouch
60
- */
61
- class Layer {
62
- constructor(name, options = {}) {
63
- /**
64
- * Layer user name.
65
- * @public
66
- * @type {string}
67
- */
68
- this.name = name || "noname";
69
-
70
- this._labelMaxLetters = options.labelMaxLetters;
71
-
72
- this.displayInLayerSwitcher =
73
- options.displayInLayerSwitcher !== undefined ? options.displayInLayerSwitcher : true;
74
-
75
- this._hasImageryTiles = true;
76
-
77
- /**
78
- * Layer global opacity.
79
- * @public
80
- * @type {number}
81
- */
82
- this._opacity = options.opacity || 1.0;
83
-
84
- /**
85
- * Minimal zoom level when layer is visibile.
86
- * @public
87
- * @type {number}
88
- */
89
- this.minZoom = options.minZoom || 0;
90
-
91
- /**
92
- * Maximal zoom level when layer is visibile.
93
- * @public
94
- * @type {number}
95
- */
96
- this.maxZoom = options.maxZoom || 50;
97
-
98
- /**
99
- * Planet node.
100
- * @protected
101
- * @type {Planet}
102
- */
103
- this._planet = null;
104
-
105
- /**
106
- * Unic identifier.
107
- * @protected
108
- * @type {number}
109
- */
110
- this._id = Layer.__layersCounter++;
111
-
112
- /**
113
- * Layer attribution.
114
- * @protected
115
- * @type {string}
116
- */
117
- this._attribution = options.attribution || "";
118
-
119
- /**
120
- * Layer z-index.
121
- * @protected
122
- * @type {number}
123
- */
124
- this._zIndex = options.zIndex || 0;
125
-
126
- /**
127
- * Base layer type flag.
128
- * @protected
129
- * @type {boolean}
130
- */
131
- this._isBaseLayer = options.isBaseLayer || false;
132
-
133
- this._defaultTextures = options.defaultTextures || [null, null];
134
-
135
- /**
136
- * Layer visibility.
137
- * @protected
138
- * @type {boolean}
139
- */
140
- this._visibility = options.visibility !== undefined ? options.visibility : true;
141
-
142
- this._fading = options.fading || false;
143
-
144
- this._fadingFactor = FADING_FACTOR;
145
-
146
- if (this._fading) {
147
- this._fadingOpacity = this._visibility ? this._opacity : 0.0;
148
- } else {
149
- this._fadingOpacity = this._opacity;
150
- }
151
-
152
- /**
153
- * Height over the ground.
154
- * @protected
155
- * @type {number}
156
- */
157
- this._height = options.height || 0;
158
-
159
- /**
160
- * Visible degrees extent.
161
- * @protected
162
- * @type {Extent}
163
- */
164
- this._extent = null;
165
-
166
- this.createTexture = null;
1
+ /**
2
+ * @module og/layer/Layer
3
+ */
4
+
5
+ "use strict";
6
+
7
+ import * as utils from "../utils/shared.js";
8
+ import * as mercator from "../mercator.js";
9
+ import { Events } from "../Events.js";
10
+ import { Extent } from "../Extent.js";
11
+ import { LonLat } from "../LonLat.js";
12
+ import { Material } from "./Material.js";
13
+ import { Vec3 } from "../math/Vec3.js";
14
+
15
+ export const FADING_FACTOR = 0.29;
16
+
17
+ /**
18
+ * @classdesc
19
+ * Base class; normally only used for creating subclasses and not instantiated in apps.
20
+ * A visual representation of raster or vector map data well known as a layer.
21
+ * @class
22
+ * @param {String} [name="noname"] - Layer name.
23
+ * @param {Object} [options] - Layer options:
24
+ * @param {number} [options.opacity=1.0] - Layer opacity.
25
+ * @param {number} [options.minZoom=0] - Minimal visibility zoom level.
26
+ * @param {number} [options.maxZoom=0] - Maximal visibility zoom level.
27
+ * @param {string} [options.attribution] - Layer attribution that displayed in the attribution area on the screen.
28
+ * @param {boolean} [options.isBaseLayer=false] - This is a base layer.
29
+ * @param {boolean} [options.visibility=true] - Layer visibility.
30
+ * @param {boolean} [options.isSRGB=false] - Layer image webgl nternal format.
31
+ * @param {Extent} [options.extent=[[-180.0, -90.0], [180.0, 90.0]]] - Visible extent.
32
+ * @param {string} [options.textureFilter="anisotropic"] - Image texture filter. Available values: "nearest", "linear", "mipmap" and "anisotropic".
33
+ *
34
+ * @fires og.Layer#visibilitychange
35
+ * @fires og.Layer#add
36
+ * @fires og.Layer#remove
37
+ * @fires og.layer.Vector#mousemove
38
+ * @fires og.layer.Vector#mouseenter
39
+ * @fires og.layer.Vector#mouseleave
40
+ * @fires og.layer.Vector#lclick
41
+ * @fires og.layer.Vector#rclick
42
+ * @fires og.layer.Vector#mclick
43
+ * @fires og.layer.Vector#ldblclick
44
+ * @fires og.layer.Vector#rdblclick
45
+ * @fires og.layer.Vector#mdblclick
46
+ * @fires og.layer.Vector#lup
47
+ * @fires og.layer.Vector#rup
48
+ * @fires og.layer.Vector#mup
49
+ * @fires og.layer.Vector#ldown
50
+ * @fires og.layer.Vector#rdown
51
+ * @fires og.layer.Vector#mdown
52
+ * @fires og.layer.Vector#lhold
53
+ * @fires og.layer.Vector#rhold
54
+ * @fires og.layer.Vector#mhold
55
+ * @fires og.layer.Vector#mousewheel
56
+ * @fires og.layer.Vector#touchmove
57
+ * @fires og.layer.Vector#touchstart
58
+ * @fires og.layer.Vector#touchend
59
+ * @fires og.layer.Vector#doubletouch
60
+ */
61
+ class Layer {
62
+ constructor(name, options = {}) {
63
+ /**
64
+ * Layer user name.
65
+ * @public
66
+ * @type {string}
67
+ */
68
+ this.name = name || "noname";
69
+
70
+ this._labelMaxLetters = options.labelMaxLetters;
71
+
72
+ this.displayInLayerSwitcher =
73
+ options.displayInLayerSwitcher !== undefined ? options.displayInLayerSwitcher : true;
74
+
75
+ this._hasImageryTiles = true;
76
+
77
+ /**
78
+ * Layer global opacity.
79
+ * @public
80
+ * @type {number}
81
+ */
82
+ this._opacity = options.opacity || 1.0;
83
+
84
+ /**
85
+ * Minimal zoom level when layer is visibile.
86
+ * @public
87
+ * @type {number}
88
+ */
89
+ this.minZoom = options.minZoom || 0;
90
+
91
+ /**
92
+ * Maximal zoom level when layer is visibile.
93
+ * @public
94
+ * @type {number}
95
+ */
96
+ this.maxZoom = options.maxZoom || 50;
97
+
98
+ /**
99
+ * Planet node.
100
+ * @protected
101
+ * @type {Planet}
102
+ */
103
+ this._planet = null;
104
+
105
+ /**
106
+ * Unic identifier.
107
+ * @protected
108
+ * @type {number}
109
+ */
110
+ this._id = Layer.__layersCounter++;
111
+
112
+ /**
113
+ * Layer attribution.
114
+ * @protected
115
+ * @type {string}
116
+ */
117
+ this._attribution = options.attribution || "";
118
+
119
+ /**
120
+ * Layer z-index.
121
+ * @protected
122
+ * @type {number}
123
+ */
124
+ this._zIndex = options.zIndex || 0;
125
+
126
+ /**
127
+ * Base layer type flag.
128
+ * @protected
129
+ * @type {boolean}
130
+ */
131
+ this._isBaseLayer = options.isBaseLayer || false;
132
+
133
+ this._defaultTextures = options.defaultTextures || [null, null];
134
+
135
+ /**
136
+ * Layer visibility.
137
+ * @protected
138
+ * @type {boolean}
139
+ */
140
+ this._visibility = options.visibility !== undefined ? options.visibility : true;
141
+
142
+ this._fading = options.fading || false;
143
+
144
+ this._fadingFactor = FADING_FACTOR;
145
+
146
+ if (this._fading) {
147
+ this._fadingOpacity = this._visibility ? this._opacity : 0.0;
148
+ } else {
149
+ this._fadingOpacity = this._opacity;
150
+ }
151
+
152
+ /**
153
+ * Height over the ground.
154
+ * @protected
155
+ * @type {number}
156
+ */
157
+ this._height = options.height || 0;
158
+
159
+ /**
160
+ * Visible degrees extent.
161
+ * @protected
162
+ * @type {Extent}
163
+ */
164
+ this._extent = null;
165
+
166
+ this.createTexture = null;
167
167
 
168
168
  this._textureFilter = options.textureFilter ? options.textureFilter.trim().toUpperCase() : "MIPMAP";
169
169
 
170
170
  this._isSRGB = options.isSRGB != undefined ? options.isSRGB : false;
171
171
 
172
- this._internalFormat = null;
173
-
174
- /**
175
- * Visible mercator extent.
176
- * @protected
177
- * @type {Extent}
178
- */
179
- this._extentMerc = null;
180
-
181
- // Setting the extent up
182
- this.setExtent(
183
- utils.createExtent(
184
- options.extent,
185
- new Extent(new LonLat(-180, -90), new LonLat(180, 90))
186
- )
187
- );
188
-
189
- /**
190
- * Layer picking color. Assign when added to the planet.
191
- * @protected
192
- * @type {Vec3}
193
- */
194
- this._pickingColor = new Vec3();
195
-
196
- this._pickingEnabled = options.pickingEnabled !== undefined ? options.pickingEnabled : true;
197
-
198
- /**
199
- * Events handler.
200
- * @public
201
- * @type {Events}
202
- */
203
- this.events = new Events(EVENT_NAMES, this);
204
- }
205
-
206
- static getTMS(x, y, z) {
207
- return {
208
- x: x,
209
- y: (1 << z) - y - 1,
210
- z: z
211
- };
212
- }
213
-
214
- static getTileIndex(...arr) {
215
- return arr.join("_");
216
- }
217
-
218
- static get __layersCounter() {
219
- if (!this.__lcounter && this.__lcounter !== 0) {
220
- this.__lcounter = 0;
221
- }
222
- return this.__lcounter;
223
- }
224
-
225
- static set __layersCounter(n) {
226
- this.__lcounter = n;
227
- }
228
-
229
- static get __requestsCounter() {
230
- return this.__reqcounter;
231
- }
232
-
233
- static set __requestsCounter(v) {
234
- this.__reqcounter = v;
235
- }
236
-
237
- /**
238
- * Maximum loading queries at one time.
239
- * @const
240
- * @type {number}
241
- */
242
- static get MAX_REQUESTS() {
243
- return 7;
244
- }
245
-
246
- get instanceName() {
247
- return "Layer";
248
- }
249
-
250
- get rendererEvents() {
251
- return this.events;
252
- }
253
-
254
- set opacity(opacity) {
255
- if (this._fading) {
256
- if (opacity > this._opacity) {
257
- this._fadingFactor = (opacity - this._opacity) / 2.8;
258
- } else if (opacity < this._opacity) {
259
- this._fadingFactor = (opacity - this._opacity) / 2.8;
260
- }
261
- } else {
262
- this._fadingOpacity = opacity;
263
- }
264
- this._opacity = opacity;
265
- }
266
-
267
- get opacity() {
268
- return this._opacity;
269
- }
270
-
271
- set pickingEnabled(picking) {
272
- this._pickingEnabled = picking ? 1.0 : 0.0;
273
- }
274
-
275
- get pickingEnabled() {
276
- return !!this._pickingEnabled;
277
- }
278
-
279
- /**
280
- * Returns true if a layer has imagery tiles.
281
- * @public
282
- * @virtual
283
- * @returns {boolean} - Imagery tiles flag.
284
- */
285
- hasImageryTiles() {
286
- return this._hasImageryTiles;
287
- }
288
-
289
- /**
290
- * Gets layer identifier.
291
- * @public
292
- * @returns {string} - Layer object id.
293
- */
294
- getID() {
295
- return this._id;
296
- }
297
-
298
- /**
299
- * Compares layers instances.
300
- * @public
301
- * @param {Layer} layer - Layer instance to compare.
302
- * @returns {boolean} - Returns true if the layers is the same instance of the input.
303
- */
304
- isEqual(layer) {
305
- return layer._id === this._id;
306
- }
307
-
308
- /**
309
- * Assign the planet.
310
- * @protected
311
- * @virtual
312
- * @param {Planet} planet - Planet render node.
313
- */
172
+ this._internalFormat = null;
173
+
174
+ /**
175
+ * Visible mercator extent.
176
+ * @protected
177
+ * @type {Extent}
178
+ */
179
+ this._extentMerc = null;
180
+
181
+ // Setting the extent up
182
+ this.setExtent(
183
+ utils.createExtent(
184
+ options.extent,
185
+ new Extent(new LonLat(-180, -90), new LonLat(180, 90))
186
+ )
187
+ );
188
+
189
+ /**
190
+ * Layer picking color. Assign when added to the planet.
191
+ * @protected
192
+ * @type {Vec3}
193
+ */
194
+ this._pickingColor = new Vec3();
195
+
196
+ this._pickingEnabled = options.pickingEnabled !== undefined ? options.pickingEnabled : true;
197
+
198
+ this._isPreloadDone = false;
199
+
200
+ this._preLoadZoomLevels = options.preLoadZoomLevels || [0, 1];
201
+
202
+ /**
203
+ * Events handler.
204
+ * @public
205
+ * @type {Events}
206
+ */
207
+ this.events = new Events(EVENT_NAMES, this);
208
+ }
209
+
210
+ static getTMS(x, y, z) {
211
+ return {
212
+ x: x,
213
+ y: (1 << z) - y - 1,
214
+ z: z
215
+ };
216
+ }
217
+
218
+ static getTileIndex(...arr) {
219
+ return arr.join("_");
220
+ }
221
+
222
+ static get __layersCounter() {
223
+ if (!this.__lcounter && this.__lcounter !== 0) {
224
+ this.__lcounter = 0;
225
+ }
226
+ return this.__lcounter;
227
+ }
228
+
229
+ static set __layersCounter(n) {
230
+ this.__lcounter = n;
231
+ }
232
+
233
+ static get __requestsCounter() {
234
+ return this.__reqcounter;
235
+ }
236
+
237
+ static set __requestsCounter(v) {
238
+ this.__reqcounter = v;
239
+ }
240
+
241
+ /**
242
+ * Maximum loading queries at one time.
243
+ * @const
244
+ * @type {number}
245
+ */
246
+ static get MAX_REQUESTS() {
247
+ return 7;
248
+ }
249
+
250
+ get instanceName() {
251
+ return "Layer";
252
+ }
253
+
254
+ get rendererEvents() {
255
+ return this.events;
256
+ }
257
+
258
+ set opacity(opacity) {
259
+ if (this._fading) {
260
+ if (opacity > this._opacity) {
261
+ this._fadingFactor = (opacity - this._opacity) / 2.8;
262
+ } else if (opacity < this._opacity) {
263
+ this._fadingFactor = (opacity - this._opacity) / 2.8;
264
+ }
265
+ } else {
266
+ this._fadingOpacity = opacity;
267
+ }
268
+ this._opacity = opacity;
269
+ }
270
+
271
+ get opacity() {
272
+ return this._opacity;
273
+ }
274
+
275
+ set pickingEnabled(picking) {
276
+ this._pickingEnabled = picking ? 1.0 : 0.0;
277
+ }
278
+
279
+ get pickingEnabled() {
280
+ return !!this._pickingEnabled;
281
+ }
282
+
283
+ /**
284
+ * Returns true if a layer has imagery tiles.
285
+ * @public
286
+ * @virtual
287
+ * @returns {boolean} - Imagery tiles flag.
288
+ */
289
+ hasImageryTiles() {
290
+ return this._hasImageryTiles;
291
+ }
292
+
293
+ /**
294
+ * Gets layer identifier.
295
+ * @public
296
+ * @returns {string} - Layer object id.
297
+ */
298
+ getID() {
299
+ return this._id;
300
+ }
301
+
302
+ /**
303
+ * Compares layers instances.
304
+ * @public
305
+ * @param {Layer} layer - Layer instance to compare.
306
+ * @returns {boolean} - Returns true if the layers is the same instance of the input.
307
+ */
308
+ isEqual(layer) {
309
+ return layer._id === this._id;
310
+ }
311
+
312
+ /**
313
+ * Assign the planet.
314
+ * @protected
315
+ * @virtual
316
+ * @param {Planet} planet - Planet render node.
317
+ */
314
318
  _assignPlanet(planet) {
315
319
  // TODO: webgl1
316
320
  if (this._isSRGB) {
@@ -320,453 +324,501 @@ class Layer {
320
324
  }
321
325
 
322
326
  this.createTexture = planet.renderer.handler.createTexture[this._textureFilter];
323
-
324
- planet.layers.push(this);
325
- this._planet = planet;
326
- this.events.on("visibilitychange", planet._onLayerVisibilityChanged, planet);
327
- if (this._isBaseLayer && this._visibility) {
328
- planet.setBaseLayer(this);
329
- }
330
- planet.events.dispatch(planet.events.layeradd, this);
331
- this.events.dispatch(this.events.add, planet);
332
- planet.updateVisibleLayers();
333
- this._bindPicking();
334
- }
335
-
336
- /**
337
- * Assign picking color to the layer.
338
- * @protected
339
- * @virtual
340
- */
341
- _bindPicking() {
342
- this._planet && this._planet.renderer.assignPickingColor(this);
343
- }
344
-
345
- /**
346
- * Adds layer to the planet.
347
- * @public
348
- * @param {Planet} planet - Adds layer to the planet.
349
- */
350
- addTo(planet) {
351
- if (!this._planet) {
352
- this._assignPlanet(planet);
353
- }
354
- return this;
355
- }
356
-
357
- /**
358
- * Removes from planet.
359
- * @public
360
- * @returns {Layer} -This layer.
361
- */
362
- remove() {
363
- var p = this._planet;
364
- if (p) {
365
- for (var i = 0; i < p.layers.length; i++) {
366
- if (this.isEqual(p.layers[i])) {
367
- p.renderer.clearPickingColor(this);
368
- p.layers.splice(i, 1);
369
- p.updateVisibleLayers();
370
- this.clear();
371
- p.events.dispatch(p.events.layerremove, this);
372
- this.events.dispatch(this.events.remove, p);
373
- this._planet = null;
374
- return this;
375
- }
376
- }
377
- }
378
- return this;
379
- }
380
-
381
- /**
382
- * Clears layer material.
383
- * @virtual
384
- */
385
- clear() {
327
+
328
+ planet.layers.push(this);
329
+ this._planet = planet;
330
+ this.events.on("visibilitychange", planet._onLayerVisibilityChanged, planet);
331
+ if (this._isBaseLayer && this._visibility) {
332
+ planet.setBaseLayer(this);
333
+ }
334
+
335
+ if (this._visibility && this.hasImageryTiles()) {
336
+ this._preLoad();
337
+ }
338
+
339
+ planet.events.dispatch(planet.events.layeradd, this);
340
+ this.events.dispatch(this.events.add, planet);
341
+ planet.updateVisibleLayers();
342
+ this._bindPicking();
343
+ }
344
+
345
+ /**
346
+ * Assign picking color to the layer.
347
+ * @protected
348
+ * @virtual
349
+ */
350
+ _bindPicking() {
351
+ this._planet && this._planet.renderer.assignPickingColor(this);
352
+ }
353
+
354
+ /**
355
+ * Adds layer to the planet.
356
+ * @public
357
+ * @param {Planet} planet - Adds layer to the planet.
358
+ */
359
+ addTo(planet) {
360
+ if (!this._planet) {
361
+ this._assignPlanet(planet);
362
+ }
363
+ return this;
364
+ }
365
+
366
+ /**
367
+ * Removes from planet.
368
+ * @public
369
+ * @returns {Layer} -This layer.
370
+ */
371
+ remove() {
372
+ var p = this._planet;
373
+ if (p) {
374
+ for (var i = 0; i < p.layers.length; i++) {
375
+ if (this.isEqual(p.layers[i])) {
376
+ p.renderer.clearPickingColor(this);
377
+ p.layers.splice(i, 1);
378
+ p.updateVisibleLayers();
379
+ this.clear();
380
+ p.events.dispatch(p.events.layerremove, this);
381
+ this.events.dispatch(this.events.remove, p);
382
+ this._planet = null;
383
+ return this;
384
+ }
385
+ }
386
+ }
387
+ return this;
388
+ }
389
+
390
+ /**
391
+ * Clears layer material.
392
+ * @virtual
393
+ */
394
+ clear() {
386
395
  if (this._planet) {
387
396
  this._planet._clearLayerMaterial(this);
388
397
  this._internalFormat = null;
389
398
  this.createTexture = null;
390
- }
391
- }
392
-
393
- /**
394
- * Returns planet instance.
395
- * @virtual
396
- */
397
- get planet() {
398
- return this._planet;
399
- }
400
-
401
- /**
402
- * Sets layer attribution text.
403
- * @public
404
- * @param {string} html - HTML code that represents layer attribution, it could be just a text.
405
- */
406
- setAttribution(html) {
407
- this._attribution = html;
408
- this._planet && this._planet.updateAttributionsList();
409
- }
410
-
411
- /**
412
- * Sets height over the ground.
413
- * @public
414
- * @param {number} height - Layer height.
415
- */
416
- setHeight(height) {
417
- this._height = height;
418
- this._planet && this._planet.updateVisibleLayers();
419
- }
420
-
421
- /**
422
- * Gets layer height.
423
- * @public
424
- * @returns {number} -
425
- */
426
- getHeight() {
427
- return this._height;
428
- }
429
-
430
- /**
431
- * Sets z-index.
432
- * @public
433
- * @param {number} zIndex - Layer z-index.
434
- */
435
- setZIndex(zIndex) {
436
- this._zIndex = zIndex;
437
- this._planet && this._planet.updateVisibleLayers();
438
- }
439
-
440
- /**
441
- * Gets z-index.
442
- * @public
443
- * @returns {number} -
444
- */
445
- getZIndex() {
446
- return this._zIndex;
447
- }
448
-
449
- /**
450
- * Set zIndex to the maximal value depend on other layers on the planet.
451
- * @public
452
- */
453
- bringToFront() {
454
- if (this._planet) {
455
- var vl = this._planet.visibleTileLayers;
456
- var l = vl[vl.length - 1];
457
- if (!l.isEqual(this)) {
458
- this.setZIndex(l.getZIndex() + 1);
459
- }
460
- }
461
- }
462
-
463
- /**
464
- * Returns true if the layer is a base.
465
- * @public
466
- * @returns {boolean} - Base layer flag.
467
- */
468
- isBaseLayer() {
469
- return this._isBaseLayer;
470
- }
471
-
472
- /**
473
- * Sets base layer type true.
474
- * @public
475
- * @param {boolean} flag - Base layer flag.
476
- */
477
- setBaseLayer(flag) {
478
- this._isBaseLayer = flag;
479
- if (this._planet) {
480
- if (!flag && this.isEqual(this._planet.baseLayer)) {
481
- this._planet.baseLayer = null;
482
- }
483
- this._planet.updateVisibleLayers();
484
- }
485
- }
486
-
487
- /**
488
- * Sets layer visibility.
489
- * @public
490
- * @virtual
491
- * @param {boolean} visibility - Layer visibility.
492
- */
493
- setVisibility(visibility) {
494
- if (visibility !== this._visibility) {
495
- this._visibility = visibility;
496
- if (this._planet) {
497
- if (this._isBaseLayer && visibility) {
498
- this._planet.setBaseLayer(this);
499
- }
399
+ }
400
+ }
401
+
402
+ /**
403
+ * Returns planet instance.
404
+ * @virtual
405
+ */
406
+ get planet() {
407
+ return this._planet;
408
+ }
409
+
410
+ /**
411
+ * Sets layer attribution text.
412
+ * @public
413
+ * @param {string} html - HTML code that represents layer attribution, it could be just a text.
414
+ */
415
+ setAttribution(html) {
416
+ this._attribution = html;
417
+ this._planet && this._planet.updateAttributionsList();
418
+ }
419
+
420
+ /**
421
+ * Sets height over the ground.
422
+ * @public
423
+ * @param {number} height - Layer height.
424
+ */
425
+ setHeight(height) {
426
+ this._height = height;
427
+ this._planet && this._planet.updateVisibleLayers();
428
+ }
429
+
430
+ /**
431
+ * Gets layer height.
432
+ * @public
433
+ * @returns {number} -
434
+ */
435
+ getHeight() {
436
+ return this._height;
437
+ }
438
+
439
+ /**
440
+ * Sets z-index.
441
+ * @public
442
+ * @param {number} zIndex - Layer z-index.
443
+ */
444
+ setZIndex(zIndex) {
445
+ this._zIndex = zIndex;
446
+ this._planet && this._planet.updateVisibleLayers();
447
+ }
448
+
449
+ /**
450
+ * Gets z-index.
451
+ * @public
452
+ * @returns {number} -
453
+ */
454
+ getZIndex() {
455
+ return this._zIndex;
456
+ }
457
+
458
+ /**
459
+ * Set zIndex to the maximal value depend on other layers on the planet.
460
+ * @public
461
+ */
462
+ bringToFront() {
463
+ if (this._planet) {
464
+ var vl = this._planet.visibleTileLayers;
465
+ var l = vl[vl.length - 1];
466
+ if (!l.isEqual(this)) {
467
+ this.setZIndex(l.getZIndex() + 1);
468
+ }
469
+ }
470
+ }
471
+
472
+ /**
473
+ * Returns true if the layer is a base.
474
+ * @public
475
+ * @returns {boolean} - Base layer flag.
476
+ */
477
+ isBaseLayer() {
478
+ return this._isBaseLayer;
479
+ }
480
+
481
+ /**
482
+ * Sets base layer type true.
483
+ * @public
484
+ * @param {boolean} flag - Base layer flag.
485
+ */
486
+ setBaseLayer(flag) {
487
+ this._isBaseLayer = flag;
488
+ if (this._planet) {
489
+ if (!flag && this.isEqual(this._planet.baseLayer)) {
490
+ this._planet.baseLayer = null;
491
+ }
492
+ this._planet.updateVisibleLayers();
493
+ }
494
+ }
495
+
496
+ /**
497
+ * Sets layer visibility.
498
+ * @public
499
+ * @virtual
500
+ * @param {boolean} visibility - Layer visibility.
501
+ */
502
+ setVisibility(visibility) {
503
+ if (visibility !== this._visibility) {
504
+ this._visibility = visibility;
505
+ if (this._planet) {
506
+ if (this._isBaseLayer && visibility) {
507
+ this._planet.setBaseLayer(this);
508
+ }
500
509
  this._planet.updateVisibleLayers();
501
- if (visibility) {
502
- this._planet._preLoad();
510
+ if (visibility && !this._isPreloadDone && !this.isVector) {
511
+ this._isPreloadDone = true;
512
+ this._preLoad();
503
513
  }
504
- }
505
- this.events.dispatch(this.events.visibilitychange, this);
506
- }
507
- }
508
-
509
- /**
510
- * Gets layer visibility.
511
- * @public
512
- * @returns {boolean} - Layer visibility.
513
- */
514
- getVisibility() {
515
- return this._visibility;
516
- }
517
-
518
- /**
519
- * Sets visible geographical extent.
520
- * @public
521
- * @param {Extent} extent - Layer visible geographical extent.
522
- */
523
- setExtent(extent) {
524
- var sw = extent.southWest.clone(),
525
- ne = extent.northEast.clone();
526
- if (sw.lat < mercator.MIN_LAT) {
527
- sw.lat = mercator.MIN_LAT;
528
- }
529
- if (ne.lat > mercator.MAX_LAT) {
530
- ne.lat = mercator.MAX_LAT;
531
- }
532
- this._extent = extent.clone();
533
- this._extentMerc = new Extent(sw.forwardMercator(), ne.forwardMercator());
534
- this._correctFullExtent();
535
- }
536
-
537
- /**
538
- * Gets layer extent.
539
- * @public
540
- * @return {Extent} - Layer geodetic extent.
541
- */
542
- getExtent() {
543
- return this._extent;
544
- }
545
-
546
- /**
547
- * Special correction of the whole globe extent.
548
- * @protected
549
- */
550
- _correctFullExtent() {
551
- // var e = this._extent,
552
- // em = this._extentMerc;
553
- // var ENLARGE_MERCATOR_LON = og.mercator.POLE + 50000;
554
- // var ENLARGE_MERCATOR_LAT = og.mercator.POLE + 50000;
555
- // if (e.northEast.lat === 90.0) {
556
- // em.northEast.lat = ENLARGE_MERCATOR_LAT;
557
- // }
558
- // if (e.northEast.lon === 180.0) {
559
- // em.northEast.lon = ENLARGE_MERCATOR_LON;
560
- // }
561
- // if (e.southWest.lat === -90.0) {
562
- // em.southWest.lat = -ENLARGE_MERCATOR_LAT;
563
- // }
564
- // if (e.southWest.lon === -180.0) {
565
- // em.southWest.lon = -ENLARGE_MERCATOR_LON;
566
- // }
567
- }
568
-
569
- _refreshFadingOpacity() {
570
- var p = this._planet;
571
- if (
572
- this._visibility &&
573
- p._viewExtent &&
574
- p._viewExtent.overlaps(this._extent) &&
575
- p.maxCurrZoom >= this.minZoom &&
576
- p.minCurrZoom <= this.maxZoom
577
- ) {
578
- this._fadingOpacity += this._fadingFactor;
579
-
580
- if (
581
- (this._fadingFactor > 0.0 && this._fadingOpacity > this._opacity) ||
582
- (this._fadingFactor < 0.0 && this._fadingOpacity < this._opacity)
583
- ) {
584
- this._fadingOpacity = this._opacity;
585
- }
586
- return false;
587
- } else {
588
- this._fadingOpacity -= FADING_FACTOR;
589
-
590
- if (this._fadingOpacity < 0.0) {
591
- this._fadingOpacity = 0.0;
592
- return !this._visibility;
593
- }
594
- }
595
- }
596
-
597
- createMaterial(segment) {
598
- return new Material(segment, this);
599
- }
600
- }
601
-
602
- const EVENT_NAMES = [
603
- /**
604
- * Triggered when layer visibilty chanched.
605
- * @event og.Layer#visibilitychange
606
- */
607
- "visibilitychange",
608
-
609
- /**
610
- * Triggered when layer has added to the planet.
611
- * @event og.Layer#add
612
- */
613
- "add",
614
-
615
- /**
616
- * Triggered when layer has removed from the planet.
617
- * @event og.Layer#remove
618
- */
619
- "remove",
620
-
621
- /**
622
- * Triggered when mouse moves over the layer.
623
- * @event og.Layer#mousemove
624
- */
625
- "mousemove",
626
-
627
- /**
628
- * Triggered when mouse has entered over the layer.
629
- * @event og.Layer#mouseenter
630
- */
631
- "mouseenter",
632
-
633
- /**
634
- * Triggered when mouse leaves the layer.
635
- * @event og.Layer#mouseenter
636
- */
637
- "mouseleave",
638
-
639
- /**
640
- * Mouse left button clicked.
641
- * @event og.Layer#lclick
642
- */
643
- "lclick",
644
-
645
- /**
646
- * Mouse right button clicked.
647
- * @event og.Layer#rclick
648
- */
649
- "rclick",
650
-
651
- /**
652
- * Mouse right button clicked.
653
- * @event og.Layer#mclick
654
- */
655
- "mclick",
656
-
657
- /**
658
- * Mouse left button double click.
659
- * @event og.Layer#ldblclick
660
- */
661
- "ldblclick",
662
-
663
- /**
664
- * Mouse right button double click.
665
- * @event og.Layer#rdblclick
666
- */
667
- "rdblclick",
668
-
669
- /**
670
- * Mouse middle button double click.
671
- * @event og.Layer#mdblclick
672
- */
673
- "mdblclick",
674
-
675
- /**
676
- * Mouse left button up(stop pressing).
677
- * @event og.Layer#lup
678
- */
679
- "lup",
680
-
681
- /**
682
- * Mouse right button up(stop pressing).
683
- * @event og.Layer#rup
684
- */
685
- "rup",
686
-
687
- /**
688
- * Mouse middle button up(stop pressing).
689
- * @event og.Layer#mup
690
- */
691
- "mup",
692
-
693
- /**
694
- * Mouse left button is just pressed down(start pressing).
695
- * @event og.Layer#ldown
696
- */
697
- "ldown",
698
-
699
- /**
700
- * Mouse right button is just pressed down(start pressing).
701
- * @event og.Layer#rdown
702
- */
703
- "rdown",
704
-
705
- /**
706
- * Mouse middle button is just pressed down(start pressing).
707
- * @event og.Layer#mdown
708
- */
709
- "mdown",
710
-
711
- /**
712
- * Mouse left button is pressing.
713
- * @event og.Layer#lhold
714
- */
715
- "lhold",
716
-
717
- /**
718
- * Mouse right button is pressing.
719
- * @event og.Layer#rhold
720
- */
721
- "rhold",
722
-
723
- /**
724
- * Mouse middle button is pressing.
725
- * @event og.Layer#mhold
726
- */
727
- "mhold",
728
-
729
- /**
730
- * Mouse wheel is rotated.
731
- * @event og.Layer#mousewheel
732
- */
733
- "mousewheel",
734
-
735
- /**
736
- * Triggered when touching moves over the layer.
737
- * @event og.Layer#touchmove
738
- */
739
- "touchmove",
740
-
741
- /**
742
- * Triggered when layer begins to touch.
743
- * @event og.Layer#touchstart
744
- */
745
- "touchstart",
746
-
747
- /**
748
- * Triggered when layer has finished touching.
749
- * @event og.Layer#touchend
750
- */
751
- "touchend",
752
-
753
- /**
754
- * Triggered layer has double touched.
755
- * @event og.Layer#doubletouch
756
- */
757
- "doubletouch",
758
-
759
- /**
760
- * Triggered when touching leaves layer borders.
761
- * @event og.Layer#touchleave
762
- */
763
- "touchleave",
764
-
765
- /**
766
- * Triggered when touch enters over the layer.
767
- * @event og.Layer#touchenter
768
- */
769
- "touchenter"
770
- ];
771
-
772
- export { Layer };
514
+ }
515
+ this.events.dispatch(this.events.visibilitychange, this);
516
+ }
517
+ }
518
+
519
+ _forceMaterialApply(segment) {
520
+ let pm = segment.materials,
521
+ m = pm[this._id];
522
+
523
+ if (!m) {
524
+ m = pm[this._id] = this.createMaterial(segment);
525
+ }
526
+
527
+ if (!m.isReady) {
528
+ this._planet._renderCompleted = false;
529
+ }
530
+
531
+ this.applyMaterial(m);
532
+ }
533
+
534
+ _preLoadRecursive(node, maxZoom) {
535
+ if (node.segment.tileZoom > maxZoom) {
536
+ return;
537
+ }
538
+ if (this._preLoadZoomLevels.includes(node.segment.tileZoom)) {
539
+ this._forceMaterialApply(node.segment);
540
+ }
541
+
542
+ for (let i = 0, len = node.nodes.length; i < len; i++) {
543
+ if (node.nodes[i]) {
544
+ this._preLoadRecursive(node.nodes[i], maxZoom);
545
+ }
546
+ }
547
+ }
548
+
549
+ _preLoad() {
550
+ if (this._planet && this._preLoadZoomLevels.length) {
551
+
552
+ let p = this._planet,
553
+ maxZoom = Math.max(...this._preLoadZoomLevels);
554
+
555
+ this._preLoadRecursive(p._quadTreeSouth, maxZoom);
556
+ this._preLoadRecursive(p._quadTreeNorth, maxZoom);
557
+ this._preLoadRecursive(p._quadTree, maxZoom);
558
+ }
559
+ }
560
+
561
+ /**
562
+ * Gets layer visibility.
563
+ * @public
564
+ * @returns {boolean} - Layer visibility.
565
+ */
566
+ getVisibility() {
567
+ return this._visibility;
568
+ }
569
+
570
+ /**
571
+ * Sets visible geographical extent.
572
+ * @public
573
+ * @param {Extent} extent - Layer visible geographical extent.
574
+ */
575
+ setExtent(extent) {
576
+ var sw = extent.southWest.clone(),
577
+ ne = extent.northEast.clone();
578
+ if (sw.lat < mercator.MIN_LAT) {
579
+ sw.lat = mercator.MIN_LAT;
580
+ }
581
+ if (ne.lat > mercator.MAX_LAT) {
582
+ ne.lat = mercator.MAX_LAT;
583
+ }
584
+ this._extent = extent.clone();
585
+ this._extentMerc = new Extent(sw.forwardMercator(), ne.forwardMercator());
586
+ this._correctFullExtent();
587
+ }
588
+
589
+ /**
590
+ * Gets layer extent.
591
+ * @public
592
+ * @return {Extent} - Layer geodetic extent.
593
+ */
594
+ getExtent() {
595
+ return this._extent;
596
+ }
597
+
598
+ /**
599
+ * Special correction of the whole globe extent.
600
+ * @protected
601
+ */
602
+ _correctFullExtent() {
603
+ // var e = this._extent,
604
+ // em = this._extentMerc;
605
+ // var ENLARGE_MERCATOR_LON = og.mercator.POLE + 50000;
606
+ // var ENLARGE_MERCATOR_LAT = og.mercator.POLE + 50000;
607
+ // if (e.northEast.lat === 90.0) {
608
+ // em.northEast.lat = ENLARGE_MERCATOR_LAT;
609
+ // }
610
+ // if (e.northEast.lon === 180.0) {
611
+ // em.northEast.lon = ENLARGE_MERCATOR_LON;
612
+ // }
613
+ // if (e.southWest.lat === -90.0) {
614
+ // em.southWest.lat = -ENLARGE_MERCATOR_LAT;
615
+ // }
616
+ // if (e.southWest.lon === -180.0) {
617
+ // em.southWest.lon = -ENLARGE_MERCATOR_LON;
618
+ // }
619
+ }
620
+
621
+ _refreshFadingOpacity() {
622
+ var p = this._planet;
623
+ if (
624
+ this._visibility &&
625
+ p._viewExtent &&
626
+ p._viewExtent.overlaps(this._extent) &&
627
+ p.maxCurrZoom >= this.minZoom &&
628
+ p.minCurrZoom <= this.maxZoom
629
+ ) {
630
+ this._fadingOpacity += this._fadingFactor;
631
+
632
+ if (
633
+ (this._fadingFactor > 0.0 && this._fadingOpacity > this._opacity) ||
634
+ (this._fadingFactor < 0.0 && this._fadingOpacity < this._opacity)
635
+ ) {
636
+ this._fadingOpacity = this._opacity;
637
+ }
638
+ return false;
639
+ } else {
640
+ this._fadingOpacity -= FADING_FACTOR;
641
+
642
+ if (this._fadingOpacity < 0.0) {
643
+ this._fadingOpacity = 0.0;
644
+ return !this._visibility;
645
+ }
646
+ }
647
+ }
648
+
649
+ createMaterial(segment) {
650
+ return new Material(segment, this);
651
+ }
652
+ }
653
+
654
+ const EVENT_NAMES = [
655
+ /**
656
+ * Triggered when layer visibilty chanched.
657
+ * @event og.Layer#visibilitychange
658
+ */
659
+ "visibilitychange",
660
+
661
+ /**
662
+ * Triggered when layer has added to the planet.
663
+ * @event og.Layer#add
664
+ */
665
+ "add",
666
+
667
+ /**
668
+ * Triggered when layer has removed from the planet.
669
+ * @event og.Layer#remove
670
+ */
671
+ "remove",
672
+
673
+ /**
674
+ * Triggered when mouse moves over the layer.
675
+ * @event og.Layer#mousemove
676
+ */
677
+ "mousemove",
678
+
679
+ /**
680
+ * Triggered when mouse has entered over the layer.
681
+ * @event og.Layer#mouseenter
682
+ */
683
+ "mouseenter",
684
+
685
+ /**
686
+ * Triggered when mouse leaves the layer.
687
+ * @event og.Layer#mouseenter
688
+ */
689
+ "mouseleave",
690
+
691
+ /**
692
+ * Mouse left button clicked.
693
+ * @event og.Layer#lclick
694
+ */
695
+ "lclick",
696
+
697
+ /**
698
+ * Mouse right button clicked.
699
+ * @event og.Layer#rclick
700
+ */
701
+ "rclick",
702
+
703
+ /**
704
+ * Mouse right button clicked.
705
+ * @event og.Layer#mclick
706
+ */
707
+ "mclick",
708
+
709
+ /**
710
+ * Mouse left button double click.
711
+ * @event og.Layer#ldblclick
712
+ */
713
+ "ldblclick",
714
+
715
+ /**
716
+ * Mouse right button double click.
717
+ * @event og.Layer#rdblclick
718
+ */
719
+ "rdblclick",
720
+
721
+ /**
722
+ * Mouse middle button double click.
723
+ * @event og.Layer#mdblclick
724
+ */
725
+ "mdblclick",
726
+
727
+ /**
728
+ * Mouse left button up(stop pressing).
729
+ * @event og.Layer#lup
730
+ */
731
+ "lup",
732
+
733
+ /**
734
+ * Mouse right button up(stop pressing).
735
+ * @event og.Layer#rup
736
+ */
737
+ "rup",
738
+
739
+ /**
740
+ * Mouse middle button up(stop pressing).
741
+ * @event og.Layer#mup
742
+ */
743
+ "mup",
744
+
745
+ /**
746
+ * Mouse left button is just pressed down(start pressing).
747
+ * @event og.Layer#ldown
748
+ */
749
+ "ldown",
750
+
751
+ /**
752
+ * Mouse right button is just pressed down(start pressing).
753
+ * @event og.Layer#rdown
754
+ */
755
+ "rdown",
756
+
757
+ /**
758
+ * Mouse middle button is just pressed down(start pressing).
759
+ * @event og.Layer#mdown
760
+ */
761
+ "mdown",
762
+
763
+ /**
764
+ * Mouse left button is pressing.
765
+ * @event og.Layer#lhold
766
+ */
767
+ "lhold",
768
+
769
+ /**
770
+ * Mouse right button is pressing.
771
+ * @event og.Layer#rhold
772
+ */
773
+ "rhold",
774
+
775
+ /**
776
+ * Mouse middle button is pressing.
777
+ * @event og.Layer#mhold
778
+ */
779
+ "mhold",
780
+
781
+ /**
782
+ * Mouse wheel is rotated.
783
+ * @event og.Layer#mousewheel
784
+ */
785
+ "mousewheel",
786
+
787
+ /**
788
+ * Triggered when touching moves over the layer.
789
+ * @event og.Layer#touchmove
790
+ */
791
+ "touchmove",
792
+
793
+ /**
794
+ * Triggered when layer begins to touch.
795
+ * @event og.Layer#touchstart
796
+ */
797
+ "touchstart",
798
+
799
+ /**
800
+ * Triggered when layer has finished touching.
801
+ * @event og.Layer#touchend
802
+ */
803
+ "touchend",
804
+
805
+ /**
806
+ * Triggered layer has double touched.
807
+ * @event og.Layer#doubletouch
808
+ */
809
+ "doubletouch",
810
+
811
+ /**
812
+ * Triggered when touching leaves layer borders.
813
+ * @event og.Layer#touchleave
814
+ */
815
+ "touchleave",
816
+
817
+ /**
818
+ * Triggered when touch enters over the layer.
819
+ * @event og.Layer#touchenter
820
+ */
821
+ "touchenter"
822
+ ];
823
+
824
+ export { Layer };