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.
- {moos_map-1.2.0/src/moos_map.egg-info → moos_map-1.2.1}/PKG-INFO +1 -1
- {moos_map-1.2.0 → moos_map-1.2.1}/pyproject.toml +1 -1
- {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/__init__.py +1 -1
- {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/static/app.js +29 -10
- {moos_map-1.2.0 → moos_map-1.2.1/src/moos_map.egg-info}/PKG-INFO +1 -1
- {moos_map-1.2.0 → moos_map-1.2.1}/LICENSE +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/README.md +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/setup.cfg +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/__main__.py +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/acquisition.py +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/cache.py +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/cli.py +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/errors.py +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/geocoding.py +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/geometry.py +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/models.py +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/moos_compat.py +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/moos_files.py +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/raster.py +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/service.py +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/sources.py +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/static/index.html +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/static/styles.css +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/verification.py +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map/web.py +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map.egg-info/SOURCES.txt +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map.egg-info/dependency_links.txt +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map.egg-info/entry_points.txt +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map.egg-info/requires.txt +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/src/moos_map.egg-info/top_level.txt +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/tests/test_acquisition.py +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/tests/test_cli.py +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/tests/test_geocoding.py +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/tests/test_geometry.py +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/tests/test_info.py +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/tests/test_moos_compat.py +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/tests/test_service.py +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/tests/test_sources.py +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/tests/test_verification.py +0 -0
- {moos_map-1.2.0 → moos_map-1.2.1}/tests/test_web.py +0 -0
|
@@ -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.
|
|
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(
|
|
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
|
-
|
|
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
|
}
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|