@openglobus/og 0.12.4 → 0.13.2

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 +887 -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 +800 -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 +607 -603
  56. package/src/og/shaders/label.js +576 -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 +4 -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,318 +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
-
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
196
  this._pickingEnabled = options.pickingEnabled !== undefined ? options.pickingEnabled : true;
197
197
 
198
- this._isPreloadDone = false;
199
-
200
- /**
201
- * Events handler.
202
- * @public
203
- * @type {Events}
204
- */
205
- this.events = new Events(EVENT_NAMES, this);
206
- }
207
-
208
- static getTMS(x, y, z) {
209
- return {
210
- x: x,
211
- y: (1 << z) - y - 1,
212
- z: z
213
- };
214
- }
215
-
216
- static getTileIndex(...arr) {
217
- return arr.join("_");
218
- }
219
-
220
- static get __layersCounter() {
221
- if (!this.__lcounter && this.__lcounter !== 0) {
222
- this.__lcounter = 0;
223
- }
224
- return this.__lcounter;
225
- }
226
-
227
- static set __layersCounter(n) {
228
- this.__lcounter = n;
229
- }
230
-
231
- static get __requestsCounter() {
232
- return this.__reqcounter;
233
- }
234
-
235
- static set __requestsCounter(v) {
236
- this.__reqcounter = v;
237
- }
238
-
239
- /**
240
- * Maximum loading queries at one time.
241
- * @const
242
- * @type {number}
243
- */
244
- static get MAX_REQUESTS() {
245
- return 7;
246
- }
247
-
248
- get instanceName() {
249
- return "Layer";
250
- }
251
-
252
- get rendererEvents() {
253
- return this.events;
254
- }
255
-
256
- set opacity(opacity) {
257
- if (this._fading) {
258
- if (opacity > this._opacity) {
259
- this._fadingFactor = (opacity - this._opacity) / 2.8;
260
- } else if (opacity < this._opacity) {
261
- this._fadingFactor = (opacity - this._opacity) / 2.8;
262
- }
263
- } else {
264
- this._fadingOpacity = opacity;
265
- }
266
- this._opacity = opacity;
267
- }
268
-
269
- get opacity() {
270
- return this._opacity;
271
- }
272
-
273
- set pickingEnabled(picking) {
274
- this._pickingEnabled = picking ? 1.0 : 0.0;
275
- }
276
-
277
- get pickingEnabled() {
278
- return !!this._pickingEnabled;
279
- }
280
-
281
- /**
282
- * Returns true if a layer has imagery tiles.
283
- * @public
284
- * @virtual
285
- * @returns {boolean} - Imagery tiles flag.
286
- */
287
- hasImageryTiles() {
288
- return this._hasImageryTiles;
289
- }
290
-
291
- /**
292
- * Gets layer identifier.
293
- * @public
294
- * @returns {string} - Layer object id.
295
- */
296
- getID() {
297
- return this._id;
298
- }
299
-
300
- /**
301
- * Compares layers instances.
302
- * @public
303
- * @param {Layer} layer - Layer instance to compare.
304
- * @returns {boolean} - Returns true if the layers is the same instance of the input.
305
- */
306
- isEqual(layer) {
307
- return layer._id === this._id;
308
- }
309
-
310
- /**
311
- * Assign the planet.
312
- * @protected
313
- * @virtual
314
- * @param {Planet} planet - Planet render node.
315
- */
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
+ */
316
318
  _assignPlanet(planet) {
317
319
  // TODO: webgl1
318
320
  if (this._isSRGB) {
@@ -322,455 +324,501 @@ class Layer {
322
324
  }
323
325
 
324
326
  this.createTexture = planet.renderer.handler.createTexture[this._textureFilter];
325
-
326
- planet.layers.push(this);
327
- this._planet = planet;
328
- this.events.on("visibilitychange", planet._onLayerVisibilityChanged, planet);
329
- if (this._isBaseLayer && this._visibility) {
330
- planet.setBaseLayer(this);
331
- }
332
- planet.events.dispatch(planet.events.layeradd, this);
333
- this.events.dispatch(this.events.add, planet);
334
- planet.updateVisibleLayers();
335
- this._bindPicking();
336
- }
337
-
338
- /**
339
- * Assign picking color to the layer.
340
- * @protected
341
- * @virtual
342
- */
343
- _bindPicking() {
344
- this._planet && this._planet.renderer.assignPickingColor(this);
345
- }
346
-
347
- /**
348
- * Adds layer to the planet.
349
- * @public
350
- * @param {Planet} planet - Adds layer to the planet.
351
- */
352
- addTo(planet) {
353
- if (!this._planet) {
354
- this._assignPlanet(planet);
355
- }
356
- return this;
357
- }
358
-
359
- /**
360
- * Removes from planet.
361
- * @public
362
- * @returns {Layer} -This layer.
363
- */
364
- remove() {
365
- var p = this._planet;
366
- if (p) {
367
- for (var i = 0; i < p.layers.length; i++) {
368
- if (this.isEqual(p.layers[i])) {
369
- p.renderer.clearPickingColor(this);
370
- p.layers.splice(i, 1);
371
- p.updateVisibleLayers();
372
- this.clear();
373
- p.events.dispatch(p.events.layerremove, this);
374
- this.events.dispatch(this.events.remove, p);
375
- this._planet = null;
376
- return this;
377
- }
378
- }
379
- }
380
- return this;
381
- }
382
-
383
- /**
384
- * Clears layer material.
385
- * @virtual
386
- */
387
- 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() {
388
395
  if (this._planet) {
389
396
  this._planet._clearLayerMaterial(this);
390
397
  this._internalFormat = null;
391
398
  this.createTexture = null;
392
- }
393
- }
394
-
395
- /**
396
- * Returns planet instance.
397
- * @virtual
398
- */
399
- get planet() {
400
- return this._planet;
401
- }
402
-
403
- /**
404
- * Sets layer attribution text.
405
- * @public
406
- * @param {string} html - HTML code that represents layer attribution, it could be just a text.
407
- */
408
- setAttribution(html) {
409
- this._attribution = html;
410
- this._planet && this._planet.updateAttributionsList();
411
- }
412
-
413
- /**
414
- * Sets height over the ground.
415
- * @public
416
- * @param {number} height - Layer height.
417
- */
418
- setHeight(height) {
419
- this._height = height;
420
- this._planet && this._planet.updateVisibleLayers();
421
- }
422
-
423
- /**
424
- * Gets layer height.
425
- * @public
426
- * @returns {number} -
427
- */
428
- getHeight() {
429
- return this._height;
430
- }
431
-
432
- /**
433
- * Sets z-index.
434
- * @public
435
- * @param {number} zIndex - Layer z-index.
436
- */
437
- setZIndex(zIndex) {
438
- this._zIndex = zIndex;
439
- this._planet && this._planet.updateVisibleLayers();
440
- }
441
-
442
- /**
443
- * Gets z-index.
444
- * @public
445
- * @returns {number} -
446
- */
447
- getZIndex() {
448
- return this._zIndex;
449
- }
450
-
451
- /**
452
- * Set zIndex to the maximal value depend on other layers on the planet.
453
- * @public
454
- */
455
- bringToFront() {
456
- if (this._planet) {
457
- var vl = this._planet.visibleTileLayers;
458
- var l = vl[vl.length - 1];
459
- if (!l.isEqual(this)) {
460
- this.setZIndex(l.getZIndex() + 1);
461
- }
462
- }
463
- }
464
-
465
- /**
466
- * Returns true if the layer is a base.
467
- * @public
468
- * @returns {boolean} - Base layer flag.
469
- */
470
- isBaseLayer() {
471
- return this._isBaseLayer;
472
- }
473
-
474
- /**
475
- * Sets base layer type true.
476
- * @public
477
- * @param {boolean} flag - Base layer flag.
478
- */
479
- setBaseLayer(flag) {
480
- this._isBaseLayer = flag;
481
- if (this._planet) {
482
- if (!flag && this.isEqual(this._planet.baseLayer)) {
483
- this._planet.baseLayer = null;
484
- }
485
- this._planet.updateVisibleLayers();
486
- }
487
- }
488
-
489
- /**
490
- * Sets layer visibility.
491
- * @public
492
- * @virtual
493
- * @param {boolean} visibility - Layer visibility.
494
- */
495
- setVisibility(visibility) {
496
- if (visibility !== this._visibility) {
497
- this._visibility = visibility;
498
- if (this._planet) {
499
- if (this._isBaseLayer && visibility) {
500
- this._planet.setBaseLayer(this);
501
- }
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
+ }
502
509
  this._planet.updateVisibleLayers();
503
510
  if (visibility && !this._isPreloadDone && !this.isVector) {
504
511
  this._isPreloadDone = true;
505
- //TODO: make individual preload
506
- this._planet._preLoad();
512
+ this._preLoad();
507
513
  }
508
- }
509
- this.events.dispatch(this.events.visibilitychange, this);
510
- }
511
- }
512
-
513
- /**
514
- * Gets layer visibility.
515
- * @public
516
- * @returns {boolean} - Layer visibility.
517
- */
518
- getVisibility() {
519
- return this._visibility;
520
- }
521
-
522
- /**
523
- * Sets visible geographical extent.
524
- * @public
525
- * @param {Extent} extent - Layer visible geographical extent.
526
- */
527
- setExtent(extent) {
528
- var sw = extent.southWest.clone(),
529
- ne = extent.northEast.clone();
530
- if (sw.lat < mercator.MIN_LAT) {
531
- sw.lat = mercator.MIN_LAT;
532
- }
533
- if (ne.lat > mercator.MAX_LAT) {
534
- ne.lat = mercator.MAX_LAT;
535
- }
536
- this._extent = extent.clone();
537
- this._extentMerc = new Extent(sw.forwardMercator(), ne.forwardMercator());
538
- this._correctFullExtent();
539
- }
540
-
541
- /**
542
- * Gets layer extent.
543
- * @public
544
- * @return {Extent} - Layer geodetic extent.
545
- */
546
- getExtent() {
547
- return this._extent;
548
- }
549
-
550
- /**
551
- * Special correction of the whole globe extent.
552
- * @protected
553
- */
554
- _correctFullExtent() {
555
- // var e = this._extent,
556
- // em = this._extentMerc;
557
- // var ENLARGE_MERCATOR_LON = og.mercator.POLE + 50000;
558
- // var ENLARGE_MERCATOR_LAT = og.mercator.POLE + 50000;
559
- // if (e.northEast.lat === 90.0) {
560
- // em.northEast.lat = ENLARGE_MERCATOR_LAT;
561
- // }
562
- // if (e.northEast.lon === 180.0) {
563
- // em.northEast.lon = ENLARGE_MERCATOR_LON;
564
- // }
565
- // if (e.southWest.lat === -90.0) {
566
- // em.southWest.lat = -ENLARGE_MERCATOR_LAT;
567
- // }
568
- // if (e.southWest.lon === -180.0) {
569
- // em.southWest.lon = -ENLARGE_MERCATOR_LON;
570
- // }
571
- }
572
-
573
- _refreshFadingOpacity() {
574
- var p = this._planet;
575
- if (
576
- this._visibility &&
577
- p._viewExtent &&
578
- p._viewExtent.overlaps(this._extent) &&
579
- p.maxCurrZoom >= this.minZoom &&
580
- p.minCurrZoom <= this.maxZoom
581
- ) {
582
- this._fadingOpacity += this._fadingFactor;
583
-
584
- if (
585
- (this._fadingFactor > 0.0 && this._fadingOpacity > this._opacity) ||
586
- (this._fadingFactor < 0.0 && this._fadingOpacity < this._opacity)
587
- ) {
588
- this._fadingOpacity = this._opacity;
589
- }
590
- return false;
591
- } else {
592
- this._fadingOpacity -= FADING_FACTOR;
593
-
594
- if (this._fadingOpacity < 0.0) {
595
- this._fadingOpacity = 0.0;
596
- return !this._visibility;
597
- }
598
- }
599
- }
600
-
601
- createMaterial(segment) {
602
- return new Material(segment, this);
603
- }
604
- }
605
-
606
- const EVENT_NAMES = [
607
- /**
608
- * Triggered when layer visibilty chanched.
609
- * @event og.Layer#visibilitychange
610
- */
611
- "visibilitychange",
612
-
613
- /**
614
- * Triggered when layer has added to the planet.
615
- * @event og.Layer#add
616
- */
617
- "add",
618
-
619
- /**
620
- * Triggered when layer has removed from the planet.
621
- * @event og.Layer#remove
622
- */
623
- "remove",
624
-
625
- /**
626
- * Triggered when mouse moves over the layer.
627
- * @event og.Layer#mousemove
628
- */
629
- "mousemove",
630
-
631
- /**
632
- * Triggered when mouse has entered over the layer.
633
- * @event og.Layer#mouseenter
634
- */
635
- "mouseenter",
636
-
637
- /**
638
- * Triggered when mouse leaves the layer.
639
- * @event og.Layer#mouseenter
640
- */
641
- "mouseleave",
642
-
643
- /**
644
- * Mouse left button clicked.
645
- * @event og.Layer#lclick
646
- */
647
- "lclick",
648
-
649
- /**
650
- * Mouse right button clicked.
651
- * @event og.Layer#rclick
652
- */
653
- "rclick",
654
-
655
- /**
656
- * Mouse right button clicked.
657
- * @event og.Layer#mclick
658
- */
659
- "mclick",
660
-
661
- /**
662
- * Mouse left button double click.
663
- * @event og.Layer#ldblclick
664
- */
665
- "ldblclick",
666
-
667
- /**
668
- * Mouse right button double click.
669
- * @event og.Layer#rdblclick
670
- */
671
- "rdblclick",
672
-
673
- /**
674
- * Mouse middle button double click.
675
- * @event og.Layer#mdblclick
676
- */
677
- "mdblclick",
678
-
679
- /**
680
- * Mouse left button up(stop pressing).
681
- * @event og.Layer#lup
682
- */
683
- "lup",
684
-
685
- /**
686
- * Mouse right button up(stop pressing).
687
- * @event og.Layer#rup
688
- */
689
- "rup",
690
-
691
- /**
692
- * Mouse middle button up(stop pressing).
693
- * @event og.Layer#mup
694
- */
695
- "mup",
696
-
697
- /**
698
- * Mouse left button is just pressed down(start pressing).
699
- * @event og.Layer#ldown
700
- */
701
- "ldown",
702
-
703
- /**
704
- * Mouse right button is just pressed down(start pressing).
705
- * @event og.Layer#rdown
706
- */
707
- "rdown",
708
-
709
- /**
710
- * Mouse middle button is just pressed down(start pressing).
711
- * @event og.Layer#mdown
712
- */
713
- "mdown",
714
-
715
- /**
716
- * Mouse left button is pressing.
717
- * @event og.Layer#lhold
718
- */
719
- "lhold",
720
-
721
- /**
722
- * Mouse right button is pressing.
723
- * @event og.Layer#rhold
724
- */
725
- "rhold",
726
-
727
- /**
728
- * Mouse middle button is pressing.
729
- * @event og.Layer#mhold
730
- */
731
- "mhold",
732
-
733
- /**
734
- * Mouse wheel is rotated.
735
- * @event og.Layer#mousewheel
736
- */
737
- "mousewheel",
738
-
739
- /**
740
- * Triggered when touching moves over the layer.
741
- * @event og.Layer#touchmove
742
- */
743
- "touchmove",
744
-
745
- /**
746
- * Triggered when layer begins to touch.
747
- * @event og.Layer#touchstart
748
- */
749
- "touchstart",
750
-
751
- /**
752
- * Triggered when layer has finished touching.
753
- * @event og.Layer#touchend
754
- */
755
- "touchend",
756
-
757
- /**
758
- * Triggered layer has double touched.
759
- * @event og.Layer#doubletouch
760
- */
761
- "doubletouch",
762
-
763
- /**
764
- * Triggered when touching leaves layer borders.
765
- * @event og.Layer#touchleave
766
- */
767
- "touchleave",
768
-
769
- /**
770
- * Triggered when touch enters over the layer.
771
- * @event og.Layer#touchenter
772
- */
773
- "touchenter"
774
- ];
775
-
776
- 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 };