@openglobus/og 0.14.1 → 0.14.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openglobus/og",
3
- "version": "0.14.1",
3
+ "version": "0.14.3",
4
4
  "description": "[OpenGlobus](https://www.openglobus.org/) is a javascript library designed to display interactive 3d maps and planets with map tiles, imagery and vector data, markers and 3d objects. It uses the WebGL technology, open source and completely free.",
5
5
  "directories": {
6
6
  "example": "./sandbox"
@@ -27,6 +27,7 @@ import { XYZ } from "./XYZ.js";
27
27
  * @param {number} [options.height=256] - Tile height.
28
28
  * @param {string} options.layers - WMS layers string.
29
29
  * @param {string} [options.version="1.1.1"] - WMS version.
30
+ * @param {Object} extra - Extra parameters (by WMS rreference or by WMS service vendors) to pass to WMS service.
30
31
  * @example:
31
32
  * new og.layer.WMS("USA States", {
32
33
  * isBaseLayer: false,
@@ -36,16 +37,23 @@ import { XYZ } from "./XYZ.js";
36
37
  * zIndex: 50,
37
38
  * attribution: 'USA states - geoserver WMS example',
38
39
  * version: "1.1.1",
39
- * visibility: false }
40
+ * visibility: false }, {
41
+ * transparent: true,
42
+ * sld: "style.sld"}
40
43
  * );
41
44
  *
42
45
  * @fires og.layer.XYZ#load
43
46
  * @fires og.layer.XYZ#loadend
44
47
  */
45
48
  class WMS extends XYZ {
46
- constructor(name, options) {
49
+
50
+
51
+ constructor(name, options, extra) {
47
52
  super(name, options);
48
53
 
54
+ this._extra = new URLSearchParams(extra).toString();
55
+
56
+
49
57
  if (!options.extent) {
50
58
  this.setExtent(new Extent(new LonLat(-180.0, -90), new LonLat(180.0, 90)));
51
59
  }
@@ -85,10 +93,12 @@ class WMS extends XYZ {
85
93
  srs,
86
94
  bbox,
87
95
  width = 256,
88
- height = 256
96
+ height = 256,
97
+ extra
98
+
89
99
  ) {
90
100
  return `${url}/wms?LAYERS=${layers}&FORMAT=${format}&SERVICE=WMS&VERSION=${version}&REQUEST=${request}
91
- &SRS=${srs}&BBOX=${bbox}&WIDTH=${width}&HEIGHT=${height}`;
101
+ &SRS=${srs}&BBOX=${bbox}&WIDTH=${width}&HEIGHT=${height}&` + extra;
92
102
  }
93
103
 
94
104
  static get_bbox_v1_1_1(extent) {
@@ -133,7 +143,8 @@ class WMS extends XYZ {
133
143
  segment._projection.code,
134
144
  this._getBbox(segment.getExtent()),
135
145
  this.imageWidth,
136
- this.imageHeight
146
+ this.imageHeight,
147
+ this._extra
137
148
  );
138
149
  }
139
150
 
@@ -967,7 +967,10 @@ export class Planet extends RenderNode {
967
967
  this._renderedNodes.length = 0;
968
968
  this._renderedNodes = [];
969
969
 
970
- // clearing nodes in frustums
970
+ this._clearRenderNodesInFrustum();
971
+ }
972
+
973
+ _clearRenderNodesInFrustum() {
971
974
  for (let i = 0, len = this._renderedNodesInFrustum.length; i < len; i++) {
972
975
  this._renderedNodesInFrustum[i].length = 0;
973
976
  this._renderedNodesInFrustum[i] = [];
@@ -998,19 +1001,17 @@ export class Planet extends RenderNode {
998
1001
  this.minCurrZoom = math.MAX;
999
1002
  this.maxCurrZoom = math.MIN;
1000
1003
 
1004
+ this.quadTreeStrategy.collectRenderNodes();
1005
+
1001
1006
  if (cam.slope > this.minEqualZoomCameraSlope && cam._lonLat.height < this.maxEqualZoomAltitude && cam._lonLat.height > this.minEqualZoomAltitude) {
1002
1007
 
1003
1008
  this.minCurrZoom = this.maxCurrZoom;
1004
1009
 
1005
- let temp = this._renderedNodes, rf = this._renderedNodesInFrustum, temp2 = [];
1010
+ let temp = this._renderedNodes,
1011
+ rf = this._renderedNodesInFrustum,
1012
+ temp2 = [];
1006
1013
 
1007
- this._renderedNodes = [];
1008
-
1009
- // clearing nodes in frustums
1010
- for (let i = 0, len = this._renderedNodesInFrustum.length; i < len; i++) {
1011
- this._renderedNodesInFrustum[i].length = 0;
1012
- this._renderedNodesInFrustum[i] = [];
1013
- }
1014
+ this._clearRenderNodesInFrustum();
1014
1015
 
1015
1016
  for (var i = 0, len = temp.length; i < len; i++) {
1016
1017
  var ri = temp[i];
@@ -1035,7 +1036,6 @@ export class Planet extends RenderNode {
1035
1036
  }
1036
1037
  }
1037
1038
 
1038
- this.quadTreeStrategy.collectRenderNodes();
1039
1039
  }
1040
1040
 
1041
1041
  _globalPreDraw() {
@@ -16,6 +16,7 @@
16
16
  * @param {number} [options.height=256] - Tile height.
17
17
  * @param {string} options.layers - WMS layers string.
18
18
  * @param {string} [options.version="1.1.1"] - WMS version.
19
+ * @param {Object} extra - Extra parameters (by WMS rreference or by WMS service vendors) to pass to WMS service.
19
20
  * @example:
20
21
  * new og.layer.WMS("USA States", {
21
22
  * isBaseLayer: false,
@@ -25,17 +26,20 @@
25
26
  * zIndex: 50,
26
27
  * attribution: 'USA states - geoserver WMS example',
27
28
  * version: "1.1.1",
28
- * visibility: false }
29
+ * visibility: false }, {
30
+ * transparent: true,
31
+ * sld: "style.sld"}
29
32
  * );
30
33
  *
31
34
  * @fires og.layer.XYZ#load
32
35
  * @fires og.layer.XYZ#loadend
33
36
  */
34
37
  export class WMS extends XYZ {
35
- static createRequestUrl(url: any, layers: any, format: string, version: string, request: string, srs: any, bbox: any, width?: number, height?: number): string;
38
+ static createRequestUrl(url: any, layers: any, format: string, version: string, request: string, srs: any, bbox: any, width: number, height: number, extra: any): string;
36
39
  static get_bbox_v1_1_1(extent: any): string;
37
40
  static get_bbox_v1_3_0(extent: any): string;
38
- constructor(name: any, options: any);
41
+ constructor(name: any, options: any, extra: any);
42
+ _extra: string;
39
43
  /**
40
44
  * WMS layers string.
41
45
  * @public
@@ -379,6 +379,7 @@ export class Planet extends RenderNode {
379
379
  */
380
380
  protected _sortLayers(): void;
381
381
  _clearRenderedNodeList(): void;
382
+ _clearRenderNodesInFrustum(): void;
382
383
  /**
383
384
  * Collects visible quad nodes.
384
385
  * @protected