geokernel-electron 1.2.2 → 1.2.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.
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geokernel-electron",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "Electron bindings for the GeoKernel GIS SDK.",
5
5
  "main": "src/index.js",
6
6
  "type": "commonjs",
@@ -142,6 +142,7 @@ const SIGNATURES = Object.freeze({
142
142
  "GeoKernelViewer_GetRenderStepLog": ["bool", ["void_p"]],
143
143
  "GeoKernelViewer_GetRenderStepLogPath": ["int", ["void_p", "out_wchar_p", "int"]],
144
144
  "GeoKernelViewer_GetRoutingGraphEdgeCount": ["int", ["void_p"]],
145
+ "GeoKernelViewer_GetRoutingGraphJson": ["int", ["void_p", "out_wchar_p", "int"]],
145
146
  "GeoKernelViewer_GetRoutingGraphLayerIndex": ["int", ["void_p"]],
146
147
  "GeoKernelViewer_GetRoutingGraphNodeCount": ["int", ["void_p"]],
147
148
  "GeoKernelViewer_GetScaleBarVisible": ["bool", ["void_p"]],
@@ -294,15 +295,15 @@ const SIGNATURES = Object.freeze({
294
295
  "GeoKernelWindow_Destroy": ["void", ["void_p"]],
295
296
  "GeoKernelWindow_GetSelectedLayerIndex": ["int", ["void_p"]],
296
297
  "GeoKernelWindow_IsVisible": ["bool", ["void_p"]],
297
- "GeoKernelWindow_SetCentralViewer": ["void_p", ["void_p"]],
298
- "GeoKernelWindow_SetCentralTextPanel": ["bool", ["void_p", "wchar_p"]],
298
+ "GeoKernelWindow_SetAttributionText": ["void", ["void_p", "wchar_p"]],
299
299
  "GeoKernelWindow_SetCentralText": ["bool", ["void_p", "wchar_p"]],
300
+ "GeoKernelWindow_SetCentralTextPanel": ["bool", ["void_p", "wchar_p"]],
301
+ "GeoKernelWindow_SetCentralViewer": ["void_p", ["void_p"]],
300
302
  "GeoKernelWindow_SetControlValue": ["bool", ["void_p", "int", "double", "wchar_p"]],
301
303
  "GeoKernelWindow_SetLegendItemsJson": ["bool", ["void_p", "wchar_p"]],
302
304
  "GeoKernelWindow_SetLegendTitle": ["bool", ["void_p", "wchar_p"]],
303
305
  "GeoKernelWindow_SetLegendWidth": ["bool", ["void_p", "int"]],
304
306
  "GeoKernelWindow_SetStatusText": ["void", ["void_p", "wchar_p"]],
305
- "GeoKernelWindow_SetAttributionText": ["void", ["void_p", "wchar_p"]],
306
307
  "GeoKernelWindow_Show": ["void", ["void_p"]],
307
308
  });
308
309
 
package/src/viewer.js CHANGED
@@ -435,6 +435,41 @@ class ViewerWindow {
435
435
  return this._call("GeoKernelViewer_GetRoutingGraphEdgeCount");
436
436
  }
437
437
 
438
+ getRoutingGraphJson() {
439
+ return this._readText("GeoKernelViewer_GetRoutingGraphJson");
440
+ }
441
+
442
+ getRoutingGraphSnapshot() {
443
+ const value = parseJson(this.getRoutingGraphJson(), null);
444
+ if (!value || !Array.isArray(value.nodes) || !Array.isArray(value.edges)) {
445
+ return null;
446
+ }
447
+ return {
448
+ nodes: value.nodes.map((node) => ({
449
+ id: Number(node.id),
450
+ x: Number(node.x),
451
+ y: Number(node.y),
452
+ })),
453
+ edges: value.edges.map((edge) => ({
454
+ id: Number(edge.id),
455
+ from: Number(edge.from),
456
+ to: Number(edge.to),
457
+ distance: Number(edge.distance),
458
+ speedKmh: Number(edge.speedKmh),
459
+ oneWay: Boolean(edge.oneWay),
460
+ geometry: Array.isArray(edge.geometry)
461
+ ? edge.geometry.map((coordinate) => [
462
+ Number(coordinate[0]),
463
+ Number(coordinate[1]),
464
+ ])
465
+ : [],
466
+ attributes: edge.attributes && typeof edge.attributes === "object"
467
+ ? { ...edge.attributes }
468
+ : {},
469
+ })),
470
+ };
471
+ }
472
+
438
473
  addShortestRouteLayerBetweenPoints(fromWorldPoint, toWorldPoint, options = {}) {
439
474
  const summary = {};
440
475
  this._call(