@pirireis/webglobeplugins 0.9.10 → 0.9.11
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/Math/angle-calculation.js +8 -8
- package/Math/arc.js +18 -18
- package/Math/bounds/line-bbox.js +80 -78
- package/Math/constants.js +3 -3
- package/Math/juction/arc-plane.js +23 -23
- package/Math/juction/line-sphere.js +11 -11
- package/Math/juction/plane-plane.js +11 -11
- package/Math/line.js +16 -14
- package/Math/methods.js +72 -67
- package/Math/plane.js +18 -16
- package/Math/quaternion.js +49 -45
- package/Math/utils.js +2 -2
- package/Math/vec3.js +45 -42
- package/algorithms/search-binary.js +4 -4
- package/altitude-locator/draw-subset-obj.js +8 -7
- package/altitude-locator/plugin.js +113 -97
- package/arrowfield/adaptor.js +4 -3
- package/arrowfield/index.js +2 -2
- package/arrowfield/plugin.js +65 -62
- package/bearing-line/index.js +1 -1
- package/bearing-line/plugin.js +225 -200
- package/circle-line-chain/chain-list-map.js +88 -82
- package/circle-line-chain/plugin.js +154 -129
- package/circle-line-chain/util.js +1 -1
- package/compass-rose/compass-rose-padding-flat.js +126 -104
- package/compass-rose/compass-text-writer.js +70 -62
- package/compass-rose/index.js +2 -2
- package/compassrose/compassrose.js +50 -46
- package/compassrose/index.js +1 -1
- package/heatwave/index.js +2 -2
- package/heatwave/isobar/objectarraylabels.js +48 -44
- package/heatwave/isobar/plugin.js +123 -104
- package/heatwave/isobar/quadtreecontours.js +92 -76
- package/heatwave/plugins/heatwaveglobeshell.js +87 -69
- package/index.js +11 -11
- package/package.json +1 -1
- package/partialrings/buffer-manager.js +64 -32
- package/partialrings/index.js +1 -1
- package/partialrings/plugin.js +84 -48
- package/partialrings/program.js +47 -136
- package/pin/pin-object-array.js +86 -83
- package/pin/pin-point-totem.js +22 -21
- package/point-heat-map/adaptors/timetracksplugin-format-to-this.js +10 -10
- package/point-heat-map/plugin-webworker.js +45 -40
- package/point-heat-map/point-to-heat-map-flow.js +42 -40
- package/point-tracks/key-methods.js +1 -1
- package/point-tracks/plugin.js +142 -127
- package/programs/arrowfield/index.js +1 -1
- package/programs/arrowfield/logic.js +62 -170
- package/programs/arrowfield/object.js +35 -33
- package/programs/data2legend/density-to-legend.js +21 -45
- package/programs/data2legend/point-to-density-texture.js +27 -52
- package/programs/float2legendwithratio/index.js +1 -1
- package/programs/float2legendwithratio/logic.js +42 -88
- package/programs/float2legendwithratio/object.js +46 -43
- package/programs/globe-util/is-globe-moved.js +11 -10
- package/programs/globeshell/index.js +1 -1
- package/programs/globeshell/wiggle/index.js +1 -1
- package/programs/globeshell/wiggle/logic.js +98 -191
- package/programs/globeshell/wiggle/object.js +35 -33
- package/programs/helpers/blender/program.js +19 -36
- package/programs/helpers/fadeaway/index.js +1 -1
- package/programs/helpers/fadeaway/logic.js +13 -35
- package/programs/helpers/fadeaway/object.js +10 -9
- package/programs/helpers/index.js +1 -1
- package/programs/index.js +8 -8
- package/programs/line-on-globe/angled-line.js +32 -91
- package/programs/line-on-globe/circle-accurate-3d.js +32 -82
- package/programs/line-on-globe/circle-accurate-flat.js +50 -108
- package/programs/line-on-globe/circle-accurate.js +33 -103
- package/programs/line-on-globe/circle.js +32 -97
- package/programs/line-on-globe/degree-padding-around-circle-3d.js +33 -83
- package/programs/line-on-globe/lines-color-instanced-flat.js +34 -79
- package/programs/line-on-globe/linestrip.js +39 -100
- package/programs/line-on-globe/naive-accurate-flexible.js +48 -118
- package/programs/line-on-globe/to-the-surface.js +29 -58
- package/programs/line-on-globe/util.js +1 -1
- package/programs/picking/pickable-renderer.js +33 -117
- package/programs/point-on-globe/element-globe-surface-glow.js +38 -78
- package/programs/point-on-globe/element-point-glow.js +35 -103
- package/programs/point-on-globe/square-pixel-point.js +27 -76
- package/programs/programcache.js +13 -13
- package/programs/rings/distancering/circleflatprogram.js +21 -63
- package/programs/rings/distancering/circlepaddingfreeangleprogram.js +145 -156
- package/programs/rings/distancering/circlepaddysharedbuffer.js +197 -121
- package/programs/rings/distancering/index.js +4 -4
- package/programs/rings/distancering/paddyflatprogram.js +20 -73
- package/programs/rings/distancering/paddyflatprogram2d.js +22 -75
- package/programs/rings/distancering/paddyflatprogram3d.js +20 -73
- package/programs/rings/partial-ring/piece-of-pie.js +35 -137
- package/programs/totems/camerauniformblock.js +51 -64
- package/programs/totems/canvas-webglobe-info.js +40 -48
- package/programs/totems/gpu-selection-uniform-block.js +40 -44
- package/programs/totems/index.js +1 -1
- package/programs/two-d/pixel-padding-for-compass.js +29 -90
- package/programs/util.js +7 -6
- package/programs/vectorfields/index.js +1 -1
- package/programs/vectorfields/logics/drawrectangleparticles.js +29 -70
- package/programs/vectorfields/logics/index.js +3 -3
- package/programs/vectorfields/logics/pixelbased.js +35 -91
- package/programs/vectorfields/logics/ubo.js +25 -31
- package/programs/vectorfields/pingpongbuffermanager.js +34 -30
- package/rangerings/index.js +4 -4
- package/rangerings/plugin.js +252 -202
- package/rangerings/rangeringangletext.js +120 -108
- package/rangerings/ring-account.js +69 -52
- package/shaders/fragment-toy/firework.js +1 -55
- package/shaders/fragment-toy/singularity.js +1 -55
- package/timetracks/adaptors-line-strip.js +37 -26
- package/timetracks/adaptors.js +61 -47
- package/timetracks/index.js +4 -4
- package/timetracks/plugin-line-strip.js +63 -59
- package/timetracks/plugin.js +69 -65
- package/timetracks/program-line-strip.js +103 -296
- package/timetracks/program.js +113 -419
- package/timetracks/programpoint-line-strip.js +44 -97
- package/timetracks/programpoint.js +44 -90
- package/util/account/bufferoffsetmanager.js +95 -72
- package/util/account/index.js +1 -1
- package/util/account/single-attribute-buffer-management/buffer-manager.js +43 -39
- package/util/account/single-attribute-buffer-management/buffer-orchestrator.js +94 -64
- package/util/account/single-attribute-buffer-management/index.js +3 -3
- package/util/account/single-attribute-buffer-management/object-store.js +30 -28
- package/util/account/util.js +4 -2
- package/util/algorithms/search-binary.js +4 -4
- package/util/check/get.js +5 -5
- package/util/check/typecheck.js +15 -13
- package/util/geometry/index.js +11 -9
- package/util/gl-util/buffer/attribute-loader.js +20 -8
- package/util/gl-util/buffer/index.js +1 -1
- package/util/gl-util/draw-options/methods.js +7 -7
- package/util/gl-util/uniform-block/manager.js +67 -55
- package/util/heatwavedatamanager/datamanager.js +116 -56
- package/util/heatwavedatamanager/index.js +2 -2
- package/util/heatwavedatamanager/pointcoordinatesdatacalculator.js +40 -37
- package/util/heatwavedatamanager/pointcoordsmeta.js +10 -9
- package/util/index.js +6 -6
- package/util/interpolation/timetrack/index.js +1 -1
- package/util/interpolation/timetrack/timetrack-interpolator.js +29 -27
- package/util/interpolation/timetrack/web-worker-str.js +1 -179
- package/util/interpolation/timetrack/web-worker.js +4 -4
- package/util/jshelpers/data-filler.js +7 -7
- package/util/jshelpers/timefilters.js +7 -7
- package/util/picking/fence.js +7 -7
- package/util/picking/picker-displayer.js +52 -46
- package/util/programs/draw-texture-on-canvas.js +21 -39
- package/util/programs/shapesonglobe.js +64 -104
- package/util/programs/supersampletotextures.js +39 -45
- package/util/programs/texturetoglobe.js +48 -98
- package/util/shaderfunctions/geometrytransformations.js +27 -322
- package/util/shaderfunctions/nodata.js +1 -7
- package/util/shaderfunctions/noisefunctions.js +9 -39
- package/util/surface-line-data/arcs-to-cuts.js +23 -20
- package/util/webglobe/rasteroverlay.js +37 -35
- package/util/webglobjectbuilders.js +60 -55
- package/util/webglobjectbuilders1.js +49 -48
- package/waveparticles/adaptor.js +7 -6
- package/waveparticles/index.js +2 -2
- package/waveparticles/plugin.js +84 -79
- package/wind/imagetovectorfieldandmagnitude.js +15 -15
- package/wind/index.js +4 -4
- package/wind/plugin.js +251 -453
- package/wind/vectorfieldimage.js +5 -5
- package/write-text/attached-text-writer.js +48 -46
- package/write-text/context-text.js +58 -51
- package/write-text/context-text3.js +74 -69
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
// TODO: REMOVE THIS
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
var webglobe_1 = require("@pirireis/webglobe");
|
|
5
|
+
var object = {
|
|
6
6
|
"displayName": "CompassRose",
|
|
7
7
|
"layerType": 3,
|
|
8
8
|
"wkbGeom": null,
|
|
@@ -167,28 +167,29 @@ const object = {
|
|
|
167
167
|
"flashGeo": false
|
|
168
168
|
}
|
|
169
169
|
};
|
|
170
|
-
|
|
170
|
+
var setIconSize = function (object, size) {
|
|
171
171
|
object.style.icon.sizeX = size;
|
|
172
172
|
object.style.icon.sizeY = size;
|
|
173
173
|
object.style.icon.radius = Math.ceil(size / 2);
|
|
174
174
|
};
|
|
175
|
-
|
|
175
|
+
var setMapName = function (object, mapName) {
|
|
176
176
|
object.style.icon.mapName = mapName;
|
|
177
177
|
};
|
|
178
|
-
|
|
178
|
+
var setIconName = function (object, name) {
|
|
179
179
|
object.style.icon.name = name;
|
|
180
180
|
};
|
|
181
|
-
|
|
181
|
+
var setData = function (object, data) {
|
|
182
182
|
object.data = data;
|
|
183
183
|
};
|
|
184
|
-
|
|
184
|
+
var addSingleImageIconMap = function (symbolSet) { return function (url) {
|
|
185
185
|
webglobe_1.GlobeManager.api_AddIconMap(symbolSet, url, null);
|
|
186
|
-
};
|
|
187
|
-
|
|
186
|
+
}; };
|
|
187
|
+
var setFIDKey = function (object, key) {
|
|
188
188
|
object.style.fidKey = key;
|
|
189
189
|
};
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
var CompassRose = /** @class */ (function () {
|
|
191
|
+
function CompassRose(id, globe, _a) {
|
|
192
|
+
var _b = _a.size, size = _b === void 0 ? 100 : _b, _c = _a.primaryKey, primaryKey = _c === void 0 ? "__key__" : _c, _d = _a.symbolSet, symbolSet = _d === void 0 ? "compassRose" : _d, _e = _a.iconSet, iconSet = _e === void 0 ? null : _e, _f = _a.imageURL, imageURL = _f === void 0 ? null : _f, _g = _a.data, data = _g === void 0 ? null : _g;
|
|
192
193
|
this.id = id;
|
|
193
194
|
this.globe = globe;
|
|
194
195
|
this._idCollector = new Set();
|
|
@@ -206,35 +207,35 @@ class CompassRose {
|
|
|
206
207
|
if (data)
|
|
207
208
|
this.setControlledData(data);
|
|
208
209
|
}
|
|
209
|
-
setIconSize(size) {
|
|
210
|
-
|
|
210
|
+
CompassRose.prototype.setIconSize = function (size) {
|
|
211
|
+
var _a = this, object = _a.object, globe = _a.globe;
|
|
211
212
|
setIconSize(object, size);
|
|
212
213
|
globe.ObjectArray.StyleChanged(object);
|
|
213
|
-
}
|
|
214
|
-
setMapName(mapName) {
|
|
215
|
-
|
|
214
|
+
};
|
|
215
|
+
CompassRose.prototype.setMapName = function (mapName) {
|
|
216
|
+
var _a = this, object = _a.object, globe = _a.globe;
|
|
216
217
|
setMapName(object, mapName);
|
|
217
218
|
globe.ObjectArray.StyleChanged(object);
|
|
218
|
-
}
|
|
219
|
-
flush() {
|
|
219
|
+
};
|
|
220
|
+
CompassRose.prototype.flush = function () {
|
|
220
221
|
this._idCollector.clear();
|
|
221
222
|
this._setData({ coords: [], coordsZ: [], attribs: [] });
|
|
222
|
-
}
|
|
223
|
-
insert(data) {
|
|
224
|
-
|
|
223
|
+
};
|
|
224
|
+
CompassRose.prototype.insert = function (data) {
|
|
225
|
+
var updateBucket = {
|
|
225
226
|
coords: [],
|
|
226
227
|
coordsZ: [],
|
|
227
228
|
attribs: [],
|
|
228
229
|
};
|
|
229
|
-
|
|
230
|
+
var addBucket = {
|
|
230
231
|
coords: [],
|
|
231
232
|
coordsZ: [],
|
|
232
233
|
attribs: [],
|
|
233
234
|
};
|
|
234
|
-
|
|
235
|
-
for (
|
|
236
|
-
|
|
237
|
-
|
|
235
|
+
var bucket;
|
|
236
|
+
for (var i = 0; i < data.attribs.length; i++) {
|
|
237
|
+
var currentPayload = data.attribs[i];
|
|
238
|
+
var id = currentPayload[this.primaryKey];
|
|
238
239
|
if (this._idCollector.has(id)) {
|
|
239
240
|
bucket = updateBucket;
|
|
240
241
|
}
|
|
@@ -252,45 +253,48 @@ class CompassRose {
|
|
|
252
253
|
if (updateBucket.coords.length > 0) {
|
|
253
254
|
this._updateData(updateBucket, webglobe_1.CSObjectArrayUpdateTypes.UPDATE, { attribs: false, icon: false, label: false, heading: false });
|
|
254
255
|
}
|
|
255
|
-
}
|
|
256
|
-
delete(dataIDs) {
|
|
257
|
-
|
|
256
|
+
};
|
|
257
|
+
CompassRose.prototype.delete = function (dataIDs) {
|
|
258
|
+
var _this = this;
|
|
259
|
+
var deleteBucket = {
|
|
258
260
|
coords: [],
|
|
259
261
|
coordsZ: [],
|
|
260
262
|
attribs: [],
|
|
261
263
|
};
|
|
262
|
-
dataIDs.forEach(id
|
|
263
|
-
|
|
264
|
-
|
|
264
|
+
dataIDs.forEach(function (id) {
|
|
265
|
+
var _a;
|
|
266
|
+
if (_this._idCollector.has(id)) {
|
|
267
|
+
_this._idCollector.delete(id);
|
|
265
268
|
deleteBucket.coords.push(0, 0);
|
|
266
269
|
deleteBucket.coordsZ.push(0);
|
|
267
270
|
// also can be written as follows
|
|
268
|
-
deleteBucket.attribs.push({
|
|
269
|
-
[
|
|
270
|
-
|
|
271
|
+
deleteBucket.attribs.push((_a = {},
|
|
272
|
+
_a[_this.primaryKey] = id,
|
|
273
|
+
_a));
|
|
271
274
|
}
|
|
272
275
|
});
|
|
273
276
|
if (deleteBucket.coords.length > 0) {
|
|
274
277
|
this._updateData(deleteBucket, webglobe_1.CSObjectArrayUpdateTypes.DELETE);
|
|
275
278
|
}
|
|
276
|
-
}
|
|
277
|
-
removeFromMap() {
|
|
279
|
+
};
|
|
280
|
+
CompassRose.prototype.removeFromMap = function () {
|
|
278
281
|
this.globe.ObjectArray.Delete(this.id);
|
|
279
|
-
}
|
|
282
|
+
};
|
|
280
283
|
// private
|
|
281
|
-
_setData(data) {
|
|
282
|
-
|
|
284
|
+
CompassRose.prototype._setData = function (data) {
|
|
285
|
+
var _a = this, globe = _a.globe, object = _a.object;
|
|
283
286
|
globe.ObjectArray.SetData(object, [data]);
|
|
284
|
-
}
|
|
287
|
+
};
|
|
285
288
|
/**
|
|
286
289
|
* @param {PointObjectArray} data
|
|
287
290
|
* @param {CSObjectArrayUpdateTypes} operation
|
|
288
291
|
* @param {CanChangeOptions} [canChange]
|
|
289
292
|
*/
|
|
290
|
-
_updateData(data, operation, canChange) {
|
|
291
|
-
|
|
293
|
+
CompassRose.prototype._updateData = function (data, operation, canChange) {
|
|
294
|
+
var _a = this, globe = _a.globe, object = _a.object;
|
|
292
295
|
globe.ObjectArray.UpdateData(object, operation, [data], canChange);
|
|
293
|
-
}
|
|
294
|
-
|
|
296
|
+
};
|
|
297
|
+
return CompassRose;
|
|
298
|
+
}());
|
|
295
299
|
exports.default = CompassRose;
|
|
296
|
-
|
|
300
|
+
var getID = function (data, primaryKey) { return data.attribs[primaryKey]; };
|
package/compassrose/index.js
CHANGED
|
@@ -4,5 +4,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.CompassRose = void 0;
|
|
7
|
-
|
|
7
|
+
var compassrose_1 = __importDefault(require("./compassrose"));
|
|
8
8
|
exports.CompassRose = compassrose_1.default;
|
package/heatwave/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.IsobarRasterToVector = exports.HeatWavePlugin = void 0;
|
|
7
|
-
|
|
7
|
+
var heatwaveglobeshell_1 = __importDefault(require("./plugins/heatwaveglobeshell"));
|
|
8
8
|
exports.HeatWavePlugin = heatwaveglobeshell_1.default;
|
|
9
|
-
|
|
9
|
+
var plugin_1 = require("./isobar/plugin");
|
|
10
10
|
Object.defineProperty(exports, "IsobarRasterToVector", { enumerable: true, get: function () { return plugin_1.IsobarRasterToVector; } });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
var webglobe_1 = require("@pirireis/webglobe");
|
|
4
4
|
/**
|
|
5
5
|
* @typedef {Object} IconPayload
|
|
6
6
|
* @property {string} app6DCode
|
|
@@ -22,12 +22,13 @@ const webglobe_1 = require("@pirireis/webglobe");
|
|
|
22
22
|
* @property {number[]} coordsZ [z1, z2, ....]
|
|
23
23
|
* @property {PointPayload[]} attribs
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
var ObjectArrayLabels = /** @class */ (function () {
|
|
26
26
|
/**
|
|
27
27
|
* @param {number | string} id
|
|
28
28
|
* @param {CSGlobe} globe
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
function ObjectArrayLabels(id, globe, labelStyle) {
|
|
31
|
+
if (labelStyle === void 0) { labelStyle = null; }
|
|
31
32
|
this.id = id;
|
|
32
33
|
this.setGlobe(globe);
|
|
33
34
|
this.data = [
|
|
@@ -48,7 +49,7 @@ class ObjectArrayLabels {
|
|
|
48
49
|
this._idCollector = new Set();
|
|
49
50
|
this._setStyle(labelStyle);
|
|
50
51
|
}
|
|
51
|
-
_setStyle(labelStyle) {
|
|
52
|
+
ObjectArrayLabels.prototype._setStyle = function (labelStyle) {
|
|
52
53
|
this.style = this.globe.ObjectArray.GetDefaultStyle();
|
|
53
54
|
if (labelStyle) {
|
|
54
55
|
this.style.labels[0] = labelStyle;
|
|
@@ -67,52 +68,53 @@ class ObjectArrayLabels {
|
|
|
67
68
|
this.style.labels[0].text = "${value}";
|
|
68
69
|
this.style.fidKey = this.primaryKey;
|
|
69
70
|
this.style.iconType = webglobe_1.CSIconTypes.NOICON; // milIcon ekleyebilmek için icon tipi MAP olmalı
|
|
70
|
-
}
|
|
71
|
+
};
|
|
71
72
|
/**
|
|
72
73
|
* @param {CSGlobe} [globe]
|
|
73
74
|
*/
|
|
74
|
-
setGlobe(globe) {
|
|
75
|
+
ObjectArrayLabels.prototype.setGlobe = function (globe) {
|
|
75
76
|
if (!globe)
|
|
76
77
|
return;
|
|
77
78
|
this.globe = globe;
|
|
78
|
-
}
|
|
79
|
-
addToMap() {
|
|
79
|
+
};
|
|
80
|
+
ObjectArrayLabels.prototype.addToMap = function () {
|
|
80
81
|
this.globe.ObjectArray.Add(this);
|
|
81
|
-
}
|
|
82
|
-
removeFromMap() {
|
|
82
|
+
};
|
|
83
|
+
ObjectArrayLabels.prototype.removeFromMap = function () {
|
|
83
84
|
this.flush();
|
|
84
85
|
this.globe.ObjectArray.Delete(this.id);
|
|
85
|
-
}
|
|
86
|
+
};
|
|
86
87
|
/**
|
|
87
88
|
* Haritaya kullanılacak veriyi verir. Her çağrıldığında tüm hesaplamalar yeniden yapılır
|
|
88
89
|
* @param {PointObjectArray} data
|
|
89
90
|
*/
|
|
90
|
-
setData(data) {
|
|
91
|
+
ObjectArrayLabels.prototype.setData = function (data) {
|
|
91
92
|
this.globe.ObjectArray.SetData(this, [data]);
|
|
92
|
-
}
|
|
93
|
+
};
|
|
93
94
|
/**
|
|
94
95
|
* @param {PointObjectArray} data
|
|
95
96
|
* @param {CSObjectArrayUpdateTypes} operation
|
|
96
97
|
* @param {CanChangeOptions} [canChange]
|
|
97
98
|
*/
|
|
98
|
-
updateData(data, operation, canChange) {
|
|
99
|
+
ObjectArrayLabels.prototype.updateData = function (data, operation, canChange) {
|
|
99
100
|
this.globe.ObjectArray.UpdateData(this, operation, [data], canChange);
|
|
100
|
-
}
|
|
101
|
-
flush() {
|
|
102
|
-
|
|
101
|
+
};
|
|
102
|
+
ObjectArrayLabels.prototype.flush = function () {
|
|
103
|
+
var deleteBucket = {
|
|
103
104
|
coords: [],
|
|
104
105
|
coordsZ: [],
|
|
105
106
|
attribs: [],
|
|
106
107
|
};
|
|
107
108
|
this.setData(deleteBucket);
|
|
108
109
|
this._idCollector = new Set();
|
|
109
|
-
}
|
|
110
|
+
};
|
|
110
111
|
/**
|
|
111
112
|
* Haritaya kullanılacak veriyi verir. Her çağrıldığında tüm hesaplamalar yeniden yapılmaz, ancak ön hesaplama maliyeti vardır
|
|
112
113
|
* @param {PointObjectArray} data
|
|
113
114
|
*/
|
|
114
|
-
setControlledData(data) {
|
|
115
|
-
|
|
115
|
+
ObjectArrayLabels.prototype.setControlledData = function (data) {
|
|
116
|
+
var _this = this;
|
|
117
|
+
var paritalData = {
|
|
116
118
|
add: {
|
|
117
119
|
coords: [],
|
|
118
120
|
coordsZ: [],
|
|
@@ -140,19 +142,19 @@ class ObjectArrayLabels {
|
|
|
140
142
|
if (this._idCollector.size === 0) {
|
|
141
143
|
this.setData(data);
|
|
142
144
|
// Eklenen id'ler set edildi
|
|
143
|
-
for (
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
for (var i = 0; i < data.attribs.length; i++) {
|
|
146
|
+
var currentPayload = data.attribs[i];
|
|
147
|
+
var id = currentPayload[this.primaryKey];
|
|
146
148
|
this._idCollector.add(id);
|
|
147
149
|
}
|
|
148
150
|
return;
|
|
149
151
|
}
|
|
150
152
|
/** @type {Set<string>} */
|
|
151
|
-
|
|
152
|
-
for (
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
var dataIds = new Set();
|
|
154
|
+
for (var i = 0; i < data.attribs.length; i++) {
|
|
155
|
+
var currentPayload = data.attribs[i];
|
|
156
|
+
var id = currentPayload[this.primaryKey];
|
|
157
|
+
var bucket = paritalData.add;
|
|
156
158
|
dataIds.add(id);
|
|
157
159
|
if (this._idCollector.has(id)) {
|
|
158
160
|
bucket = paritalData.update;
|
|
@@ -165,15 +167,16 @@ class ObjectArrayLabels {
|
|
|
165
167
|
bucket.attribs.push(currentPayload);
|
|
166
168
|
}
|
|
167
169
|
// Artık varolmayan elemenları sil
|
|
168
|
-
|
|
169
|
-
this._idCollector.forEach((id)
|
|
170
|
+
var deleteBucket = paritalData.delete;
|
|
171
|
+
this._idCollector.forEach(function (id) {
|
|
172
|
+
var _a;
|
|
170
173
|
if (!dataIds.has(id)) {
|
|
171
|
-
|
|
174
|
+
_this._idCollector.delete(id);
|
|
172
175
|
deleteBucket.coords.push(0, 0);
|
|
173
176
|
deleteBucket.coordsZ.push(0);
|
|
174
|
-
deleteBucket.attribs.push({
|
|
175
|
-
[
|
|
176
|
-
|
|
177
|
+
deleteBucket.attribs.push((_a = {},
|
|
178
|
+
_a[_this.primaryKey] = id,
|
|
179
|
+
_a));
|
|
177
180
|
}
|
|
178
181
|
});
|
|
179
182
|
if (paritalData.add.coords.length > 0) {
|
|
@@ -185,18 +188,19 @@ class ObjectArrayLabels {
|
|
|
185
188
|
if (paritalData.delete.coords.length > 0) {
|
|
186
189
|
this.updateData(paritalData.delete, webglobe_1.CSObjectArrayUpdateTypes.DELETE);
|
|
187
190
|
}
|
|
188
|
-
}
|
|
189
|
-
setPrimarykey(key) {
|
|
191
|
+
};
|
|
192
|
+
ObjectArrayLabels.prototype.setPrimarykey = function (key) {
|
|
190
193
|
this.primaryKey = key;
|
|
191
|
-
}
|
|
192
|
-
setSymbolSet(symbolSet) {
|
|
194
|
+
};
|
|
195
|
+
ObjectArrayLabels.prototype.setSymbolSet = function (symbolSet) {
|
|
193
196
|
this.symbolSet = symbolSet;
|
|
194
|
-
}
|
|
195
|
-
getLabelStyle() {
|
|
197
|
+
};
|
|
198
|
+
ObjectArrayLabels.prototype.getLabelStyle = function () {
|
|
196
199
|
return this.style.labels[0];
|
|
197
|
-
}
|
|
198
|
-
setLabelStyle(style) {
|
|
200
|
+
};
|
|
201
|
+
ObjectArrayLabels.prototype.setLabelStyle = function (style) {
|
|
199
202
|
this.style.labels[0] = style;
|
|
200
|
-
}
|
|
201
|
-
|
|
203
|
+
};
|
|
204
|
+
return ObjectArrayLabels;
|
|
205
|
+
}());
|
|
202
206
|
exports.default = ObjectArrayLabels;
|