@pirireis/webglobeplugins 0.16.4 → 0.17.0
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 +1 -0
- package/Math/arc.js +92 -2
- package/Math/circle-cdf-points.js +2 -2
- package/Math/circle.js +2 -2
- package/Math/contour/quadtreecontours.js +300 -0
- package/Math/finite-line-2d.js +58 -0
- package/Math/juction/arc-plane.js +67 -12
- package/Math/juction/line-sphere.js +6 -6
- package/Math/juction/plane-plane.js +4 -6
- package/Math/methods.js +5 -5
- package/Math/templete-shapes/grid-visually-equal.js +0 -1
- package/Math/tessellation/earcut/adapters.js +37 -0
- package/Math/tessellation/hybrid-triangle-tessellation-meta.js +123 -0
- package/Math/tessellation/methods.js +46 -0
- package/Math/tessellation/shred-input.js +18 -0
- package/Math/tessellation/tile-merger.js +56 -0
- package/Math/tessellation/tiler.js +50 -0
- package/Math/tessellation/triangle-tessellation-meta.js +516 -0
- package/Math/tessellation/triangle-tessellation.js +14 -0
- package/Math/tessellation/zoom-catch.js +1 -0
- package/Math/vec3.js +26 -1
- package/compass-rose/compass-text-writer.js +39 -33
- package/constants.js +3 -0
- package/{util/heatwavedatamanager → heatwave}/datamanager.js +1 -1
- package/heatwave/{plugins/heatwaveglobeshell.js → heatwave.js} +8 -6
- package/heatwave/index.js +5 -3
- package/heatwave/{isobar/plugin.js → isobar.js} +6 -5
- package/{util/heatwavedatamanager → heatwave}/texture-point-sampler.js +24 -3
- package/package.json +7 -3
- package/programs/arrowfield/{object.js → arrow-field.js} +1 -1
- package/programs/arrowfield/logic.js +1 -1
- package/programs/data2legend/density-to-legend.js +24 -29
- package/programs/data2legend/point-to-density-texture.js +14 -17
- package/programs/float2legendwithratio/logic.js +2 -2
- package/programs/float2legendwithratio/object.js +1 -1
- package/programs/helpers/{blender/program.js → blender.js} +1 -1
- package/programs/helpers/{fadeaway/logic.js → fadeaway.js} +11 -2
- package/programs/index.js +20 -9
- package/programs/line-on-globe/circle-accurate-3d.js +12 -14
- package/programs/line-on-globe/circle-accurate-flat.js +0 -1
- package/programs/line-on-globe/degree-padding-around-circle-3d.js +13 -15
- package/programs/line-on-globe/lines-color-instanced-flat.js +15 -18
- package/programs/line-on-globe/naive-accurate-flexible.js +0 -1
- package/programs/picking/pickable-polygon-renderer.js +1 -1
- package/programs/picking/pickable-renderer.js +2 -2
- package/programs/point-on-globe/element-globe-surface-glow.js +2 -2
- package/programs/point-on-globe/element-point-glow.js +1 -1
- package/programs/point-on-globe/square-pixel-point.js +1 -1
- package/programs/polygon-on-globe/texture-dem-triangle-test-plugin-triangle.js +204 -0
- package/programs/polygon-on-globe/texture-dem-triangle-test-plugin.js +31 -10
- package/programs/polygon-on-globe/texture-dem-triangles.js +81 -12
- package/programs/rings/partial-ring/piece-of-pie.js +26 -29
- package/programs/totems/camerauniformblock.js +34 -45
- package/programs/two-d/pixel-padding-for-compass.js +14 -24
- package/programs/vectorfields/logics/drawrectangleparticles.js +1 -2
- package/programs/vectorfields/logics/pixelbased.js +1 -2
- package/programs/vectorfields/pingpongbuffermanager.js +1 -1
- package/range-tools-on-terrain/bearing-line/adapters.js +1 -1
- package/range-tools-on-terrain/circle-line-chain/adapters.js +0 -5
- package/range-tools-on-terrain/circle-line-chain/plugin.js +1 -1
- package/range-tools-on-terrain/range-ring/plugin.js +4 -6
- package/semiplugins/lightweight/line-plugin.js +0 -1
- package/semiplugins/shape-on-terrain/arc-plugin.js +5 -7
- package/semiplugins/shape-on-terrain/circle-plugin.js +2 -2
- package/semiplugins/shape-on-terrain/padding-1-degree.js +1 -2
- package/semiplugins/shell/bbox-renderer/index.js +2 -0
- package/{programs/globeshell/wiggle → semiplugins/shell/bbox-renderer}/logic.js +101 -102
- package/{programs/globeshell/wiggle → semiplugins/shell/bbox-renderer}/object.js +6 -7
- package/semiplugins/utility/container-plugin.js +94 -0
- package/semiplugins/utility/object-pass-container-plugin.js +80 -0
- package/{point-heat-map → tracks/point-heat-map}/adaptors/timetracksplugin-format-to-this.js +1 -1
- package/{point-heat-map → tracks/point-heat-map}/plugin-webworker.js +3 -3
- package/{point-heat-map → tracks/point-heat-map}/point-to-heat-map-flow.js +11 -14
- package/{point-tracks → tracks/point-tracks}/plugin.js +5 -5
- package/{timetracks → tracks/timetracks}/adaptors-line-strip.js +1 -1
- package/{timetracks → tracks/timetracks}/program-line-strip.js +49 -49
- package/{timetracks → tracks/timetracks}/programpoint-line-strip.js +16 -13
- package/types.js +6 -0
- package/util/account/bufferoffsetmanager.js +1 -1
- package/util/account/single-attribute-buffer-management/buffer-orchestrator.js +9 -95
- package/util/gl-util/uniform-block/manager.js +4 -5
- package/util/gl-util/uniform-block/types.js +0 -7
- package/util/index.js +10 -13
- package/util/picking/fence.js +16 -18
- package/util/picking/picker-displayer.js +4 -6
- package/util/programs/{shapesonglobe.js → draw-from-pixel-coords.js} +4 -7
- package/util/programs/draw-texture-on-canvas.js +1 -1
- package/util/programs/texturetoglobe.js +3 -3
- package/util/shaderfunctions/geometrytransformations.js +6 -0
- package/util/webglobe/rasteroverlay.js +1 -0
- package/vectorfield/arrowfield/index.js +3 -0
- package/{arrowfield → vectorfield/arrowfield}/plugin.js +2 -2
- package/{waveparticles → vectorfield/waveparticles}/plugin.js +12 -12
- package/{wind → vectorfield/wind}/index.js +1 -1
- package/{wind → vectorfield/wind}/plugin.js +32 -32
- package/write-text/attached-text-writer.js +9 -1
- package/write-text/context-text3.js +0 -1
- package/write-text/objectarraylabels/index.js +2 -0
- package/Math/mesh/mapbox-delaunay.js +0 -544
- package/arrowfield/index.js +0 -3
- package/bearing-line/index.js +0 -2
- package/bearing-line/plugin.js +0 -444
- package/circle-line-chain/chain-list-map.js +0 -201
- package/circle-line-chain/plugin.js +0 -411
- package/circle-line-chain/util.js +0 -1
- package/compassrose/compassrose.js +0 -293
- package/compassrose/index.js +0 -2
- package/index.js +0 -12
- package/partialrings/buffer-manager.js +0 -75
- package/partialrings/index.js +0 -2
- package/partialrings/plugin.js +0 -128
- package/partialrings/program.js +0 -279
- package/programs/arrowfield/index.js +0 -2
- package/programs/globe-util/is-globe-moved.js +0 -19
- package/programs/globeshell/index.js +0 -2
- package/programs/globeshell/wiggle/index.js +0 -2
- package/programs/helpers/blender/index.js +0 -1
- package/programs/helpers/fadeaway/index.js +0 -2
- package/programs/helpers/fadeaway/object.js +0 -14
- package/programs/helpers/index.js +0 -2
- package/programs/rings/distancering/circleflatprogram.js +0 -116
- package/programs/rings/distancering/circlepaddingfreeangleprogram.js +0 -326
- package/programs/rings/distancering/circlepaddysharedbuffer.js +0 -368
- package/programs/rings/distancering/index.js +0 -6
- package/programs/rings/distancering/paddyflatprogram.js +0 -127
- package/programs/rings/distancering/paddyflatprogram2d.js +0 -129
- package/programs/rings/distancering/paddyflatprogram3d.js +0 -128
- package/programs/two-d/pixel-circle.js +0 -1
- package/programs/vectorfields/index.js +0 -3
- package/rangerings/enum.js +0 -2
- package/rangerings/index.js +0 -5
- package/rangerings/plugin.js +0 -543
- package/rangerings/rangeringangletext.js +0 -326
- package/rangerings/ring-account.js +0 -112
- package/timetracks/index.js +0 -1
- package/util/build-strategy/general-strategy.js +0 -62
- package/util/gl-util/uniform-block/shader.js +0 -1
- package/util/heatwavedatamanager/index.js +0 -2
- package/util/heatwavedatamanager/pointcoordsmeta.js +0 -22
- package/util/jshelpers/data-filler.js +0 -17
- package/util/jshelpers/equality.js +0 -18
- package/util/jshelpers/index.js +0 -2
- package/util/jshelpers/timefilters.js +0 -30
- package/util/programs/index.js +0 -1
- package/util/surface-line-data/arc-bboxes.js +0 -25
- package/util/surface-line-data/arcs-to-cuts.js +0 -50
- package/util/surface-line-data/cut-arc.js +0 -1
- package/util/surface-line-data/flow.js +0 -28
- package/util/surface-line-data/rbush-manager.js +0 -1
- package/util/surface-line-data/web-worker.js +0 -1
- package/write-text/context-text3old.js +0 -152
- package/write-text/index.js +0 -1
- package/write-text/writer-plugin.js +0 -8
- /package/{heatwave/isobar/quadtreecontours.js → Math/contour/quadtreecontours1.js} +0 -0
- /package/{util/surface-line-data → Math/tessellation}/types.js +0 -0
- /package/pin/{pin-object-array.js → pin-object-array1.js} +0 -0
- /package/pin/{pin-point-totem.js → pin-point-totem1.js} +0 -0
- /package/{circle-line-chain/init.js → programs/polygon-on-globe/partial-tesselation.js} +0 -0
- /package/{point-heat-map → tracks/point-heat-map}/index.js +0 -0
- /package/{point-tracks → tracks/point-tracks}/key-methods.js +0 -0
- /package/{timetracks → tracks/timetracks}/plugin-line-strip.js +0 -0
- /package/{arrowfield → vectorfield/arrowfield}/adaptor.js +0 -0
- /package/{waveparticles → vectorfield/waveparticles}/adaptor.js +0 -0
- /package/{waveparticles → vectorfield/waveparticles}/index.js +0 -0
- /package/{wind → vectorfield/wind}/imagetovectorfieldandmagnitude.js +0 -0
- /package/{wind → vectorfield/wind}/vectorfieldimage.js +0 -0
- /package/write-text/{context-text.js → context-textDELETE.js} +0 -0
- /package/{heatwave/isobar → write-text/objectarraylabels}/objectarraylabels.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import WindPlugin from "./plugin";
|
|
2
2
|
import createVectorFieldImage from "./vectorfieldimage";
|
|
3
3
|
import imageToMagnitude, { imageToRadianAngle } from "./imagetovectorfieldandmagnitude";
|
|
4
|
-
import { createImageFromBase64 } from "
|
|
4
|
+
import { createImageFromBase64 } from "../../util/webglobjectbuilders";
|
|
5
5
|
export { createVectorFieldImage, imageToMagnitude, WindPlugin, createImageFromBase64, imageToRadianAngle };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Author: Toprak Nihat Deniz Ozturk
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import { createImageFromBase64, createProgramWrapper, createTexture, createBuffer, bindAttribute, bindFramebuffer, bindTexture, getColorRamp } from "../../util/webglobjectbuilders";
|
|
5
5
|
import imageToMagnitude, { imageToRadianAngle } from "./imagetovectorfieldandmagnitude";
|
|
6
|
-
import { TexturePointSampler } from "
|
|
6
|
+
import { TexturePointSampler } from "../../heatwave/texture-point-sampler";
|
|
7
7
|
/**
|
|
8
8
|
* Shader Dökümanı:
|
|
9
9
|
* * Vektör alan haritasında kaçış değeri
|
|
@@ -415,7 +415,7 @@ export default class WindPlugin {
|
|
|
415
415
|
if (this.gl == null) {
|
|
416
416
|
return;
|
|
417
417
|
}
|
|
418
|
-
this.colorRampTexture =
|
|
418
|
+
this.colorRampTexture = createTexture(this.gl, this.gl.LINEAR, getColorRamp(colors), 16, 16);
|
|
419
419
|
}
|
|
420
420
|
setColorRampDefault() {
|
|
421
421
|
const { uMax, uMin, vMax, vMin } = this.windData;
|
|
@@ -452,8 +452,8 @@ export default class WindPlugin {
|
|
|
452
452
|
values[i]
|
|
453
453
|
]);
|
|
454
454
|
}
|
|
455
|
-
const colorRamp =
|
|
456
|
-
this.colorRampTexture =
|
|
455
|
+
const colorRamp = getColorRamp(colors);
|
|
456
|
+
this.colorRampTexture = createTexture(gl, gl.LINEAR, colorRamp, 16, 16);
|
|
457
457
|
this._rampMax = maxVelocity;
|
|
458
458
|
this._loadRampMax();
|
|
459
459
|
}
|
|
@@ -468,8 +468,8 @@ export default class WindPlugin {
|
|
|
468
468
|
particleState[i] = Math.floor(Math.random() * 256); // randomize the initial particle positions
|
|
469
469
|
}
|
|
470
470
|
// textures to hold the particle state for the current and the next frame
|
|
471
|
-
this.particleStateTexture0 =
|
|
472
|
-
this.particleStateTexture1 =
|
|
471
|
+
this.particleStateTexture0 = createTexture(gl, gl.NEAREST, particleState, particleRes, particleRes);
|
|
472
|
+
this.particleStateTexture1 = createTexture(gl, gl.NEAREST, particleState, particleRes, particleRes);
|
|
473
473
|
const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM);
|
|
474
474
|
gl.useProgram(this.updateProgram.program);
|
|
475
475
|
gl.uniform1f(this.updateProgram.u_wind_res, this.particleStateResolution);
|
|
@@ -482,7 +482,7 @@ export default class WindPlugin {
|
|
|
482
482
|
const particleIndices = new Float32Array(this._numParticles);
|
|
483
483
|
for (let i = 0; i < this._numParticles; i++)
|
|
484
484
|
particleIndices[i] = i;
|
|
485
|
-
this.particleIndexBuffer =
|
|
485
|
+
this.particleIndexBuffer = createBuffer(gl, particleIndices);
|
|
486
486
|
}
|
|
487
487
|
get numParticles() {
|
|
488
488
|
return this._numParticles;
|
|
@@ -504,7 +504,7 @@ export default class WindPlugin {
|
|
|
504
504
|
const windDataMeta = this._windDataMeta;
|
|
505
505
|
const gl = this.gl;
|
|
506
506
|
this.windData = windData;
|
|
507
|
-
this.windTexture =
|
|
507
|
+
this.windTexture = createTexture(gl, gl.LINEAR, windData.image);
|
|
508
508
|
const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM);
|
|
509
509
|
gl.useProgram(this.updateProgram.program);
|
|
510
510
|
gl.uniform2f(this.updateProgram.u_wind_res, windDataMeta.width, windDataMeta.height);
|
|
@@ -532,7 +532,7 @@ export default class WindPlugin {
|
|
|
532
532
|
* @param {Array} windData.bbox - bounding box [minLon, minLat, maxLon, maxLat]
|
|
533
533
|
*/
|
|
534
534
|
setWindDataWithImageBase64(windData) {
|
|
535
|
-
const image =
|
|
535
|
+
const image = createImageFromBase64(windData.image);
|
|
536
536
|
image.onload = () => {
|
|
537
537
|
windData.image = image;
|
|
538
538
|
this.setWind(windData);
|
|
@@ -543,14 +543,14 @@ export default class WindPlugin {
|
|
|
543
543
|
* @returns
|
|
544
544
|
*/
|
|
545
545
|
getTexturePointSampler(type = `magnitude`) {
|
|
546
|
-
if (type
|
|
546
|
+
if (type === `magnitude`) {
|
|
547
547
|
if (!this.texturePointSampler) {
|
|
548
548
|
this._createTexturePointSampler();
|
|
549
549
|
this._setCoorcinatesDataCalculatorData();
|
|
550
550
|
}
|
|
551
551
|
return this.texturePointSampler;
|
|
552
552
|
}
|
|
553
|
-
else if (type
|
|
553
|
+
else if (type === `angle`) {
|
|
554
554
|
if (!this.texturePointSamplerAngle) {
|
|
555
555
|
this._createTexturePointSamplerAngle();
|
|
556
556
|
this._setCoorcinatesDataCalculatorData();
|
|
@@ -665,16 +665,16 @@ export default class WindPlugin {
|
|
|
665
665
|
}
|
|
666
666
|
_drawScreen() {
|
|
667
667
|
const { gl, globe } = this;
|
|
668
|
-
|
|
669
|
-
|
|
668
|
+
bindTexture(gl, this.windTexture, 0);
|
|
669
|
+
bindTexture(gl, this.particleStateTexture0, 1);
|
|
670
670
|
// draw the screen into a temporary framebuffer to retain it as the background on the next frame
|
|
671
|
-
|
|
671
|
+
bindFramebuffer(gl, this.framebuffer, this.screenTexture);
|
|
672
672
|
gl.viewport(0, 0, globe.api_ScrW(), globe.api_ScrH());
|
|
673
673
|
gl.enable(gl.BLEND);
|
|
674
674
|
gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA); // non-premultiplied alpha
|
|
675
675
|
this._drawTexture(this.backgroundTexture, this._fadeOpacity);
|
|
676
676
|
this._drawParticles();
|
|
677
|
-
|
|
677
|
+
bindFramebuffer(gl, null);
|
|
678
678
|
this._drawTexture(this.screenTexture, 1.0);
|
|
679
679
|
gl.disable(gl.BLEND);
|
|
680
680
|
// save the current screen as the background for the next frame
|
|
@@ -686,8 +686,8 @@ export default class WindPlugin {
|
|
|
686
686
|
const gl = this.gl;
|
|
687
687
|
const program = this.screenProgram;
|
|
688
688
|
gl.useProgram(program.program);
|
|
689
|
-
|
|
690
|
-
|
|
689
|
+
bindAttribute(gl, this.quadBuffer, program.a_pos, 2);
|
|
690
|
+
bindTexture(gl, texture, 2);
|
|
691
691
|
gl.uniform1i(program.u_screen, 2);
|
|
692
692
|
gl.uniform1f(program.u_opacity, opacity);
|
|
693
693
|
gl.drawArrays(gl.TRIANGLES, 0, 6);
|
|
@@ -706,8 +706,8 @@ export default class WindPlugin {
|
|
|
706
706
|
const { gl, projMatrix, modelviewMatrix, transPos } = this;
|
|
707
707
|
const program = this.drawSphereProgram;
|
|
708
708
|
gl.useProgram(program.program);
|
|
709
|
-
|
|
710
|
-
|
|
709
|
+
bindAttribute(gl, this.particleIndexBuffer, program.a_index, 1);
|
|
710
|
+
bindTexture(gl, this.colorRampTexture, 2);
|
|
711
711
|
gl.uniform1i(program.u_wind, 0);
|
|
712
712
|
gl.uniform1i(program.u_particles, 1);
|
|
713
713
|
gl.uniform1i(program.u_color_ramp, 2);
|
|
@@ -720,8 +720,8 @@ export default class WindPlugin {
|
|
|
720
720
|
const { gl, transPos, projMatrix, globe } = this;
|
|
721
721
|
const program = this.drawFlatProgram;
|
|
722
722
|
gl.useProgram(program.program);
|
|
723
|
-
|
|
724
|
-
|
|
723
|
+
bindAttribute(gl, this.particleIndexBuffer, program.a_index, 1);
|
|
724
|
+
bindTexture(gl, this.colorRampTexture, 2);
|
|
725
725
|
gl.uniform1i(program.u_wind, 0);
|
|
726
726
|
gl.uniform1i(program.u_particles, 1);
|
|
727
727
|
gl.uniform1i(program.u_color_ramp, 2);
|
|
@@ -763,12 +763,12 @@ export default class WindPlugin {
|
|
|
763
763
|
const program = this.updateProgram;
|
|
764
764
|
gl.useProgram(program.program);
|
|
765
765
|
gl.viewport(0, 0, this.particleStateResolution, this.particleStateResolution);
|
|
766
|
-
|
|
766
|
+
bindAttribute(gl, this.quadBuffer, program.a_pos, 2);
|
|
767
767
|
gl.uniform1i(program.u_wind, 0);
|
|
768
768
|
gl.uniform1i(program.u_particles, 1);
|
|
769
|
-
|
|
769
|
+
bindAttribute(gl, this.quadBuffer, program.a_pos, 2);
|
|
770
770
|
gl.uniform1f(program.u_rand_seed, Math.random());
|
|
771
|
-
|
|
771
|
+
bindFramebuffer(gl, this.framebuffer, this.particleStateTexture1);
|
|
772
772
|
gl.drawArrays(gl.TRIANGLES, 0, 6);
|
|
773
773
|
// swap the particle state textures so the new one becomes the current one
|
|
774
774
|
const temp = this.particleStateTexture0;
|
|
@@ -873,11 +873,11 @@ export default class WindPlugin {
|
|
|
873
873
|
// console.log("init wind plugin")
|
|
874
874
|
this.globe = globe;
|
|
875
875
|
this.gl = gl;
|
|
876
|
-
this.drawSphereProgram =
|
|
877
|
-
this.screenProgram =
|
|
878
|
-
this.updateProgram =
|
|
879
|
-
this.drawFlatProgram =
|
|
880
|
-
this.quadBuffer =
|
|
876
|
+
this.drawSphereProgram = createProgramWrapper(gl, drawSphereVert, drawFrag);
|
|
877
|
+
this.screenProgram = createProgramWrapper(gl, quadVert, screenFrag);
|
|
878
|
+
this.updateProgram = createProgramWrapper(gl, quadVert, updateFrag);
|
|
879
|
+
this.drawFlatProgram = createProgramWrapper(gl, drawFlatVert, drawFrag);
|
|
880
|
+
this.quadBuffer = createBuffer(gl, new Float32Array([0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1]));
|
|
881
881
|
this.framebuffer = gl.createFramebuffer();
|
|
882
882
|
this._loadFadeOpacity();
|
|
883
883
|
this._loadSpeedFactor();
|
|
@@ -897,8 +897,8 @@ export default class WindPlugin {
|
|
|
897
897
|
const { gl, globe } = this;
|
|
898
898
|
const emptyPixels = new Uint8Array(globe.api_ScrW() * globe.api_ScrH() * 4);
|
|
899
899
|
// screen textures to hold the drawn screen for the previous and the current frame
|
|
900
|
-
this.backgroundTexture =
|
|
901
|
-
this.screenTexture =
|
|
900
|
+
this.backgroundTexture = createTexture(gl, gl.LINEAR, emptyPixels, globe.api_ScrW(), globe.api_ScrH());
|
|
901
|
+
this.screenTexture = createTexture(gl, gl.LINEAR, emptyPixels, globe.api_ScrW(), globe.api_ScrH());
|
|
902
902
|
gl.viewport(0, 0, globe.api_ScrW(), globe.api_ScrH());
|
|
903
903
|
}
|
|
904
904
|
// globe calls this `free` on plugin object unregistration
|
|
@@ -9,7 +9,7 @@ import { isTextFont, opacityCheck } from "../util/check/typecheck";
|
|
|
9
9
|
* This makes the code more readable and maintainable.
|
|
10
10
|
*
|
|
11
11
|
* With AttachedTextWriter the glue is created by user.
|
|
12
|
-
* I observed that the users generally uses a wrapper around the plugin logic anyway. This wrapper can be used as the glue for plugin and
|
|
12
|
+
* I observed that the users generally uses a wrapper around the plugin logic anyway. This wrapper can be used as the glue for plugin and attached writer.
|
|
13
13
|
*/
|
|
14
14
|
export class AttachedTextWriter {
|
|
15
15
|
constructor(globe, { style = {
|
|
@@ -57,6 +57,14 @@ export class AttachedTextWriter {
|
|
|
57
57
|
this._itemMap.set(key, item);
|
|
58
58
|
this.globe.DrawRender();
|
|
59
59
|
}
|
|
60
|
+
removeItem(item) {
|
|
61
|
+
const key = this.keyAdaptor ? this.keyAdaptor(item) : item;
|
|
62
|
+
if (this._itemMap.delete(key)) {
|
|
63
|
+
this.globe.DrawRender();
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
60
68
|
// TODO: use item style
|
|
61
69
|
draw() {
|
|
62
70
|
if (!this.doDraw) {
|