@overmap-ai/core 1.0.65-filters.1 → 1.0.65-mapbox.0
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 +43 -80
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +42 -79
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/typings/models/geo.d.ts +3 -3
- package/dist/utils/coordinates.d.ts +4 -18
- package/dist/utils/utils.d.ts +1 -7
- package/package.json +1 -1
package/dist/overmap-core.js
CHANGED
|
@@ -409,70 +409,21 @@ const { setTokens, clearTokens, setLoggedIn } = authSlice.actions;
|
|
|
409
409
|
const selectAccessToken = (state) => state.authReducer.accessToken;
|
|
410
410
|
const selectIsLoggedIn = (state) => state.authReducer.isLoggedIn;
|
|
411
411
|
const authReducer = authSlice.reducer;
|
|
412
|
-
const
|
|
413
|
-
return { lng: coordinates[0], lat: coordinates[1] };
|
|
414
|
-
};
|
|
415
|
-
const literalToCoordinates = (literal) => {
|
|
416
|
-
return [literal.lng, literal.lat];
|
|
417
|
-
};
|
|
418
|
-
const flipCoordinates = (coordinates) => {
|
|
419
|
-
return [coordinates[1], coordinates[0]];
|
|
420
|
-
};
|
|
421
|
-
const flipBounds = (bounds) => {
|
|
422
|
-
return [flipCoordinates(bounds[0]), flipCoordinates(bounds[1])];
|
|
423
|
-
};
|
|
424
|
-
function offsetPositionByMeters(originalPosition, latMeters, lngMeters) {
|
|
425
|
-
const { lat, lng } = originalPosition;
|
|
426
|
-
const earthRadius = 6378137;
|
|
427
|
-
const metersPerDegree = 2 * Math.PI * earthRadius / 360;
|
|
428
|
-
const newLng = lng + lngMeters / metersPerDegree / Math.cos(lat * Math.PI / 180);
|
|
429
|
-
const newLat = lat - latMeters / metersPerDegree;
|
|
430
|
-
return { lat: newLat, lng: newLng };
|
|
431
|
-
}
|
|
432
|
-
const createPointGeometry = (coordinates) => {
|
|
412
|
+
const createPointGeometry = (position) => {
|
|
433
413
|
return {
|
|
434
414
|
type: "Point",
|
|
435
|
-
coordinates
|
|
415
|
+
coordinates: position
|
|
436
416
|
};
|
|
437
417
|
};
|
|
438
|
-
const coordinatesAreEqual = (a, b) => {
|
|
439
|
-
return a[0] === b[0] && a[1] === b[1];
|
|
440
|
-
};
|
|
441
|
-
const coordinatesToText = (coordinates, decimalPlaces) => {
|
|
442
|
-
if (!coordinates)
|
|
443
|
-
return "(No Location)";
|
|
444
|
-
const { lat, lng } = coordinatesToLiteral(coordinates);
|
|
445
|
-
if (decimalPlaces)
|
|
446
|
-
return `${lat.toFixed(decimalPlaces)}, ${lng.toFixed(decimalPlaces)}`;
|
|
447
|
-
return `${lat}, ${lng}`;
|
|
448
|
-
};
|
|
449
|
-
const coordinatesToUrlText = (coordinates) => {
|
|
450
|
-
const { lat, lng } = coordinatesToLiteral(coordinates);
|
|
451
|
-
return `${lat}%2C${lng}`;
|
|
452
|
-
};
|
|
453
|
-
const openCoordsInGoogleMaps = (coordinates) => {
|
|
454
|
-
const url = `https://www.google.com/maps/search/?api=1&query=${coordinatesToUrlText(coordinates)}`;
|
|
455
|
-
window.open(url);
|
|
456
|
-
};
|
|
457
|
-
const openDirectionsInGoogleMaps = (startingPoint, destination) => {
|
|
458
|
-
const startingPointUrl = coordinatesToUrlText(startingPoint);
|
|
459
|
-
const destinationUrl = coordinatesToUrlText(destination);
|
|
460
|
-
const url = `https://www.google.com/maps/dir/?api=1&origin=${startingPointUrl}&destination=${destinationUrl}`;
|
|
461
|
-
window.open(url);
|
|
462
|
-
};
|
|
463
|
-
const worldBounds = {
|
|
464
|
-
type: "MultiPoint",
|
|
465
|
-
coordinates: [
|
|
466
|
-
[90, -180],
|
|
467
|
-
[-90, 180]
|
|
468
|
-
]
|
|
469
|
-
};
|
|
470
418
|
const createMultiPointGeometry = (coordinates) => {
|
|
471
419
|
return {
|
|
472
420
|
type: "MultiPoint",
|
|
473
421
|
coordinates
|
|
474
422
|
};
|
|
475
423
|
};
|
|
424
|
+
const coordinatesAreEqual = (a, b) => {
|
|
425
|
+
return a[0] === b[0] && a[1] === b[1];
|
|
426
|
+
};
|
|
476
427
|
function classNames(...args) {
|
|
477
428
|
const classes = [];
|
|
478
429
|
for (const arg of args) {
|
|
@@ -650,9 +601,6 @@ function onlyUniqueHashes(value, index, self) {
|
|
|
650
601
|
return v.file_sha1 === value.file_sha1;
|
|
651
602
|
}) === index;
|
|
652
603
|
}
|
|
653
|
-
function boundsContainPoint(bounds, coordinates) {
|
|
654
|
-
return bounds[0][0] > coordinates[0] && bounds[1][0] < coordinates[0] && bounds[0][1] > coordinates[1] && bounds[1][1] < coordinates[1];
|
|
655
|
-
}
|
|
656
604
|
const emailRegex = /^.+@.+\..+$/;
|
|
657
605
|
const fullAssetMarkerSize = 45;
|
|
658
606
|
const DEFAULT_ISSUE_STATUS = IssueStatus.BACKLOG;
|
|
@@ -5914,13 +5862,11 @@ const separateFilesFromValues = (values) => {
|
|
|
5914
5862
|
const newValues = {};
|
|
5915
5863
|
for (const key in values) {
|
|
5916
5864
|
const value = values[key];
|
|
5917
|
-
if (value === void 0)
|
|
5918
|
-
throw new Error("Expected value to be defined");
|
|
5919
5865
|
if (value instanceof File) {
|
|
5920
5866
|
files[key] = [value];
|
|
5921
5867
|
} else if (isArrayOfFiles(value)) {
|
|
5922
5868
|
files[key] = value;
|
|
5923
|
-
} else {
|
|
5869
|
+
} else if (value !== void 0) {
|
|
5924
5870
|
newValues[key] = value;
|
|
5925
5871
|
}
|
|
5926
5872
|
}
|
|
@@ -6225,22 +6171,50 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
6225
6171
|
}
|
|
6226
6172
|
}
|
|
6227
6173
|
async refreshStore(projectId) {
|
|
6228
|
-
const
|
|
6229
|
-
|
|
6174
|
+
const formSubmissions = {};
|
|
6175
|
+
const modelSubmissions = await this.enqueueRequest({
|
|
6176
|
+
description: "Fetch model submissions",
|
|
6230
6177
|
method: HttpMethod.GET,
|
|
6231
|
-
url: `/forms/in-project/${projectId}/submissions/`,
|
|
6178
|
+
url: `/forms/in-project/${projectId}/submissions/model/latest/`,
|
|
6232
6179
|
blockers: [],
|
|
6233
6180
|
blocks: []
|
|
6234
6181
|
});
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6182
|
+
for (const modelSubmission of modelSubmissions) {
|
|
6183
|
+
formSubmissions[modelSubmission.offline_id] = modelSubmission;
|
|
6184
|
+
}
|
|
6185
|
+
const standaloneSubmissions = await this.enqueueRequest({
|
|
6186
|
+
description: "Fetch standalone submissions",
|
|
6238
6187
|
method: HttpMethod.GET,
|
|
6239
|
-
url: `/forms/in-project/${projectId}/
|
|
6188
|
+
url: `/forms/in-project/${projectId}/submissions/standalone/`,
|
|
6240
6189
|
blockers: [],
|
|
6241
6190
|
blocks: []
|
|
6242
6191
|
});
|
|
6243
|
-
|
|
6192
|
+
for (const standaloneSubmission of standaloneSubmissions) {
|
|
6193
|
+
formSubmissions[standaloneSubmission.offline_id] = standaloneSubmission;
|
|
6194
|
+
}
|
|
6195
|
+
this.dispatch(initializeFormSubmissions(Object.values(formSubmissions)));
|
|
6196
|
+
const attachments = {};
|
|
6197
|
+
const modelAttachments = await this.enqueueRequest({
|
|
6198
|
+
description: "Fetch model submission attachments",
|
|
6199
|
+
method: HttpMethod.GET,
|
|
6200
|
+
url: `/forms/in-project/${projectId}/attachments/model/latest/`,
|
|
6201
|
+
blockers: [],
|
|
6202
|
+
blocks: []
|
|
6203
|
+
});
|
|
6204
|
+
for (const modelAttachment of modelAttachments) {
|
|
6205
|
+
attachments[modelAttachment.offline_id] = modelAttachment;
|
|
6206
|
+
}
|
|
6207
|
+
const standaloneAttachments = await this.enqueueRequest({
|
|
6208
|
+
description: "Fetch standalone submission attachments",
|
|
6209
|
+
method: HttpMethod.GET,
|
|
6210
|
+
url: `/forms/in-project/${projectId}/attachments/standalone/`,
|
|
6211
|
+
blockers: [],
|
|
6212
|
+
blocks: []
|
|
6213
|
+
});
|
|
6214
|
+
for (const standaloneAttachent of standaloneAttachments) {
|
|
6215
|
+
attachments[standaloneAttachent.offline_id] = standaloneAttachent;
|
|
6216
|
+
}
|
|
6217
|
+
this.dispatch(initializeFormSubmissionAttachments(Object.values(attachments)));
|
|
6244
6218
|
}
|
|
6245
6219
|
}
|
|
6246
6220
|
class WorkspaceService extends BaseApiService {
|
|
@@ -7663,7 +7637,6 @@ export {
|
|
|
7663
7637
|
authReducer,
|
|
7664
7638
|
authSlice,
|
|
7665
7639
|
blobToBase64,
|
|
7666
|
-
boundsContainPoint,
|
|
7667
7640
|
categoryReducer,
|
|
7668
7641
|
categorySlice,
|
|
7669
7642
|
classNames,
|
|
@@ -7671,9 +7644,6 @@ export {
|
|
|
7671
7644
|
clearTokens,
|
|
7672
7645
|
constructUploadedFilePayloads,
|
|
7673
7646
|
coordinatesAreEqual,
|
|
7674
|
-
coordinatesToLiteral,
|
|
7675
|
-
coordinatesToText,
|
|
7676
|
-
coordinatesToUrlText,
|
|
7677
7647
|
createMultiPointGeometry,
|
|
7678
7648
|
createOfflineAction,
|
|
7679
7649
|
createPointGeometry,
|
|
@@ -7736,8 +7706,6 @@ export {
|
|
|
7736
7706
|
fileReducer,
|
|
7737
7707
|
fileSlice,
|
|
7738
7708
|
fileToBlob,
|
|
7739
|
-
flipBounds,
|
|
7740
|
-
flipCoordinates,
|
|
7741
7709
|
formReducer,
|
|
7742
7710
|
formRevisionAttachmentReducer,
|
|
7743
7711
|
formRevisionAttachmentSlice,
|
|
@@ -7804,18 +7772,14 @@ export {
|
|
|
7804
7772
|
issueUpdateSlice,
|
|
7805
7773
|
licenseReducer,
|
|
7806
7774
|
licenseSlice,
|
|
7807
|
-
literalToCoordinates,
|
|
7808
7775
|
logOnlyOnce,
|
|
7809
7776
|
markAsDeleted,
|
|
7810
7777
|
markForDeletion,
|
|
7811
7778
|
memoize,
|
|
7812
7779
|
moveDocument,
|
|
7813
7780
|
offline,
|
|
7814
|
-
offsetPositionByMeters,
|
|
7815
7781
|
onlyUniqueHashes,
|
|
7816
7782
|
onlyUniqueOfflineIds,
|
|
7817
|
-
openCoordsInGoogleMaps,
|
|
7818
|
-
openDirectionsInGoogleMaps,
|
|
7819
7783
|
organizationAccessReducer,
|
|
7820
7784
|
organizationAccessSlice,
|
|
7821
7785
|
organizationReducer,
|
|
@@ -8130,7 +8094,6 @@ export {
|
|
|
8130
8094
|
versioningSlice,
|
|
8131
8095
|
warningColor,
|
|
8132
8096
|
workspaceReducer,
|
|
8133
|
-
workspaceSlice
|
|
8134
|
-
worldBounds
|
|
8097
|
+
workspaceSlice
|
|
8135
8098
|
};
|
|
8136
8099
|
//# sourceMappingURL=overmap-core.js.map
|