@pirireis/webglobeplugins 0.8.10 → 0.8.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.
@@ -9,7 +9,7 @@ import { populateFloat32Array } from "../util/jshelpers/data-filler";
9
9
  import { ContextTextWriter3 } from '../write-text/context-text3';
10
10
  import { isBoolean, constraintFloat, opacityCheck } from '../util/check/typecheck';
11
11
  import { createBufferAndReadInfo } from '../util/gl-util/buffer/integrate-buffer';
12
- import { normalize } from '../util/geometry/index';
12
+ import { sphereCoord } from '../util/geometry/index';
13
13
  /**
14
14
  * Insert info to chain list map (nodes and properties)
15
15
  *
@@ -264,9 +264,6 @@ export class CircleLineChainPlugin {
264
264
 
265
265
  const _circleFlatEdgeCount = this._circleFlatEdgeCount;
266
266
  {
267
- const sphereCoord = (long, lat) => {
268
- return normalize(globe.api_GetCartesian3DPoint(long, lat, 0, 0), 6378.137);
269
- }
270
267
 
271
268
  // createBuffers
272
269
  const bufferType = "DYNAMIC_DRAW";
@@ -279,7 +276,7 @@ export class CircleLineChainPlugin {
279
276
  }],
280
277
  ["centerCoords3d", {
281
278
  'bufferManager': new BufferManager(gl, 3, { bufferType, initialCapacity }),
282
- 'adaptor': (item) => new sphereCoord(item.long, item.lat, 0, 0),
279
+ 'adaptor': (item) => sphereCoord(item.long, item.lat, globe),
283
280
  }],
284
281
  ["targetCoords2d", {
285
282
  'bufferManager': new BufferManager(gl, 2, { bufferType, initialCapacity }),
@@ -287,7 +284,7 @@ export class CircleLineChainPlugin {
287
284
  }],
288
285
  ["targetCoords3d", {
289
286
  'bufferManager': new BufferManager(gl, 3, { bufferType, initialCapacity }),
290
- 'adaptor': (item) => sphereCoord(item.long, item.lat, 0, 0),
287
+ 'adaptor': (item) => sphereCoord(item.targetLong, item.targetLat, globe),
291
288
  }],
292
289
  ["rgba", {
293
290
  'bufferManager': new BufferManager(gl, 4, { bufferType, initialCapacity }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pirireis/webglobeplugins",
3
- "version": "0.8.10",
3
+ "version": "0.8.11",
4
4
  "main": "index.js",
5
5
  "author": "Toprak Nihat Deniz Ozturk",
6
6
  "license": "MIT"
@@ -43,3 +43,8 @@ export function normalize(array, newLength = 1) {
43
43
  }
44
44
  return result;
45
45
  }
46
+
47
+
48
+ export function sphereCoord(long, lat, globe) {
49
+ return normalize(globe.api_GetCartesian3DPoint(long, lat, 0, 0), 6378.137);
50
+ }