cesiumjs-anywidget 0.3.0__py3-none-any.whl → 0.4.0__py3-none-any.whl

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.
@@ -935,23 +935,42 @@ function initializeMeasurementTools(viewer, model, container) {
935
935
  </button>
936
936
  `;
937
937
  editorPanel.style.display = "block";
938
- document.getElementById("apply-coords").onclick = () => {
939
- const lon = parseFloat(document.getElementById("edit-lon").value);
940
- const lat = parseFloat(document.getElementById("edit-lat").value);
941
- const alt = parseFloat(document.getElementById("edit-alt").value);
942
- const newPosition = Cesium.Cartesian3.fromDegrees(lon, lat, alt);
943
- updatePointPosition(newPosition);
944
- finalizeMeasurementUpdate();
945
- };
946
- document.getElementById("close-editor").onclick = () => {
947
- deselectPoint();
948
- };
949
- ["edit-lon", "edit-lat", "edit-alt"].forEach((id) => {
950
- document.getElementById(id).onkeypress = (e) => {
951
- if (e.key === "Enter") {
952
- document.getElementById("apply-coords").click();
938
+ const applyBtn = document.getElementById("apply-coords");
939
+ const closeBtn = document.getElementById("close-editor");
940
+ const editLonInput = document.getElementById("edit-lon");
941
+ const editLatInput = document.getElementById("edit-lat");
942
+ const editAltInput = document.getElementById("edit-alt");
943
+ if (!applyBtn || !closeBtn || !editLonInput || !editLatInput || !editAltInput) {
944
+ console.warn("[CesiumWidget] Editor panel input elements not found in DOM");
945
+ }
946
+ if (applyBtn) {
947
+ applyBtn.onclick = () => {
948
+ if (!editLonInput || !editLatInput || !editAltInput) {
949
+ console.warn("[CesiumWidget] Editor input fields not available");
950
+ return;
953
951
  }
952
+ const lon = parseFloat(editLonInput.value);
953
+ const lat = parseFloat(editLatInput.value);
954
+ const alt = parseFloat(editAltInput.value);
955
+ const newPosition = Cesium.Cartesian3.fromDegrees(lon, lat, alt);
956
+ updatePointPosition(newPosition);
957
+ finalizeMeasurementUpdate();
954
958
  };
959
+ }
960
+ if (closeBtn) {
961
+ closeBtn.onclick = () => {
962
+ deselectPoint();
963
+ };
964
+ }
965
+ ["edit-lon", "edit-lat", "edit-alt"].forEach((id) => {
966
+ const element = document.getElementById(id);
967
+ if (element) {
968
+ element.onkeypress = (e) => {
969
+ if (e.key === "Enter" && applyBtn) {
970
+ applyBtn.click();
971
+ }
972
+ };
973
+ }
955
974
  });
956
975
  }
957
976
  function updatePointPosition(newPosition) {
@@ -1105,6 +1124,10 @@ function initializeMeasurementTools(viewer, model, container) {
1105
1124
  function updateMeasurementsList() {
1106
1125
  const results = model.get("measurement_results") || [];
1107
1126
  const listContent = document.getElementById("measurements-list-content");
1127
+ if (!listContent) {
1128
+ console.warn("[CesiumWidget] Measurements list content element not found in DOM");
1129
+ return;
1130
+ }
1108
1131
  if (results.length === 0) {
1109
1132
  listContent.innerHTML = '<div style="color: #888; font-style: italic;">No measurements yet</div>';
1110
1133
  return;
@@ -1155,10 +1178,15 @@ function initializeMeasurementTools(viewer, model, container) {
1155
1178
  }
1156
1179
  };
1157
1180
  listContent.appendChild(measurementDiv);
1158
- document.getElementById(`rename-${index}`).onclick = (e) => {
1159
- e.stopPropagation();
1160
- renameMeasurement(index, name);
1161
- };
1181
+ const renameBtn = document.getElementById(`rename-${index}`);
1182
+ if (renameBtn) {
1183
+ renameBtn.onclick = (e) => {
1184
+ e.stopPropagation();
1185
+ renameMeasurement(index, name);
1186
+ };
1187
+ } else {
1188
+ console.warn(`[CesiumWidget] Rename button not found for measurement ${index}`);
1189
+ }
1162
1190
  });
1163
1191
  }
1164
1192
  function getMeasurementColor(type) {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cesiumjs-anywidget
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: A Jupyter widget for CesiumJS 3D globe visualization using anywidget
5
5
  Project-URL: Homepage, https://github.com/Alex-PLACET/cesiumjs_anywidget
6
6
  Project-URL: Repository, https://github.com/Alex-PLACET/cesiumjs_anywidget
@@ -0,0 +1,8 @@
1
+ cesiumjs_anywidget/__init__.py,sha256=9WVcAtreHgk6C5clPG6sZy4m7s5AIbGU1DJ4oDpx3Is,165
2
+ cesiumjs_anywidget/styles.css,sha256=kt2i9fJuM6gaR7WkoQ2VGGoHzhqy6RpJVK2xwMKPV70,689
3
+ cesiumjs_anywidget/widget.py,sha256=_7uXX7B3KsOg_3QrMDfV0pZ8BGA-6coFnZ7_gTI3nck,39104
4
+ cesiumjs_anywidget/index.js,sha256=SrJ9F9xHdfvbz5CkP_ydspiDaPU6vp74vxtUv-RVimE,68405
5
+ cesiumjs_anywidget-0.4.0.dist-info/METADATA,sha256=NwADYoiPPp4RLblmHCM5_mhak_cCB7ptC4iN0NXVZTY,24778
6
+ cesiumjs_anywidget-0.4.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
7
+ cesiumjs_anywidget-0.4.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
8
+ cesiumjs_anywidget-0.4.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.27.0
2
+ Generator: hatchling 1.28.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,8 +0,0 @@
1
- cesiumjs_anywidget/__init__.py,sha256=9WVcAtreHgk6C5clPG6sZy4m7s5AIbGU1DJ4oDpx3Is,165
2
- cesiumjs_anywidget/styles.css,sha256=kt2i9fJuM6gaR7WkoQ2VGGoHzhqy6RpJVK2xwMKPV70,689
3
- cesiumjs_anywidget/widget.py,sha256=_7uXX7B3KsOg_3QrMDfV0pZ8BGA-6coFnZ7_gTI3nck,39104
4
- cesiumjs_anywidget/index.js,sha256=eSZZJhS2-3UDipN3KkXpxUMTgx4Jzs8sSHAWSjhUnHU,67449
5
- cesiumjs_anywidget-0.3.0.dist-info/METADATA,sha256=eTd0CCg94JXQ5ezxPvZGyyvJG_ZSCIu41jkYCUav5cs,24778
6
- cesiumjs_anywidget-0.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
- cesiumjs_anywidget-0.3.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
8
- cesiumjs_anywidget-0.3.0.dist-info/RECORD,,