moos-map 1.2.0__tar.gz → 1.2.1__tar.gz

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.
Files changed (40) hide show
  1. {moos_map-1.2.0/src/moos_map.egg-info → moos_map-1.2.1}/PKG-INFO +1 -1
  2. {moos_map-1.2.0 → moos_map-1.2.1}/pyproject.toml +1 -1
  3. {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/__init__.py +1 -1
  4. {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/static/app.js +29 -10
  5. {moos_map-1.2.0 → moos_map-1.2.1/src/moos_map.egg-info}/PKG-INFO +1 -1
  6. {moos_map-1.2.0 → moos_map-1.2.1}/LICENSE +0 -0
  7. {moos_map-1.2.0 → moos_map-1.2.1}/README.md +0 -0
  8. {moos_map-1.2.0 → moos_map-1.2.1}/setup.cfg +0 -0
  9. {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/__main__.py +0 -0
  10. {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/acquisition.py +0 -0
  11. {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/cache.py +0 -0
  12. {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/cli.py +0 -0
  13. {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/errors.py +0 -0
  14. {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/geocoding.py +0 -0
  15. {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/geometry.py +0 -0
  16. {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/models.py +0 -0
  17. {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/moos_compat.py +0 -0
  18. {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/moos_files.py +0 -0
  19. {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/raster.py +0 -0
  20. {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/service.py +0 -0
  21. {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/sources.py +0 -0
  22. {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/static/index.html +0 -0
  23. {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/static/styles.css +0 -0
  24. {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/verification.py +0 -0
  25. {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/web.py +0 -0
  26. {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map.egg-info/SOURCES.txt +0 -0
  27. {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map.egg-info/dependency_links.txt +0 -0
  28. {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map.egg-info/entry_points.txt +0 -0
  29. {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map.egg-info/requires.txt +0 -0
  30. {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map.egg-info/top_level.txt +0 -0
  31. {moos_map-1.2.0 → moos_map-1.2.1}/tests/test_acquisition.py +0 -0
  32. {moos_map-1.2.0 → moos_map-1.2.1}/tests/test_cli.py +0 -0
  33. {moos_map-1.2.0 → moos_map-1.2.1}/tests/test_geocoding.py +0 -0
  34. {moos_map-1.2.0 → moos_map-1.2.1}/tests/test_geometry.py +0 -0
  35. {moos_map-1.2.0 → moos_map-1.2.1}/tests/test_info.py +0 -0
  36. {moos_map-1.2.0 → moos_map-1.2.1}/tests/test_moos_compat.py +0 -0
  37. {moos_map-1.2.0 → moos_map-1.2.1}/tests/test_service.py +0 -0
  38. {moos_map-1.2.0 → moos_map-1.2.1}/tests/test_sources.py +0 -0
  39. {moos_map-1.2.0 → moos_map-1.2.1}/tests/test_verification.py +0 -0
  40. {moos_map-1.2.0 → moos_map-1.2.1}/tests/test_web.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: moos-map
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: Build exact-crop TIFF background maps for MOOS-IvP
5
5
  License-Expression: GPL-3.0-only
6
6
  Project-URL: Repository, https://github.com/cbenjamin23/moos-map
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "moos-map"
7
- version = "1.2.0"
7
+ version = "1.2.1"
8
8
  description = "Build exact-crop TIFF background maps for MOOS-IvP"
9
9
  readme = "README.md"
10
10
  license = "GPL-3.0-only"
@@ -1,3 +1,3 @@
1
1
  """MOOS-IvP background map builder."""
2
2
 
3
- __version__ = "1.2.0"
3
+ __version__ = "1.2.1"
@@ -8,6 +8,7 @@
8
8
  plan: null,
9
9
  previewLayer: null,
10
10
  selectionLayer: null,
11
+ selectionLongitudeOffset: 0,
11
12
  originMarker: null,
12
13
  selecting: false,
13
14
  selectionStart: null,
@@ -25,6 +26,7 @@
25
26
  const INITIAL_MAP_ZOOM = 15;
26
27
  const SEARCH_POINT_ZOOM = 15;
27
28
  const SEARCH_DEBOUNCE_MS = 350;
29
+ const LONGITUDE_TOLERANCE = 1e-10;
28
30
 
29
31
  const map = L.map("map", {
30
32
  zoomControl: true,
@@ -181,7 +183,7 @@
181
183
  async function searchLocations(query) {
182
184
  const sequence = ++state.searchSequence;
183
185
  showSearchStatus("Searching…");
184
- const center = map.getCenter();
186
+ const center = map.wrapLatLng(map.getCenter());
185
187
  const params = new URLSearchParams({
186
188
  q: query,
187
189
  latitude: String(center.lat),
@@ -284,7 +286,7 @@
284
286
  }
285
287
 
286
288
  function updateOriginFromMarker(event, { replan = false } = {}) {
287
- const point = event.target.getLatLng();
289
+ const point = map.wrapLatLng(event.target.getLatLng());
288
290
  setOriginMode(false);
289
291
  setNumber("origin-lat", point.lat);
290
292
  setNumber("origin-lon", point.lng);
@@ -396,17 +398,24 @@
396
398
  }
397
399
  if (!state.originMarker) state.originMarker = createOriginMarker();
398
400
  if (!map.hasLayer(state.originMarker)) state.originMarker.addTo(map);
399
- state.originMarker.setLatLng([latitude, longitude]);
401
+ const displayCenter = state.selectionLayer?.bounds?.getCenter().lng ?? map.getCenter().lng;
402
+ const displayLongitude = longitude + 360 * Math.round((displayCenter - longitude) / 360);
403
+ state.originMarker.setLatLng([latitude, displayLongitude]);
400
404
  }
401
405
 
402
- function finalizeSelection(bounds, { fit = false } = {}) {
406
+ function finalizeSelection(
407
+ bounds,
408
+ { fit = false, longitudeOffset = state.selectionLongitudeOffset } = {},
409
+ ) {
403
410
  state.bounds = bounds;
404
411
  state.plan = null;
412
+ state.selectionLongitudeOffset = longitudeOffset;
405
413
  if (!state.selectionLayer) state.selectionLayer = createBoxOverlay();
406
414
  state.selectionLayer.element.classList.remove("drawing");
415
+ // Keep the overlay on the copy where the user selected the region.
407
416
  state.selectionLayer.setBounds([
408
- [bounds.south, bounds.west],
409
- [bounds.north, bounds.east],
417
+ [bounds.south, bounds.west + longitudeOffset],
418
+ [bounds.north, bounds.east + longitudeOffset],
410
419
  ]);
411
420
  updateCornerInputs();
412
421
  updateOriginFromSelection();
@@ -423,6 +432,7 @@
423
432
  state.previousBounds = state.bounds;
424
433
  state.bounds = null;
425
434
  state.plan = null;
435
+ state.planSequence += 1;
426
436
  updateCornerInputs();
427
437
  $("build-button").disabled = true;
428
438
  state.selectionStart = event.latlng;
@@ -432,6 +442,7 @@
432
442
  if (state.originMarker && map.hasLayer(state.originMarker)) {
433
443
  state.originMarker.remove();
434
444
  }
445
+ $("summary").classList.remove("loading");
435
446
  $("summary").innerHTML = emptySummary(
436
447
  "Choosing region…",
437
448
  "Move the pointer, then click the opposite corner.",
@@ -452,12 +463,20 @@
452
463
  return;
453
464
  }
454
465
 
466
+ const drawnBounds = L.latLngBounds(state.selectionStart, event.latlng);
467
+ const bounds = leafletBoundsToObject(map.wrapLatLngBounds(drawnBounds));
468
+ const longitudeOffset = drawnBounds.getWest() - bounds.west;
469
+ if (bounds.west < -180 - LONGITUDE_TOLERANCE || bounds.east > 180 + LONGITUDE_TOLERANCE) {
470
+ $("map-hint").textContent = "Regions cannot cross the antimeridian (±180°). Choose a second corner on the same side or press Esc.";
471
+ return;
472
+ }
473
+ // Unprojecting an exact edge pixel can put it just outside the valid range.
474
+ bounds.west = Math.max(bounds.west, -180);
475
+ bounds.east = Math.min(bounds.east, 180);
476
+
455
477
  state.selecting = false;
456
478
  map.getContainer().classList.remove("selecting");
457
- state.selectionLayer.element.classList.remove("drawing");
458
- finalizeSelection(
459
- leafletBoundsToObject(L.latLngBounds(state.selectionStart, event.latlng)),
460
- );
479
+ finalizeSelection(bounds, { longitudeOffset });
461
480
  state.selectionStart = null;
462
481
  state.previousBounds = null;
463
482
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: moos-map
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: Build exact-crop TIFF background maps for MOOS-IvP
5
5
  License-Expression: GPL-3.0-only
6
6
  Project-URL: Repository, https://github.com/cbenjamin23/moos-map
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes