@openglobus/og 0.11.2 → 0.11.7
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 +13 -13
- package/src/og/Clock.js +10 -10
- package/src/og/Events.js +8 -6
- package/src/og/Extent.js +82 -41
- package/src/og/Globe.js +25 -13
- package/src/og/ImageCanvas.js +22 -16
- package/src/og/LonLat.js +16 -13
- package/src/og/Popup.js +21 -14
- package/src/og/QueueArray.js +6 -2
- package/src/og/Rectangle.js +11 -6
- package/src/og/Stack.js +5 -2
- package/src/og/ajax.js +21 -33
- package/src/og/astro/astro.js +5 -5
- package/src/og/astro/earth.js +22 -16
- package/src/og/astro/jd.js +23 -18
- package/src/og/astro/orbit.js +13 -11
- package/src/og/astro/rotation.js +17 -8
- package/src/og/bv/Box.js +7 -3
- package/src/og/bv/Sphere.js +14 -11
- package/src/og/camera/Camera.js +51 -54
- package/src/og/camera/Frustum.js +29 -18
- package/src/og/camera/PlanetCamera.js +32 -23
- package/src/og/control/CompassButton.js +5 -1
- package/src/og/control/Control.js +12 -10
- package/src/og/control/DebugInfo.js +4 -1
- package/src/og/control/EarthCoordinates.js +54 -33
- package/src/og/control/KeyboardNavigation.js +10 -10
- package/src/og/control/LayerSwitcher.js +22 -21
- package/src/og/control/Lighting.js +34 -3
- package/src/og/control/MouseNavigation.js +1 -1
- package/src/og/control/ScaleControl.js +1 -1
- package/src/og/control/SegmentBoundVisualization.js +6 -7
- package/src/og/control/ShowFps.js +13 -8
- package/src/og/control/SimpleNavigation.js +6 -8
- package/src/og/control/Sun.js +25 -15
- package/src/og/control/ToggleWireframe.js +4 -4
- package/src/og/control/TouchNavigation.js +44 -33
- package/src/og/control/ZoomControl.js +41 -25
- package/src/og/ellipsoid/Ellipsoid.js +162 -66
- package/src/og/ellipsoid/wgs84.js +4 -4
- package/src/og/entity/BaseBillboard.js +100 -56
- package/src/og/entity/Billboard.js +14 -10
- package/src/og/entity/BillboardHandler.js +317 -60
- package/src/og/entity/Entity.js +100 -68
- package/src/og/entity/EntityCollection.js +70 -47
- package/src/og/entity/GeoObject.js +228 -0
- package/src/og/entity/GeoObjectHandler.js +910 -0
- package/src/og/entity/Geometry.js +27 -24
- package/src/og/entity/GeometryHandler.js +596 -124
- package/src/og/entity/Label.js +80 -49
- package/src/og/entity/LabelHandler.js +45 -244
- package/src/og/entity/LabelWorker.js +218 -0
- package/src/og/entity/Object3d.js +504 -0
- package/src/og/entity/PointCloud.js +80 -32
- package/src/og/entity/PointCloudHandler.js +8 -8
- package/src/og/entity/Polyline.js +16 -16
- package/src/og/entity/Ray.js +60 -27
- package/src/og/entity/Strip.js +77 -48
- package/src/og/entity/StripHandler.js +26 -26
- package/src/og/entity/index.js +8 -16
- package/src/og/layer/BaseGeoImage.js +54 -23
- package/src/og/layer/CanvasTiles.js +24 -24
- package/src/og/layer/GeoImage.js +9 -9
- package/src/og/layer/GeoVideo.js +3 -3
- package/src/og/layer/KML.js +63 -37
- package/src/og/layer/Layer.js +44 -21
- package/src/og/layer/Material.js +23 -20
- package/src/og/layer/Vector.js +114 -68
- package/src/og/layer/WMS.js +34 -17
- package/src/og/layer/XYZ.js +48 -46
- package/src/og/light/LightSource.js +46 -39
- package/src/og/math/Mat3.js +34 -22
- package/src/og/math/Mat4.js +603 -459
- package/src/og/math/Plane.js +21 -20
- package/src/og/math/Quat.js +182 -139
- package/src/og/math/Ray.js +38 -33
- package/src/og/math/Vec2.js +85 -75
- package/src/og/math/Vec3.js +142 -112
- package/src/og/math/Vec4.js +27 -31
- package/src/og/math/coder.js +10 -10
- package/src/og/math.js +12 -12
- package/src/og/proj/EPSG3857.js +4 -4
- package/src/og/proj/EPSG4326.js +4 -4
- package/src/og/proj/Proj.js +4 -6
- package/src/og/quadTree/Node.js +8 -8
- package/src/og/renderer/Renderer.js +59 -52
- package/src/og/renderer/RendererEvents.js +50 -27
- package/src/og/scene/BaseNode.js +7 -8
- package/src/og/scene/Planet.js +102 -103
- package/src/og/scene/RenderNode.js +28 -21
- package/src/og/segment/Segment.js +26 -21
- package/src/og/segment/SegmentLonLat.js +5 -5
- package/src/og/shaders/drawnode.js +135 -142
- package/src/og/shaders/geoObject.js +211 -0
- package/src/og/shaders/pointCloud.js +41 -41
- package/src/og/shaders/shape.js +12 -18
- package/src/og/shaders/skybox.js +36 -36
- package/src/og/shaders/toneMapping.js +1 -0
- package/src/og/shapes/BaseShape.js +126 -54
- package/src/og/shapes/Icosphere.js +29 -14
- package/src/og/shapes/Sphere.js +12 -15
- package/src/og/terrain/BilTerrain.js +1 -0
- package/src/og/terrain/EmptyTerrain.js +2 -2
- package/src/og/terrain/GlobusTerrain.js +9 -9
- package/src/og/utils/FontAtlas.js +6 -2
- package/src/og/utils/TextureAtlas.js +22 -24
- package/src/og/utils/VectorTileCreator.js +1 -3
- package/src/og/utils/shared.js +16 -16
- package/src/og/webgl/Framebuffer.js +88 -40
- package/src/og/webgl/Handler.js +243 -169
- package/src/og/webgl/Multisample.js +47 -19
- package/src/og/webgl/Program.js +79 -34
- package/src/og/webgl/ProgramController.js +17 -13
- package/src/og/webgl/callbacks.js +8 -8
- package/src/og/inherits.js +0 -8
- package/src/og/utils/polylabel.js +0 -176
- package/types/Clock.d.ts +0 -90
- package/types/Deferred.d.ts +0 -6
- package/types/Events.d.ts +0 -73
- package/types/Extent.d.ts +0 -166
- package/types/Globe.d.ts +0 -75
- package/types/ImageCanvas.d.ts +0 -121
- package/types/Lock.d.ts +0 -12
- package/types/LonLat.d.ts +0 -108
- package/types/Popup.d.ts +0 -38
- package/types/QueueArray.d.ts +0 -15
- package/types/Rectangle.d.ts +0 -74
- package/types/Stack.d.ts +0 -15
- package/types/ajax.d.ts +0 -24
- package/types/arial.d.ts +0 -48
- package/types/astro/astro.d.ts +0 -38
- package/types/astro/earth.d.ts +0 -6
- package/types/astro/jd.d.ts +0 -254
- package/types/bv/Box.d.ts +0 -25
- package/types/bv/Sphere.d.ts +0 -38
- package/types/bv/index.d.ts +0 -3
- package/types/camera/Camera.d.ts +0 -303
- package/types/camera/Frustum.d.ts +0 -129
- package/types/camera/PlanetCamera.d.ts +0 -223
- package/types/camera/index.d.ts +0 -3
- package/types/cons.d.ts +0 -40
- package/types/control/CompassButton.d.ts +0 -18
- package/types/control/Control.d.ts +0 -101
- package/types/control/DebugInfo.d.ts +0 -16
- package/types/control/EarthCoordinates.d.ts +0 -47
- package/types/control/EarthNavigation.d.ts +0 -42
- package/types/control/GeoImageDragControl.d.ts +0 -6
- package/types/control/KeyboardNavigation.d.ts +0 -22
- package/types/control/LayerSwitcher.d.ts +0 -23
- package/types/control/Lighting.d.ts +0 -16
- package/types/control/MouseNavigation.d.ts +0 -51
- package/types/control/ScaleControl.d.ts +0 -22
- package/types/control/ShowFps.d.ts +0 -12
- package/types/control/SimpleNavigation.d.ts +0 -28
- package/types/control/Sun.d.ts +0 -52
- package/types/control/ToggleWireframe.d.ts +0 -12
- package/types/control/TouchNavigation.d.ts +0 -50
- package/types/control/ZoomControl.d.ts +0 -28
- package/types/control/index.d.ts +0 -17
- package/types/ellipsoid/Ellipsoid.d.ts +0 -142
- package/types/ellipsoid/index.d.ts +0 -3
- package/types/ellipsoid/wgs84.d.ts +0 -5
- package/types/entity/BaseBillboard.d.ts +0 -208
- package/types/entity/Billboard.d.ts +0 -94
- package/types/entity/BillboardHandler.d.ts +0 -74
- package/types/entity/Entity.d.ts +0 -331
- package/types/entity/EntityCollection.d.ts +0 -303
- package/types/entity/Geometry.d.ts +0 -73
- package/types/entity/GeometryHandler.d.ts +0 -76
- package/types/entity/Label.d.ts +0 -194
- package/types/entity/LabelHandler.d.ts +0 -24
- package/types/entity/PointCloud.d.ts +0 -174
- package/types/entity/PointCloudHandler.d.ts +0 -38
- package/types/entity/Polyline.d.ts +0 -304
- package/types/entity/PolylineHandler.d.ts +0 -18
- package/types/entity/Ray.d.ts +0 -123
- package/types/entity/RayHandler.d.ts +0 -67
- package/types/entity/ShapeHandler.d.ts +0 -22
- package/types/entity/Strip.d.ts +0 -118
- package/types/entity/StripHandler.d.ts +0 -38
- package/types/entity/index.d.ts +0 -8
- package/types/index.core.d.ts +0 -65
- package/types/index.d.ts +0 -45
- package/types/index.webgl.d.ts +0 -7
- package/types/inherits.d.ts +0 -4
- package/types/input/KeyboardHandler.d.ts +0 -10
- package/types/input/MouseHandler.d.ts +0 -5
- package/types/input/TouchHandler.d.ts +0 -5
- package/types/input/input.d.ts +0 -34
- package/types/layer/BaseGeoImage.d.ts +0 -107
- package/types/layer/CanvasTiles.d.ts +0 -75
- package/types/layer/GeoImage.d.ts +0 -65
- package/types/layer/GeoTexture2d.d.ts +0 -8
- package/types/layer/GeoVideo.d.ts +0 -80
- package/types/layer/KML.d.ts +0 -58
- package/types/layer/Layer.d.ts +0 -321
- package/types/layer/Material.d.ts +0 -48
- package/types/layer/Vector.d.ts +0 -228
- package/types/layer/WMS.d.ts +0 -66
- package/types/layer/XYZ.d.ts +0 -130
- package/types/layer/index.d.ts +0 -10
- package/types/light/LightSource.d.ts +0 -177
- package/types/math/Line2.d.ts +0 -11
- package/types/math/Line3.d.ts +0 -10
- package/types/math/Mat3.d.ts +0 -63
- package/types/math/Mat4.d.ts +0 -173
- package/types/math/Plane.d.ts +0 -17
- package/types/math/Quat.d.ts +0 -376
- package/types/math/Ray.d.ts +0 -81
- package/types/math/Vec2.d.ts +0 -308
- package/types/math/Vec3.d.ts +0 -459
- package/types/math/Vec4.d.ts +0 -161
- package/types/math/coder.d.ts +0 -42
- package/types/math/index.d.ts +0 -11
- package/types/math.d.ts +0 -261
- package/types/mercator.d.ts +0 -92
- package/types/proj/EPSG3857.d.ts +0 -5
- package/types/proj/EPSG4326.d.ts +0 -5
- package/types/proj/Proj.d.ts +0 -42
- package/types/quadTree/EntityCollectionNode.d.ts +0 -34
- package/types/quadTree/Node.d.ts +0 -61
- package/types/quadTree/quadTree.d.ts +0 -40
- package/types/renderer/Renderer.d.ts +0 -296
- package/types/renderer/RendererEvents.d.ts +0 -230
- package/types/res/images.d.ts +0 -3
- package/types/scene/Axes.d.ts +0 -11
- package/types/scene/BaseNode.d.ts +0 -60
- package/types/scene/Planet.d.ts +0 -574
- package/types/scene/RenderNode.d.ts +0 -143
- package/types/scene/SkyBox.d.ts +0 -10
- package/types/scene/index.d.ts +0 -4
- package/types/segment/Segment.d.ts +0 -271
- package/types/segment/SegmentLonLat.d.ts +0 -62
- package/types/segment/segmentHelper.d.ts +0 -13
- package/types/shaders/billboard.d.ts +0 -3
- package/types/shaders/depth.d.ts +0 -2
- package/types/shaders/drawnode.d.ts +0 -7
- package/types/shaders/label.d.ts +0 -4
- package/types/shaders/pointCloud.d.ts +0 -2
- package/types/shaders/polyline.d.ts +0 -3
- package/types/shaders/ray.d.ts +0 -2
- package/types/shaders/screenFrame.d.ts +0 -2
- package/types/shaders/shape.d.ts +0 -4
- package/types/shaders/skybox.d.ts +0 -2
- package/types/shaders/toneMapping.d.ts +0 -2
- package/types/shapes/BaseShape.d.ts +0 -247
- package/types/shapes/Sphere.d.ts +0 -41
- package/types/terrain/BilTerrain.d.ts +0 -8
- package/types/terrain/EmptyTerrain.d.ts +0 -72
- package/types/terrain/Geoid.d.ts +0 -26
- package/types/terrain/GlobusTerrain.d.ts +0 -153
- package/types/terrain/MapboxTerrain.d.ts +0 -8
- package/types/terrain/index.d.ts +0 -5
- package/types/utils/FontAtlas.d.ts +0 -14
- package/types/utils/GeoImageCreator.d.ts +0 -30
- package/types/utils/ImagesCacheManager.d.ts +0 -10
- package/types/utils/Loader.d.ts +0 -25
- package/types/utils/NormalMapCreator.d.ts +0 -39
- package/types/utils/PlainSegmentWorker.d.ts +0 -10
- package/types/utils/TerrainWorker.d.ts +0 -9
- package/types/utils/TextureAtlas.d.ts +0 -111
- package/types/utils/VectorTileCreator.d.ts +0 -16
- package/types/utils/colorTable.d.ts +0 -143
- package/types/utils/earcut.d.ts +0 -6
- package/types/utils/shared.d.ts +0 -230
- package/types/webgl/Framebuffer.d.ts +0 -135
- package/types/webgl/Handler.d.ts +0 -372
- package/types/webgl/Multisample.d.ts +0 -89
- package/types/webgl/Program.d.ts +0 -155
- package/types/webgl/ProgramController.d.ts +0 -84
- package/types/webgl/callbacks.d.ts +0 -1
- package/types/webgl/index.d.ts +0 -6
- package/types/webgl/types.d.ts +0 -2
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* @module og/webgl/Multisample
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
"use strict";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Class represents multisample framebuffer.
|
|
9
9
|
* @class
|
|
10
|
-
* @param {
|
|
10
|
+
* @param {Handler} handler - WebGL handler.
|
|
11
11
|
* @param {Object} [options] - Framebuffer options:
|
|
12
12
|
* @param {number} [options.width] - Framebuffer width. Default is handler canvas width.
|
|
13
13
|
* @param {number} [options.height] - Framebuffer height. Default is handler canvas height.
|
|
@@ -16,19 +16,19 @@
|
|
|
16
16
|
* @param {Boolean} [options.useDepth] - Using depth buffer during the rendering.
|
|
17
17
|
*/
|
|
18
18
|
export class Multisample {
|
|
19
|
-
|
|
20
19
|
constructor(handler, options) {
|
|
21
|
-
|
|
22
20
|
options = options || {};
|
|
23
21
|
|
|
24
22
|
/**
|
|
25
23
|
* WebGL handler.
|
|
26
24
|
* @public
|
|
27
|
-
* @type {
|
|
25
|
+
* @type {Handler}
|
|
28
26
|
*/
|
|
29
27
|
this.handler = handler;
|
|
30
28
|
|
|
31
|
-
this._internalFormat = options.internalFormat
|
|
29
|
+
this._internalFormat = options.internalFormat
|
|
30
|
+
? options.internalFormat.toUpperCase()
|
|
31
|
+
: "RGBA8";
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Framebuffer object.
|
|
@@ -62,10 +62,11 @@ export class Multisample {
|
|
|
62
62
|
|
|
63
63
|
this._useDepth = options.useDepth != undefined ? options.useDepth : true;
|
|
64
64
|
|
|
65
|
-
this._depthComponent =
|
|
65
|
+
this._depthComponent =
|
|
66
|
+
options.depthComponent != undefined ? options.depthComponent : "DEPTH_COMPONENT16";
|
|
66
67
|
|
|
67
68
|
/**
|
|
68
|
-
* Framebuffer activity.
|
|
69
|
+
* Framebuffer activity.
|
|
69
70
|
* @private
|
|
70
71
|
* @type {boolean}
|
|
71
72
|
*/
|
|
@@ -102,7 +103,6 @@ export class Multisample {
|
|
|
102
103
|
* @private
|
|
103
104
|
*/
|
|
104
105
|
init() {
|
|
105
|
-
|
|
106
106
|
var gl = this.handler.gl;
|
|
107
107
|
|
|
108
108
|
this._glFilter = gl[this._filter];
|
|
@@ -115,8 +115,19 @@ export class Multisample {
|
|
|
115
115
|
for (var i = 0; i < this.renderbuffers.length; i++) {
|
|
116
116
|
let rb = gl.createRenderbuffer();
|
|
117
117
|
gl.bindRenderbuffer(gl.RENDERBUFFER, rb);
|
|
118
|
-
gl.renderbufferStorageMultisample(
|
|
119
|
-
|
|
118
|
+
gl.renderbufferStorageMultisample(
|
|
119
|
+
gl.RENDERBUFFER,
|
|
120
|
+
this._msaa,
|
|
121
|
+
gl[this._internalFormat],
|
|
122
|
+
this._width,
|
|
123
|
+
this._height
|
|
124
|
+
);
|
|
125
|
+
gl.framebufferRenderbuffer(
|
|
126
|
+
gl.FRAMEBUFFER,
|
|
127
|
+
gl.COLOR_ATTACHMENT0 + i,
|
|
128
|
+
gl.RENDERBUFFER,
|
|
129
|
+
rb
|
|
130
|
+
);
|
|
120
131
|
colorAttachments.push(gl.COLOR_ATTACHMENT0 + i);
|
|
121
132
|
this.renderbuffers[i] = rb;
|
|
122
133
|
gl.bindRenderbuffer(gl.RENDERBUFFER, null);
|
|
@@ -126,8 +137,19 @@ export class Multisample {
|
|
|
126
137
|
if (this._useDepth) {
|
|
127
138
|
this._depthRenderbuffer = gl.createRenderbuffer();
|
|
128
139
|
gl.bindRenderbuffer(gl.RENDERBUFFER, this._depthRenderbuffer);
|
|
129
|
-
gl.renderbufferStorageMultisample(
|
|
130
|
-
|
|
140
|
+
gl.renderbufferStorageMultisample(
|
|
141
|
+
gl.RENDERBUFFER,
|
|
142
|
+
this._msaa,
|
|
143
|
+
gl[this._depthComponent],
|
|
144
|
+
this._width,
|
|
145
|
+
this._height
|
|
146
|
+
);
|
|
147
|
+
gl.framebufferRenderbuffer(
|
|
148
|
+
gl.FRAMEBUFFER,
|
|
149
|
+
gl.DEPTH_ATTACHMENT,
|
|
150
|
+
gl.RENDERBUFFER,
|
|
151
|
+
this._depthRenderbuffer
|
|
152
|
+
);
|
|
131
153
|
gl.bindRenderbuffer(gl.RENDERBUFFER, null);
|
|
132
154
|
}
|
|
133
155
|
|
|
@@ -137,7 +159,6 @@ export class Multisample {
|
|
|
137
159
|
}
|
|
138
160
|
|
|
139
161
|
blitTo(framebuffer, attachmentIndex = 0) {
|
|
140
|
-
|
|
141
162
|
let gl = this.handler.gl;
|
|
142
163
|
|
|
143
164
|
gl.bindFramebuffer(gl.READ_FRAMEBUFFER, this._fbo);
|
|
@@ -147,9 +168,16 @@ export class Multisample {
|
|
|
147
168
|
gl.clearBufferfv(gl.COLOR, 0, [0.0, 0.0, 0.0, 1.0]);
|
|
148
169
|
|
|
149
170
|
gl.blitFramebuffer(
|
|
150
|
-
0,
|
|
151
|
-
0,
|
|
152
|
-
|
|
171
|
+
0,
|
|
172
|
+
0,
|
|
173
|
+
this._width,
|
|
174
|
+
this._height,
|
|
175
|
+
0,
|
|
176
|
+
0,
|
|
177
|
+
framebuffer._width,
|
|
178
|
+
framebuffer._height,
|
|
179
|
+
gl.COLOR_BUFFER_BIT,
|
|
180
|
+
this._glFilter
|
|
153
181
|
);
|
|
154
182
|
|
|
155
183
|
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
|
|
@@ -193,7 +221,7 @@ export class Multisample {
|
|
|
193
221
|
/**
|
|
194
222
|
* Activate framebuffer frame to draw.
|
|
195
223
|
* @public
|
|
196
|
-
* @returns {
|
|
224
|
+
* @returns {Framebuffer} Returns Current framebuffer.
|
|
197
225
|
*/
|
|
198
226
|
activate() {
|
|
199
227
|
var gl = this.handler.gl;
|
|
@@ -229,4 +257,4 @@ export class Multisample {
|
|
|
229
257
|
gl.viewport(0, 0, h.canvas.width, h.canvas.height);
|
|
230
258
|
}
|
|
231
259
|
}
|
|
232
|
-
}
|
|
260
|
+
}
|
package/src/og/webgl/Program.js
CHANGED
|
@@ -2,20 +2,13 @@
|
|
|
2
2
|
* @module og/webgl/Program
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
"use strict";
|
|
6
6
|
|
|
7
|
-
import { callbacks } from
|
|
8
|
-
import { cons } from
|
|
9
|
-
import { typeStr } from
|
|
7
|
+
import { callbacks } from "./callbacks.js";
|
|
8
|
+
import { cons } from "../cons.js";
|
|
9
|
+
import { typeStr, types } from "./types.js";
|
|
10
10
|
|
|
11
|
-
const itemTypes = [
|
|
12
|
-
"BYTE",
|
|
13
|
-
"SHORT",
|
|
14
|
-
"UNSIGNED_BYTE",
|
|
15
|
-
"UNSIGNED_SHORT",
|
|
16
|
-
"FLOAT",
|
|
17
|
-
"HALF_FLOAT"
|
|
18
|
-
];
|
|
11
|
+
const itemTypes = ["BYTE", "SHORT", "UNSIGNED_BYTE", "UNSIGNED_SHORT", "FLOAT", "HALF_FLOAT"];
|
|
19
12
|
|
|
20
13
|
/**
|
|
21
14
|
* Represents more comfortable using WebGL shader program.
|
|
@@ -46,9 +39,11 @@ class Program {
|
|
|
46
39
|
*/
|
|
47
40
|
this._attributes = {};
|
|
48
41
|
for (let t in material.attributes) {
|
|
49
|
-
if (
|
|
50
|
-
typeof
|
|
51
|
-
|
|
42
|
+
if (
|
|
43
|
+
typeof material.attributes[t] === "string" ||
|
|
44
|
+
typeof material.attributes[t] === "number"
|
|
45
|
+
) {
|
|
46
|
+
this._attributes[t] = { type: material.attributes[t] };
|
|
52
47
|
} else {
|
|
53
48
|
this._attributes[t] = material.attributes[t];
|
|
54
49
|
}
|
|
@@ -61,9 +56,11 @@ class Program {
|
|
|
61
56
|
*/
|
|
62
57
|
this._uniforms = {};
|
|
63
58
|
for (let t in material.uniforms) {
|
|
64
|
-
if (
|
|
65
|
-
typeof
|
|
66
|
-
|
|
59
|
+
if (
|
|
60
|
+
typeof material.uniforms[t] === "string" ||
|
|
61
|
+
typeof material.uniforms[t] === "number"
|
|
62
|
+
) {
|
|
63
|
+
this._uniforms[t] = { type: material.uniforms[t] };
|
|
67
64
|
} else {
|
|
68
65
|
this._uniforms[t] = material.uniforms[t];
|
|
69
66
|
}
|
|
@@ -117,18 +114,32 @@ class Program {
|
|
|
117
114
|
* @type {Array.<Object>}
|
|
118
115
|
*/
|
|
119
116
|
this._attribArrays = [];
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Program attributes divisor.
|
|
120
|
+
* @private
|
|
121
|
+
* @type {Array.<Object>}
|
|
122
|
+
*/
|
|
123
|
+
this._attribDivisor = [];
|
|
120
124
|
}
|
|
121
125
|
|
|
122
126
|
/**
|
|
123
127
|
* Bind program buffer.
|
|
124
128
|
* @function
|
|
125
|
-
* @param {
|
|
129
|
+
* @param {Program} program - Used program.
|
|
126
130
|
* @param {Object} variable - Variable represents buffer data.
|
|
127
131
|
*/
|
|
128
132
|
static bindBuffer(program, variable) {
|
|
129
133
|
var gl = program.gl;
|
|
130
134
|
gl.bindBuffer(gl.ARRAY_BUFFER, variable.value);
|
|
131
|
-
gl.vertexAttribPointer(
|
|
135
|
+
gl.vertexAttribPointer(
|
|
136
|
+
variable._pName,
|
|
137
|
+
variable.value.itemSize,
|
|
138
|
+
variable.itemType,
|
|
139
|
+
variable.normalized,
|
|
140
|
+
0,
|
|
141
|
+
0
|
|
142
|
+
);
|
|
132
143
|
}
|
|
133
144
|
|
|
134
145
|
/**
|
|
@@ -196,7 +207,9 @@ class Program {
|
|
|
196
207
|
this.gl.shaderSource(shader, src);
|
|
197
208
|
this.gl.compileShader(shader);
|
|
198
209
|
if (!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS)) {
|
|
199
|
-
cons.logErr(
|
|
210
|
+
cons.logErr(
|
|
211
|
+
"og/Program/Program:" + this.name + " - " + this.gl.getShaderInfoLog(shader) + "."
|
|
212
|
+
);
|
|
200
213
|
return false;
|
|
201
214
|
}
|
|
202
215
|
return true;
|
|
@@ -237,9 +250,9 @@ class Program {
|
|
|
237
250
|
disableAttribArrays() {
|
|
238
251
|
var gl = this.gl;
|
|
239
252
|
var a = this._attribArrays;
|
|
240
|
-
|
|
241
|
-
while (i--) {
|
|
253
|
+
for (let i = 0, len = a.length; i < len; i++) {
|
|
242
254
|
gl.disableVertexAttribArray(a[i]);
|
|
255
|
+
gl.vertexAttribDivisor(a[i], 0);
|
|
243
256
|
}
|
|
244
257
|
}
|
|
245
258
|
|
|
@@ -250,9 +263,10 @@ class Program {
|
|
|
250
263
|
enableAttribArrays() {
|
|
251
264
|
var gl = this.gl;
|
|
252
265
|
var a = this._attribArrays;
|
|
253
|
-
var
|
|
254
|
-
|
|
266
|
+
var d = this._attribDivisor;
|
|
267
|
+
for (let i = 0, len = a.length; i < len; i++) {
|
|
255
268
|
gl.enableVertexAttribArray(a[i]);
|
|
269
|
+
gl.vertexAttribDivisor(a[i], d[i]);
|
|
256
270
|
}
|
|
257
271
|
}
|
|
258
272
|
|
|
@@ -280,7 +294,13 @@ class Program {
|
|
|
280
294
|
gl.linkProgram(this._p);
|
|
281
295
|
|
|
282
296
|
if (!gl.getProgramParameter(this._p, gl.LINK_STATUS)) {
|
|
283
|
-
cons.logErr(
|
|
297
|
+
cons.logErr(
|
|
298
|
+
"og/Program/Program:" +
|
|
299
|
+
this.name +
|
|
300
|
+
" - couldn't initialise shaders. " +
|
|
301
|
+
gl.getProgramInfoLog(this._p) +
|
|
302
|
+
"."
|
|
303
|
+
);
|
|
284
304
|
gl.deleteProgram(this._p);
|
|
285
305
|
return;
|
|
286
306
|
}
|
|
@@ -293,25 +313,47 @@ class Program {
|
|
|
293
313
|
|
|
294
314
|
this._attributes[a]._callback = Program.bindBuffer;
|
|
295
315
|
|
|
296
|
-
let itemTypeStr = this._attributes[a].itemType
|
|
316
|
+
let itemTypeStr = this._attributes[a].itemType
|
|
317
|
+
? this._attributes[a].itemType.trim().toUpperCase()
|
|
318
|
+
: "FLOAT";
|
|
319
|
+
|
|
297
320
|
if (itemTypes.indexOf(itemTypeStr) == -1) {
|
|
298
|
-
cons.logErr(
|
|
321
|
+
cons.logErr(
|
|
322
|
+
`og/Program/Program: ${this.name}- attribute '${a}', item type ${this._attributes[a].itemType} not exists.`
|
|
323
|
+
);
|
|
299
324
|
this._attributes[a].itemType = gl.FLOAT;
|
|
300
325
|
} else {
|
|
301
326
|
this._attributes[a].itemType = gl[itemTypeStr];
|
|
302
327
|
}
|
|
303
328
|
|
|
304
329
|
this._attributes[a].normalized = this._attributes[a].normalized || false;
|
|
330
|
+
this._attributes[a].divisor = this._attributes[a].divisor || 0;
|
|
305
331
|
|
|
306
332
|
this._p[a] = gl.getAttribLocation(this._p, a);
|
|
307
333
|
|
|
308
334
|
if (this._p[a] == undefined) {
|
|
309
|
-
cons.logErr(
|
|
335
|
+
cons.logErr(
|
|
336
|
+
"og/Program/Program:" + this.name + " - attribute '" + a + "' is not exists."
|
|
337
|
+
);
|
|
310
338
|
gl.deleteProgram(this._p);
|
|
311
339
|
return;
|
|
312
340
|
}
|
|
313
341
|
|
|
314
|
-
this.
|
|
342
|
+
let type = this._attributes[a].type;
|
|
343
|
+
if (typeof type === "string") {
|
|
344
|
+
type = typeStr[type.trim().toLowerCase()];
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
let d = this._attributes[a].divisor;
|
|
348
|
+
if (type === types.MAT4) {
|
|
349
|
+
let loc = this._p[a];
|
|
350
|
+
this._attribArrays.push(loc, loc + 1, loc + 2, loc + 3);
|
|
351
|
+
this._attribDivisor.push(d, d, d, d);
|
|
352
|
+
} else {
|
|
353
|
+
this._attribArrays.push(this._p[a]);
|
|
354
|
+
this._attribDivisor.push(d);
|
|
355
|
+
}
|
|
356
|
+
|
|
315
357
|
gl.enableVertexAttribArray(this._p[a]);
|
|
316
358
|
|
|
317
359
|
this._attributes[a]._pName = this._p[a];
|
|
@@ -321,8 +363,9 @@ class Program {
|
|
|
321
363
|
for (var u in this._uniforms) {
|
|
322
364
|
//this.uniforms[u]._name = u;
|
|
323
365
|
|
|
324
|
-
if (typeof
|
|
325
|
-
this._uniforms[u]._callback =
|
|
366
|
+
if (typeof this._uniforms[u].type === "string") {
|
|
367
|
+
this._uniforms[u]._callback =
|
|
368
|
+
callbacks.u[typeStr[this._uniforms[u].type.trim().toLowerCase()]];
|
|
326
369
|
} else {
|
|
327
370
|
this._uniforms[u]._callback = callbacks.u[this._uniforms[u].type];
|
|
328
371
|
}
|
|
@@ -331,7 +374,9 @@ class Program {
|
|
|
331
374
|
this._p[u] = gl.getUniformLocation(this._p, u);
|
|
332
375
|
|
|
333
376
|
if (this._p[u] == undefined) {
|
|
334
|
-
cons.logErr(
|
|
377
|
+
cons.logErr(
|
|
378
|
+
"og/Program/Program:" + this.name + " - uniform '" + u + "' is not exists."
|
|
379
|
+
);
|
|
335
380
|
gl.deleteProgram(this._p);
|
|
336
381
|
return;
|
|
337
382
|
}
|
|
@@ -348,4 +393,4 @@ class Program {
|
|
|
348
393
|
}
|
|
349
394
|
}
|
|
350
395
|
|
|
351
|
-
export { Program };
|
|
396
|
+
export { Program };
|
|
@@ -1,28 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
import { Handler } from "./Handler.js";
|
|
2
|
+
import { Program } from "./Program.js";
|
|
3
|
+
|
|
4
|
+
("use strict");
|
|
2
5
|
|
|
3
6
|
/**
|
|
4
|
-
* This is shader program controller that used by hadler object to access the shader
|
|
7
|
+
* This is shader program controller that used by hadler object to access the shader
|
|
5
8
|
* program capabilities, like switching program during the rendering.
|
|
6
9
|
* Get access to the program from ...handler.programs.<program name> etc.
|
|
7
10
|
* @class
|
|
8
|
-
* @param {og.webgl.Handler} handler - Handler.
|
|
9
|
-
* @param {og.webgl.Program} program - Shader program.
|
|
10
11
|
*/
|
|
11
12
|
export class ProgramController {
|
|
12
|
-
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param {Handler} handler - Handler.
|
|
16
|
+
* @param {Program} program - Shader program.
|
|
17
|
+
*/
|
|
13
18
|
constructor(handler, program) {
|
|
14
|
-
|
|
15
19
|
/**
|
|
16
20
|
* Shader program.
|
|
17
21
|
* @private
|
|
18
|
-
* @type {
|
|
22
|
+
* @type {Program}
|
|
19
23
|
*/
|
|
20
24
|
this._program = program;
|
|
21
25
|
|
|
22
26
|
/**
|
|
23
27
|
* Handler.
|
|
24
28
|
* @private
|
|
25
|
-
* @type {
|
|
29
|
+
* @type {Handler}
|
|
26
30
|
*/
|
|
27
31
|
this._handler = handler;
|
|
28
32
|
|
|
@@ -45,7 +49,7 @@ export class ProgramController {
|
|
|
45
49
|
/**
|
|
46
50
|
* Returns controller's shader program.
|
|
47
51
|
* @public
|
|
48
|
-
* @return {
|
|
52
|
+
* @return {Program} -
|
|
49
53
|
*/
|
|
50
54
|
getProgram() {
|
|
51
55
|
return this._program;
|
|
@@ -106,7 +110,7 @@ export class ProgramController {
|
|
|
106
110
|
* Sets program uniforms and attributes values and return controller instance.
|
|
107
111
|
* @public
|
|
108
112
|
* @param {Object} params - Object with variable name and value like { value: 12, someArray:[1,2,3], uSampler: texture,... }
|
|
109
|
-
* @return {
|
|
113
|
+
* @return {ProgramController} -
|
|
110
114
|
*/
|
|
111
115
|
set(params) {
|
|
112
116
|
this.activate();
|
|
@@ -119,7 +123,7 @@ export class ProgramController {
|
|
|
119
123
|
* @public
|
|
120
124
|
* @param {number} mode - Gl draw mode
|
|
121
125
|
* @param {WEBGLBuffer} buffer - Buffer to draw.
|
|
122
|
-
* @return {
|
|
126
|
+
* @return {ProgramController} Returns current shader controller instance.
|
|
123
127
|
*/
|
|
124
128
|
drawIndexBuffer(mode, buffer) {
|
|
125
129
|
this._program.drawIndexBuffer(mode, buffer);
|
|
@@ -130,10 +134,10 @@ export class ProgramController {
|
|
|
130
134
|
* Calls Gl drawArray function.
|
|
131
135
|
* @param {number} mode - Gl draw mode.
|
|
132
136
|
* @param {number} numItems - draw items count.
|
|
133
|
-
* @return {
|
|
137
|
+
* @return {ProgramController} Returns current shader controller instance.
|
|
134
138
|
*/
|
|
135
139
|
drawArrays(mode, numItems) {
|
|
136
140
|
this._program.drawArrays(mode, numItems);
|
|
137
141
|
return this;
|
|
138
142
|
}
|
|
139
|
-
}
|
|
143
|
+
}
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
* @module og/webgl/callbacks
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
"use strict";
|
|
6
6
|
|
|
7
|
-
import { types } from
|
|
7
|
+
import { types } from "./types.js";
|
|
8
8
|
|
|
9
9
|
/*=========================
|
|
10
10
|
Uniforms callbacks
|
|
11
11
|
=========================*/
|
|
12
12
|
export const callbacks = {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
u: [],
|
|
14
|
+
a: []
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
callbacks.u[types.MAT4] = function (program, variable) {
|
|
@@ -71,7 +71,7 @@ callbacks.u[types.SAMPLER2DARRAY] = function (program, variable) {
|
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
callbacks.u[types.INTXX] = function (program, variable) {
|
|
74
|
-
|
|
74
|
+
program.gl.uniform1iv(variable._pName, variable.value);
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
callbacks.u[types.FLOATXX] = function (program, variable) {
|
|
@@ -93,6 +93,6 @@ callbacks.a[types.VEC3] = function (program, variable) {
|
|
|
93
93
|
program.gl.vertexAttrib3fv(variable._pName, variable.value);
|
|
94
94
|
};
|
|
95
95
|
|
|
96
|
-
callbacks.a[types.VEC4] = function (program, variable) {
|
|
97
|
-
program.gl.vertexAttrib4fv(variable._pName, variable.value);
|
|
98
|
-
};
|
|
96
|
+
//callbacks.a[types.VEC4] = function (program, variable) {
|
|
97
|
+
// program.gl.vertexAttrib4fv(variable._pName, variable.value);
|
|
98
|
+
//};
|
package/src/og/inherits.js
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-mixed-operators */
|
|
2
|
-
goog.provide('og.utils.getPolyCenter');
|
|
3
|
-
|
|
4
|
-
/*
|
|
5
|
-
ISC License
|
|
6
|
-
Copyright (c) 2016 Mapbox
|
|
7
|
-
|
|
8
|
-
Permission to use, copy, modify, and/or distribute this software for any purpose
|
|
9
|
-
with or without fee is hereby granted, provided that the above copyright notice
|
|
10
|
-
and this permission notice appear in all copies.
|
|
11
|
-
|
|
12
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD TO
|
|
13
|
-
THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
|
14
|
-
IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
|
|
15
|
-
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA
|
|
16
|
-
OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
|
17
|
-
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|
18
|
-
SOFTWARE.
|
|
19
|
-
|
|
20
|
-
https://github.com/mapbox/polylabel
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
og.utils.getPolyCenter = function (polygon) {
|
|
24
|
-
|
|
25
|
-
function polylabel(polygon, precision, debug) {
|
|
26
|
-
precision = precision || 1.0;
|
|
27
|
-
|
|
28
|
-
// find the bounding box of the outer ring
|
|
29
|
-
var minX, minY, maxX, maxY;
|
|
30
|
-
for (var i = 0; i < polygon[0].length; i++) {
|
|
31
|
-
var p = polygon[0][i];
|
|
32
|
-
if (!i || p[0] < minX) minX = p[0];
|
|
33
|
-
if (!i || p[1] < minY) minY = p[1];
|
|
34
|
-
if (!i || p[0] > maxX) maxX = p[0];
|
|
35
|
-
if (!i || p[1] > maxY) maxY = p[1];
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
var width = maxX - minX;
|
|
39
|
-
var height = maxY - minY;
|
|
40
|
-
var cellSize = Math.min(width, height);
|
|
41
|
-
var h = cellSize / 2;
|
|
42
|
-
|
|
43
|
-
// a priority queue of cells in order of their "potential" (max distance to polygon)
|
|
44
|
-
var cellQueue = new Queue(null, compareMax);
|
|
45
|
-
|
|
46
|
-
if (cellSize === 0) return [minX, minY];
|
|
47
|
-
|
|
48
|
-
// cover polygon with initial cells
|
|
49
|
-
for (var x = minX; x < maxX; x += cellSize) {
|
|
50
|
-
for (var y = minY; y < maxY; y += cellSize) {
|
|
51
|
-
cellQueue.push(new Cell(x + h, y + h, h, polygon));
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// take centroid as the first best guess
|
|
56
|
-
var bestCell = getCentroidCell(polygon);
|
|
57
|
-
|
|
58
|
-
// special case for rectangular polygons
|
|
59
|
-
var bboxCell = new Cell(minX + width / 2, minY + height / 2, 0, polygon);
|
|
60
|
-
if (bboxCell.d > bestCell.d) bestCell = bboxCell;
|
|
61
|
-
|
|
62
|
-
var numProbes = cellQueue.length;
|
|
63
|
-
|
|
64
|
-
while (cellQueue.length) {
|
|
65
|
-
// pick the most promising cell from the queue
|
|
66
|
-
var cell = cellQueue.pop();
|
|
67
|
-
|
|
68
|
-
// update the best cell if we found a better one
|
|
69
|
-
if (cell.d > bestCell.d) {
|
|
70
|
-
bestCell = cell;
|
|
71
|
-
if (debug) console.log('found best %d after %d probes', Math.round(1e4 * cell.d) / 1e4, numProbes);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// do not drill down further if there's no chance of a better solution
|
|
75
|
-
if (cell.max - bestCell.d <= precision) continue;
|
|
76
|
-
|
|
77
|
-
// split the cell into four cells
|
|
78
|
-
h = cell.h / 2;
|
|
79
|
-
cellQueue.push(new Cell(cell.x - h, cell.y - h, h, polygon));
|
|
80
|
-
cellQueue.push(new Cell(cell.x + h, cell.y - h, h, polygon));
|
|
81
|
-
cellQueue.push(new Cell(cell.x - h, cell.y + h, h, polygon));
|
|
82
|
-
cellQueue.push(new Cell(cell.x + h, cell.y + h, h, polygon));
|
|
83
|
-
numProbes += 4;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (debug) {
|
|
87
|
-
console.log('num probes: ' + numProbes);
|
|
88
|
-
console.log('best distance: ' + bestCell.d);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return [bestCell.x, bestCell.y];
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function compareMax(a, b) {
|
|
95
|
-
return b.max - a.max;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function Cell(x, y, h, polygon) {
|
|
99
|
-
this.x = x; // cell center x
|
|
100
|
-
this.y = y; // cell center y
|
|
101
|
-
this.h = h; // half the cell size
|
|
102
|
-
this.d = pointToPolygonDist(x, y, polygon); // distance from cell center to polygon
|
|
103
|
-
this.max = this.d + this.h * Math.SQRT2; // max distance to polygon within a cell
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// signed distance from point to polygon outline (negative if point is outside)
|
|
107
|
-
function pointToPolygonDist(x, y, polygon) {
|
|
108
|
-
var inside = false;
|
|
109
|
-
var minDistSq = Infinity;
|
|
110
|
-
|
|
111
|
-
for (var k = 0; k < polygon.length; k++) {
|
|
112
|
-
var ring = polygon[k];
|
|
113
|
-
|
|
114
|
-
for (var i = 0, len = ring.length, j = len - 1; i < len; j = i++) {
|
|
115
|
-
var a = ring[i];
|
|
116
|
-
var b = ring[j];
|
|
117
|
-
|
|
118
|
-
if ((a[1] > y !== b[1] > y) &&
|
|
119
|
-
(x < (b[0] - a[0]) * (y - a[1]) / (b[1] - a[1]) + a[0])) inside = !inside;
|
|
120
|
-
|
|
121
|
-
minDistSq = Math.min(minDistSq, getSegDistSq(x, y, a, b));
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return (inside ? 1 : -1) * Math.sqrt(minDistSq);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// get polygon centroid
|
|
129
|
-
function getCentroidCell(polygon) {
|
|
130
|
-
var area = 0;
|
|
131
|
-
var x = 0;
|
|
132
|
-
var y = 0;
|
|
133
|
-
var points = polygon[0];
|
|
134
|
-
|
|
135
|
-
for (var i = 0, len = points.length, j = len - 1; i < len; j = i++) {
|
|
136
|
-
var a = points[i];
|
|
137
|
-
var b = points[j];
|
|
138
|
-
var f = a[0] * b[1] - b[0] * a[1];
|
|
139
|
-
x += (a[0] + b[0]) * f;
|
|
140
|
-
y += (a[1] + b[1]) * f;
|
|
141
|
-
area += f * 3;
|
|
142
|
-
}
|
|
143
|
-
if (area === 0) return new Cell(points[0][0], points[0][1], 0, polygon);
|
|
144
|
-
return new Cell(x / area, y / area, 0, polygon);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// get squared distance from a point to a segment
|
|
148
|
-
function getSegDistSq(px, py, a, b) {
|
|
149
|
-
|
|
150
|
-
var x = a[0];
|
|
151
|
-
var y = a[1];
|
|
152
|
-
var dx = b[0] - x;
|
|
153
|
-
var dy = b[1] - y;
|
|
154
|
-
|
|
155
|
-
if (dx !== 0 || dy !== 0) {
|
|
156
|
-
|
|
157
|
-
var t = ((px - x) * dx + (py - y) * dy) / (dx * dx + dy * dy);
|
|
158
|
-
|
|
159
|
-
if (t > 1) {
|
|
160
|
-
x = b[0];
|
|
161
|
-
y = b[1];
|
|
162
|
-
|
|
163
|
-
} else if (t > 0) {
|
|
164
|
-
x += dx * t;
|
|
165
|
-
y += dy * t;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
dx = px - x;
|
|
170
|
-
dy = py - y;
|
|
171
|
-
|
|
172
|
-
return dx * dx + dy * dy;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
return polylabel(polygon, 1);
|
|
176
|
-
};
|