geokernel-electron 1.1.59 → 1.1.61

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
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geokernel-electron",
3
- "version": "1.1.59",
3
+ "version": "1.1.61",
4
4
  "description": "Electron bindings for the GeoKernel GIS SDK.",
5
5
  "main": "src/index.js",
6
6
  "type": "commonjs",
@@ -56,7 +56,7 @@ const SIGNATURES = Object.freeze({
56
56
  "GeoKernelViewer_ArcMakeConnectedJson": ["int", ["void_p", "double_p", "int", "double_p", "int_p", "int", "out_wchar_p", "int"]],
57
57
  "GeoKernelViewer_ArcSplitOnCrossJson": ["int", ["void_p", "double_p", "int", "double_p", "int_p", "int", "out_wchar_p", "int"]],
58
58
  "GeoKernelViewer_BeginEditLayer": ["bool", ["void_p", "int"]],
59
- "GeoKernelViewer_BuildRoutingGraphForLayer": ["bool", ["void_p", "int", "double", "bool", "wchar_p", "wchar_p", "double"]],
59
+ "GeoKernelViewer_BuildRoutingGraphForLayer": ["bool", ["void_p", "int", "double", "bool", "wchar_p", "wchar_p", "wchar_p", "double"]],
60
60
  "GeoKernelViewer_CancelEditSketch": ["void", ["void_p"]],
61
61
  "GeoKernelViewer_CanEditLayer": ["bool", ["void_p", "int"]],
62
62
  "GeoKernelViewer_CanEditSelectedFeatures": ["bool", ["void_p"]],
@@ -130,6 +130,7 @@ const SIGNATURES = Object.freeze({
130
130
  "GeoKernelViewer_GetPolygonCentroidInfoJson": ["int", ["void_p", "double_p", "int", "out_wchar_p", "int"]],
131
131
  "GeoKernelViewer_GetPolylineCrossingsJson": ["int", ["void_p", "double_p", "int", "double_p", "int", "out_wchar_p", "int"]],
132
132
  "GeoKernelViewer_GetRasterOverviewDiagnosticsJson": ["int", ["void_p", "int", "bool", "out_wchar_p", "int"]],
133
+ "GeoKernelViewer_GetRasterTileCacheDiagnosticsJson": ["int", ["void_p", "int", "bool", "bool", "out_wchar_p", "int"]],
133
134
  "GeoKernelViewer_GetRasterWorldTransformJson": ["int", ["void_p", "int", "double", "double", "out_wchar_p", "int"]],
134
135
  "GeoKernelViewer_GetRenderBackendDiagnostics": ["int", ["void_p", "out_wchar_p", "int"]],
135
136
  "GeoKernelViewer_GetRenderBackendPreference": ["int", ["void_p"]],
package/src/viewer.js CHANGED
@@ -11,6 +11,7 @@ const {
11
11
  ViewerTool,
12
12
  extent,
13
13
  point,
14
+ routeSummary,
14
15
  } = require("./types");
15
16
  const {
16
17
  extentObject,
@@ -401,6 +402,57 @@ class ViewerWindow {
401
402
  this.addLayerFile(filePath, options);
402
403
  }
403
404
 
405
+ buildRoutingGraphForLayer(index, options = {}) {
406
+ return this._call(
407
+ "GeoKernelViewer_BuildRoutingGraphForLayer",
408
+ Number(index),
409
+ Number(options.snapTolerance ?? 0),
410
+ options.undirected ?? true,
411
+ options.speedFieldName ?? "SPEED",
412
+ options.nameFieldName ?? "AD",
413
+ options.oneWayFieldName ?? "ONEWAY",
414
+ Number(options.defaultSpeedKmh ?? 50),
415
+ );
416
+ }
417
+
418
+ hasRoutingGraph() {
419
+ return this._call("GeoKernelViewer_HasRoutingGraph");
420
+ }
421
+
422
+ clearRoutingGraph() {
423
+ this._call("GeoKernelViewer_ClearRoutingGraph");
424
+ }
425
+
426
+ routingGraphLayerIndex() {
427
+ return this._call("GeoKernelViewer_GetRoutingGraphLayerIndex");
428
+ }
429
+
430
+ routingGraphNodeCount() {
431
+ return this._call("GeoKernelViewer_GetRoutingGraphNodeCount");
432
+ }
433
+
434
+ routingGraphEdgeCount() {
435
+ return this._call("GeoKernelViewer_GetRoutingGraphEdgeCount");
436
+ }
437
+
438
+ addShortestRouteLayerBetweenPoints(fromWorldPoint, toWorldPoint, options = {}) {
439
+ const summary = {};
440
+ this._call(
441
+ "GeoKernelViewer_AddShortestRouteLayerBetweenPoints",
442
+ Number(fromWorldPoint.x),
443
+ Number(fromWorldPoint.y),
444
+ Number(toWorldPoint.x),
445
+ Number(toWorldPoint.y),
446
+ Number(options.metric ?? 0),
447
+ Number(options.maxSnapDistance ?? Number.POSITIVE_INFINITY),
448
+ Number(options.defaultSpeedKmh ?? 50),
449
+ options.layerName ?? "Route",
450
+ options.zoomToRoute ?? false,
451
+ summary,
452
+ );
453
+ return routeSummary(summary);
454
+ }
455
+
404
456
  addOpenStreetMapLayer(localCacheEnabled = true) {
405
457
  return this._call("GeoKernelViewer_AddOpenStreetMapLayer", Boolean(localCacheEnabled));
406
458
  }
@@ -1028,6 +1080,16 @@ class ViewerWindow {
1028
1080
  );
1029
1081
  }
1030
1082
 
1083
+ rasterTileCacheDiagnostics(index, runBenchmark = false, clearCache = false) {
1084
+ return this._readJson(
1085
+ "GeoKernelViewer_GetRasterTileCacheDiagnosticsJson",
1086
+ {},
1087
+ Number(index),
1088
+ Boolean(runBenchmark),
1089
+ Boolean(clearCache),
1090
+ );
1091
+ }
1092
+
1031
1093
  layerInfoByName(name) {
1032
1094
  return this._readJson("GeoKernelViewer_GetLayerInfoByNameJson", {}, name);
1033
1095
  }