@overmap-ai/core 1.0.60-forms-removal.3 → 1.0.60-forms-removal.4
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/dist/overmap-core.js +20 -45
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +20 -45
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/store/slices/projectFileSlice.d.ts +3 -4
- package/dist/typings/models/{components.d.ts → assets.d.ts} +3 -3
- package/dist/typings/models/canvas.d.ts +10 -0
- package/dist/typings/models/forms.d.ts +1 -2
- package/dist/typings/models/geo.d.ts +14 -6
- package/dist/typings/models/index.d.ts +2 -1
- package/dist/typings/models/issues.d.ts +6 -4
- package/dist/typings/models/projects.d.ts +4 -5
- package/dist/utils/coordinates.d.ts +4 -7
- package/package.json +1 -1
|
@@ -406,9 +406,6 @@ var __publicField = (obj, key, value) => {
|
|
|
406
406
|
const flipCoordinates = (coordinates) => {
|
|
407
407
|
return [coordinates[1], coordinates[0]];
|
|
408
408
|
};
|
|
409
|
-
const markerToCoordinates = (marker) => {
|
|
410
|
-
return flipCoordinates(marker.geometry.coordinates);
|
|
411
|
-
};
|
|
412
409
|
function offsetPositionByMeters(originalPosition, latMeters, lngMeters) {
|
|
413
410
|
const { lat, lng } = originalPosition;
|
|
414
411
|
const earthRadius = 6378137;
|
|
@@ -417,19 +414,12 @@ var __publicField = (obj, key, value) => {
|
|
|
417
414
|
const newLat = lat - latMeters / metersPerDegree;
|
|
418
415
|
return { lat: newLat, lng: newLng };
|
|
419
416
|
}
|
|
420
|
-
const
|
|
417
|
+
const createPointGeometry = (coordinates) => {
|
|
421
418
|
return {
|
|
422
419
|
type: "Point",
|
|
423
420
|
coordinates
|
|
424
421
|
};
|
|
425
422
|
};
|
|
426
|
-
const createPointMarker = (coordinates) => {
|
|
427
|
-
return {
|
|
428
|
-
type: "Feature",
|
|
429
|
-
geometry: coordinatesToPointGeometry(coordinates),
|
|
430
|
-
properties: {}
|
|
431
|
-
};
|
|
432
|
-
};
|
|
433
423
|
const coordinatesAreEqual = (a, b) => {
|
|
434
424
|
return a[0] === b[0] && a[1] === b[1];
|
|
435
425
|
};
|
|
@@ -445,15 +435,6 @@ var __publicField = (obj, key, value) => {
|
|
|
445
435
|
const { lat, lng } = coordinatesToLiteral(coordinates);
|
|
446
436
|
return `${lat}%2C${lng}`;
|
|
447
437
|
};
|
|
448
|
-
const getMarkerCoordinates = (marker) => {
|
|
449
|
-
return marker == null ? void 0 : marker.geometry.coordinates;
|
|
450
|
-
};
|
|
451
|
-
const markerCoordinatesToText = (marker, decimalPlaces) => {
|
|
452
|
-
const coordinates = getMarkerCoordinates(marker);
|
|
453
|
-
if (coordinates)
|
|
454
|
-
return coordinatesToText(coordinates, decimalPlaces);
|
|
455
|
-
return "(No location)";
|
|
456
|
-
};
|
|
457
438
|
const openCoordsInGoogleMaps = (coordinates) => {
|
|
458
439
|
const url = `https://www.google.com/maps/search/?api=1&query=${coordinatesToUrlText(coordinates)}`;
|
|
459
440
|
window.open(url);
|
|
@@ -464,10 +445,19 @@ var __publicField = (obj, key, value) => {
|
|
|
464
445
|
const url = `https://www.google.com/maps/dir/?api=1&origin=${startingPointUrl}&destination=${destinationUrl}`;
|
|
465
446
|
window.open(url);
|
|
466
447
|
};
|
|
467
|
-
const worldBounds =
|
|
468
|
-
|
|
469
|
-
[
|
|
470
|
-
|
|
448
|
+
const worldBounds = {
|
|
449
|
+
type: "MultiPoint",
|
|
450
|
+
coordinates: [
|
|
451
|
+
[90, -180],
|
|
452
|
+
[-90, 180]
|
|
453
|
+
]
|
|
454
|
+
};
|
|
455
|
+
const createMultiPointGeometry = (coordinates) => {
|
|
456
|
+
return {
|
|
457
|
+
type: "MultiPoint",
|
|
458
|
+
coordinates
|
|
459
|
+
};
|
|
460
|
+
};
|
|
471
461
|
function classNames(...args) {
|
|
472
462
|
const classes = [];
|
|
473
463
|
for (const arg of args) {
|
|
@@ -2332,7 +2322,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2332
2322
|
doesn't exist.`
|
|
2333
2323
|
);
|
|
2334
2324
|
}
|
|
2335
|
-
state.projectFiles[activeProjectFileId].
|
|
2325
|
+
state.projectFiles[activeProjectFileId].geo_bounds = action.payload;
|
|
2336
2326
|
},
|
|
2337
2327
|
// TODO: Move to MapContext. Should not be persisted.
|
|
2338
2328
|
setActiveProjectFileId: (state, action) => {
|
|
@@ -5357,7 +5347,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5357
5347
|
url: `/projects/${activeProjectId}/files/`,
|
|
5358
5348
|
payload: {
|
|
5359
5349
|
...activeProjectFile,
|
|
5360
|
-
|
|
5350
|
+
geo_bounds: JSON.stringify(activeProjectFile.geo_bounds),
|
|
5361
5351
|
...fileProps
|
|
5362
5352
|
},
|
|
5363
5353
|
blockers: [activeProjectFileId],
|
|
@@ -5426,9 +5416,6 @@ var __publicField = (obj, key, value) => {
|
|
|
5426
5416
|
* @throws An APIError if the server returns an error, or any other error that may occur.
|
|
5427
5417
|
*/
|
|
5428
5418
|
async add(project) {
|
|
5429
|
-
if (!project.bounds) {
|
|
5430
|
-
throw new Error("Project bounds were not set before trying to create a project");
|
|
5431
|
-
}
|
|
5432
5419
|
if (!project.owner_organization && !project.owner_user) {
|
|
5433
5420
|
throw new Error("Project type was not chosen when trying to create a project");
|
|
5434
5421
|
}
|
|
@@ -5441,10 +5428,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5441
5428
|
url,
|
|
5442
5429
|
payload: {
|
|
5443
5430
|
name: project.name,
|
|
5444
|
-
|
|
5445
|
-
type: "MultiPoint",
|
|
5446
|
-
coordinates: [project.bounds[0], project.bounds[1]]
|
|
5447
|
-
},
|
|
5431
|
+
geo_bounds: project.geo_bounds,
|
|
5448
5432
|
...projectType
|
|
5449
5433
|
},
|
|
5450
5434
|
blockers: [],
|
|
@@ -5453,9 +5437,6 @@ var __publicField = (obj, key, value) => {
|
|
|
5453
5437
|
return result;
|
|
5454
5438
|
}
|
|
5455
5439
|
async update(project) {
|
|
5456
|
-
if (!project.bounds) {
|
|
5457
|
-
throw new Error("Project bounds were not set before trying to create a project");
|
|
5458
|
-
}
|
|
5459
5440
|
this.dispatch(updateOrCreateProject(project));
|
|
5460
5441
|
return await this.enqueueRequest({
|
|
5461
5442
|
description: "Update project",
|
|
@@ -5463,10 +5444,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5463
5444
|
url: `/projects/${project.id}/`,
|
|
5464
5445
|
payload: {
|
|
5465
5446
|
name: project.name,
|
|
5466
|
-
|
|
5467
|
-
type: "MultiPoint",
|
|
5468
|
-
coordinates: [project.bounds[0], project.bounds[1]]
|
|
5469
|
-
}
|
|
5447
|
+
geo_bounds: project.geo_bounds
|
|
5470
5448
|
},
|
|
5471
5449
|
blockers: [project.id.toString()],
|
|
5472
5450
|
blocks: [project.id.toString()]
|
|
@@ -7267,11 +7245,11 @@ var __publicField = (obj, key, value) => {
|
|
|
7267
7245
|
exports2.constructUploadedFilePayloads = constructUploadedFilePayloads;
|
|
7268
7246
|
exports2.coordinatesAreEqual = coordinatesAreEqual;
|
|
7269
7247
|
exports2.coordinatesToLiteral = coordinatesToLiteral;
|
|
7270
|
-
exports2.coordinatesToPointGeometry = coordinatesToPointGeometry;
|
|
7271
7248
|
exports2.coordinatesToText = coordinatesToText;
|
|
7272
7249
|
exports2.coordinatesToUrlText = coordinatesToUrlText;
|
|
7250
|
+
exports2.createMultiPointGeometry = createMultiPointGeometry;
|
|
7273
7251
|
exports2.createOfflineAction = createOfflineAction;
|
|
7274
|
-
exports2.
|
|
7252
|
+
exports2.createPointGeometry = createPointGeometry;
|
|
7275
7253
|
exports2.defaultBadgeColor = defaultBadgeColor;
|
|
7276
7254
|
exports2.deleteAsset = deleteAsset;
|
|
7277
7255
|
exports2.deleteAssetAttachment = deleteAssetAttachment;
|
|
@@ -7344,7 +7322,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7344
7322
|
exports2.getFileS3Key = getFileS3Key;
|
|
7345
7323
|
exports2.getLocalDateString = getLocalDateString;
|
|
7346
7324
|
exports2.getLocalRelativeDateString = getLocalRelativeDateString;
|
|
7347
|
-
exports2.getMarkerCoordinates = getMarkerCoordinates;
|
|
7348
7325
|
exports2.getOutboxCoordinator = getOutboxCoordinator;
|
|
7349
7326
|
exports2.getRenamedFile = getRenamedFile;
|
|
7350
7327
|
exports2.getStageColor = getStageColor;
|
|
@@ -7389,8 +7366,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7389
7366
|
exports2.logOnlyOnce = logOnlyOnce;
|
|
7390
7367
|
exports2.markAsDeleted = markAsDeleted;
|
|
7391
7368
|
exports2.markForDeletion = markForDeletion;
|
|
7392
|
-
exports2.markerCoordinatesToText = markerCoordinatesToText;
|
|
7393
|
-
exports2.markerToCoordinates = markerToCoordinates;
|
|
7394
7369
|
exports2.memoize = memoize;
|
|
7395
7370
|
exports2.moveDocument = moveDocument;
|
|
7396
7371
|
exports2.offline = offline;
|