geokernel-electron 1.2.4 → 1.2.6

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/README.md CHANGED
@@ -53,6 +53,15 @@ viewer.addControlPanel({
53
53
  }, (_id, _number, text) => console.log(text));
54
54
  viewer.setControlOptions(1, ["Route 1", "Route 2"]);
55
55
  viewer.setControlEnabled(1, true);
56
+ viewer.setCommandEnabled(10, false);
57
+ viewer.addTextShape(28.97, 41.01, "1", { textColor: "#FFFFFF", bold: true });
58
+
59
+ // Lightweight named overlays update without invalidating map-layer caches.
60
+ viewer.setOverlayPoint("vehicle", 28.97, 41.01, {
61
+ pointColor: "#2563EB", lineColor: "#1E3A8A", pointSize: 20, lineWidth: 2,
62
+ });
63
+ viewer.removeOverlayShape("vehicle");
64
+ viewer.clearOverlayShapes();
56
65
 
57
66
  const native = createNativeLibrary();
58
67
  console.log(native.getFunction("GeoKernelViewer_GetLayerCount"));
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.4",
3
+ "version": "1.2.6",
4
4
  "description": "Electron bindings for the GeoKernel GIS SDK.",
5
5
  "main": "src/index.js",
6
6
  "type": "commonjs",
@@ -45,6 +45,7 @@ const SIGNATURES = Object.freeze({
45
45
  "GeoKernelViewer_AddPolylineToEditLayer": ["bool", ["void_p", "int", "double_p", "int"]],
46
46
  "GeoKernelViewer_AddPolylineToEditLayerWithAttributes": ["bool", ["void_p", "int", "double_p", "int", "wchar_p"]],
47
47
  "GeoKernelViewer_AddShortestRouteLayerBetweenPoints": ["bool", ["void_p", "double", "double", "double", "double", "int", "double", "double", "wchar_p", "bool", "out_route_summary_p"]],
48
+ "GeoKernelViewer_AddTextShape": ["bool", ["void_p", "double", "double", "wchar_p", "wchar_p"]],
48
49
  "GeoKernelViewer_AddTopFeatureToSelectionAt": ["bool", ["void_p", "double", "double", "int"]],
49
50
  "GeoKernelViewer_AddWfsLayer": ["int", ["void_p", "wchar_p", "wchar_p", "wchar_p", "wchar_p", "wchar_p", "wchar_p", "int"]],
50
51
  "GeoKernelViewer_AddWktShape": ["bool", ["void_p", "wchar_p"]],
@@ -71,6 +72,7 @@ const SIGNATURES = Object.freeze({
71
72
  "GeoKernelViewer_ClearLayerVisibleScaleRange": ["bool", ["void_p", "int"]],
72
73
  "GeoKernelViewer_ClearMeasure": ["void", ["void_p"]],
73
74
  "GeoKernelViewer_ClearNewFeatureAttributes": ["void", ["void_p"]],
75
+ "GeoKernelViewer_ClearOverlayShapes": ["void", ["void_p"]],
74
76
  "GeoKernelViewer_ClearRoutingGraph": ["void", ["void_p"]],
75
77
  "GeoKernelViewer_ClearSelectedFeatures": ["void", ["void_p"]],
76
78
  "GeoKernelViewer_ClearShapes": ["void", ["void_p"]],
@@ -193,6 +195,7 @@ const SIGNATURES = Object.freeze({
193
195
  "GeoKernelViewer_RelatePolylinesPattern": ["bool", ["void_p", "double_p", "int", "double_p", "int", "wchar_p"]],
194
196
  "GeoKernelViewer_RemoveLayer": ["bool", ["void_p", "int"]],
195
197
  "GeoKernelViewer_RemoveLayerByName": ["bool", ["void_p", "wchar_p"]],
198
+ "GeoKernelViewer_RemoveOverlayShape": ["bool", ["void_p", "wchar_p"]],
196
199
  "GeoKernelViewer_Resize": ["void", ["void_p", "int", "int"]],
197
200
  "GeoKernelViewer_RollbackEditLayer": ["bool", ["void_p", "int"]],
198
201
  "GeoKernelViewer_SaveLayerAsShapefile": ["bool", ["void_p", "int", "wchar_p"]],
@@ -227,6 +230,7 @@ const SIGNATURES = Object.freeze({
227
230
  "GeoKernelViewer_SetMiniMapBackgroundColor": ["void", ["void_p", "int"]],
228
231
  "GeoKernelViewer_SetMiniMapVisible": ["void", ["void_p", "bool"]],
229
232
  "GeoKernelViewer_SetNewFeatureAttributesJson": ["void", ["void_p", "wchar_p"]],
233
+ "GeoKernelViewer_SetOverlayPoint": ["bool", ["void_p", "wchar_p", "double", "double", "wchar_p"]],
230
234
  "GeoKernelViewer_SetRenderBackendPreference": ["void", ["void_p", "int"]],
231
235
  "GeoKernelViewer_SetRenderBackendPreferenceName": ["void", ["void_p", "wchar_p"]],
232
236
  "GeoKernelViewer_SetRenderDebugFile": ["void", ["void_p", "bool"]],
@@ -299,6 +303,7 @@ const SIGNATURES = Object.freeze({
299
303
  "GeoKernelWindow_SetCentralText": ["bool", ["void_p", "wchar_p"]],
300
304
  "GeoKernelWindow_SetCentralTextPanel": ["bool", ["void_p", "wchar_p"]],
301
305
  "GeoKernelWindow_SetCentralViewer": ["void_p", ["void_p"]],
306
+ "GeoKernelWindow_SetCommandEnabled": ["bool", ["void_p", "int", "bool"]],
302
307
  "GeoKernelWindow_SetControlEnabled": ["bool", ["void_p", "int", "bool"]],
303
308
  "GeoKernelWindow_SetControlOptionsJson": ["bool", ["void_p", "int", "wchar_p"]],
304
309
  "GeoKernelWindow_SetControlValue": ["bool", ["void_p", "int", "double", "wchar_p"]],
package/src/viewer.js CHANGED
@@ -229,6 +229,12 @@ class ViewerWindow {
229
229
  if (!ok) throw new Error("GeoKernelWindow_AddCommandToolbar failed.");
230
230
  }
231
231
 
232
+ setCommandEnabled(commandId, enabled) {
233
+ return this.library.function("GeoKernelWindow_SetCommandEnabled")(
234
+ this.windowHandle, Number(commandId), Boolean(enabled),
235
+ );
236
+ }
237
+
232
238
  addControlPanel(configuration, onChange) {
233
239
  const callback = koffi.register(
234
240
  (controlId, numericValue, textValue) => onChange(controlId, numericValue, textValue ?? ""),
@@ -1281,6 +1287,34 @@ class ViewerWindow {
1281
1287
  return this._call("GeoKernelViewer_AddPointShape", Number(x), Number(y), jsonText(style));
1282
1288
  }
1283
1289
 
1290
+ setOverlayPoint(id, x, y, style = {}) {
1291
+ if (typeof id !== "string" || id.trim().length === 0) {
1292
+ throw new TypeError("id must be a non-empty string.");
1293
+ }
1294
+ return this._call(
1295
+ "GeoKernelViewer_SetOverlayPoint",
1296
+ id, Number(x), Number(y), jsonText(style),
1297
+ );
1298
+ }
1299
+
1300
+ removeOverlayShape(id) {
1301
+ if (typeof id !== "string" || id.trim().length === 0) {
1302
+ throw new TypeError("id must be a non-empty string.");
1303
+ }
1304
+ return this._call("GeoKernelViewer_RemoveOverlayShape", id);
1305
+ }
1306
+
1307
+ clearOverlayShapes() {
1308
+ this._call("GeoKernelViewer_ClearOverlayShapes");
1309
+ }
1310
+
1311
+ addTextShape(x, y, text, style = {}) {
1312
+ return this._call(
1313
+ "GeoKernelViewer_AddTextShape",
1314
+ Number(x), Number(y), String(text), jsonText(style),
1315
+ );
1316
+ }
1317
+
1284
1318
  addPointBufferShape(x, y, distance, pointsPerQuadrant = 16, style = {}) {
1285
1319
  return this._call(
1286
1320
  "GeoKernelViewer_AddPointBufferShape",