@overmap-ai/core 1.0.65-form-submission-load-fix.0 → 1.0.65-mapbox.1
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 +6 -69
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +5 -68
- 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 +2 -5
|
@@ -397,70 +397,21 @@ var __publicField = (obj, key, value) => {
|
|
|
397
397
|
const selectAccessToken = (state) => state.authReducer.accessToken;
|
|
398
398
|
const selectIsLoggedIn = (state) => state.authReducer.isLoggedIn;
|
|
399
399
|
const authReducer = authSlice.reducer;
|
|
400
|
-
const
|
|
401
|
-
return { lng: coordinates[0], lat: coordinates[1] };
|
|
402
|
-
};
|
|
403
|
-
const literalToCoordinates = (literal) => {
|
|
404
|
-
return [literal.lng, literal.lat];
|
|
405
|
-
};
|
|
406
|
-
const flipCoordinates = (coordinates) => {
|
|
407
|
-
return [coordinates[1], coordinates[0]];
|
|
408
|
-
};
|
|
409
|
-
const flipBounds = (bounds) => {
|
|
410
|
-
return [flipCoordinates(bounds[0]), flipCoordinates(bounds[1])];
|
|
411
|
-
};
|
|
412
|
-
function offsetPositionByMeters(originalPosition, latMeters, lngMeters) {
|
|
413
|
-
const { lat, lng } = originalPosition;
|
|
414
|
-
const earthRadius = 6378137;
|
|
415
|
-
const metersPerDegree = 2 * Math.PI * earthRadius / 360;
|
|
416
|
-
const newLng = lng + lngMeters / metersPerDegree / Math.cos(lat * Math.PI / 180);
|
|
417
|
-
const newLat = lat - latMeters / metersPerDegree;
|
|
418
|
-
return { lat: newLat, lng: newLng };
|
|
419
|
-
}
|
|
420
|
-
const createPointGeometry = (coordinates) => {
|
|
400
|
+
const createPointGeometry = (position) => {
|
|
421
401
|
return {
|
|
422
402
|
type: "Point",
|
|
423
|
-
coordinates
|
|
403
|
+
coordinates: position
|
|
424
404
|
};
|
|
425
405
|
};
|
|
426
|
-
const coordinatesAreEqual = (a, b) => {
|
|
427
|
-
return a[0] === b[0] && a[1] === b[1];
|
|
428
|
-
};
|
|
429
|
-
const coordinatesToText = (coordinates, decimalPlaces) => {
|
|
430
|
-
if (!coordinates)
|
|
431
|
-
return "(No Location)";
|
|
432
|
-
const { lat, lng } = coordinatesToLiteral(coordinates);
|
|
433
|
-
if (decimalPlaces)
|
|
434
|
-
return `${lat.toFixed(decimalPlaces)}, ${lng.toFixed(decimalPlaces)}`;
|
|
435
|
-
return `${lat}, ${lng}`;
|
|
436
|
-
};
|
|
437
|
-
const coordinatesToUrlText = (coordinates) => {
|
|
438
|
-
const { lat, lng } = coordinatesToLiteral(coordinates);
|
|
439
|
-
return `${lat}%2C${lng}`;
|
|
440
|
-
};
|
|
441
|
-
const openCoordsInGoogleMaps = (coordinates) => {
|
|
442
|
-
const url = `https://www.google.com/maps/search/?api=1&query=${coordinatesToUrlText(coordinates)}`;
|
|
443
|
-
window.open(url);
|
|
444
|
-
};
|
|
445
|
-
const openDirectionsInGoogleMaps = (startingPoint, destination) => {
|
|
446
|
-
const startingPointUrl = coordinatesToUrlText(startingPoint);
|
|
447
|
-
const destinationUrl = coordinatesToUrlText(destination);
|
|
448
|
-
const url = `https://www.google.com/maps/dir/?api=1&origin=${startingPointUrl}&destination=${destinationUrl}`;
|
|
449
|
-
window.open(url);
|
|
450
|
-
};
|
|
451
|
-
const worldBounds = {
|
|
452
|
-
type: "MultiPoint",
|
|
453
|
-
coordinates: [
|
|
454
|
-
[90, -180],
|
|
455
|
-
[-90, 180]
|
|
456
|
-
]
|
|
457
|
-
};
|
|
458
406
|
const createMultiPointGeometry = (coordinates) => {
|
|
459
407
|
return {
|
|
460
408
|
type: "MultiPoint",
|
|
461
409
|
coordinates
|
|
462
410
|
};
|
|
463
411
|
};
|
|
412
|
+
const coordinatesAreEqual = (a, b) => {
|
|
413
|
+
return a[0] === b[0] && a[1] === b[1];
|
|
414
|
+
};
|
|
464
415
|
function classNames(...args) {
|
|
465
416
|
const classes = [];
|
|
466
417
|
for (const arg of args) {
|
|
@@ -638,9 +589,6 @@ var __publicField = (obj, key, value) => {
|
|
|
638
589
|
return v.file_sha1 === value.file_sha1;
|
|
639
590
|
}) === index;
|
|
640
591
|
}
|
|
641
|
-
function boundsContainPoint(bounds, coordinates) {
|
|
642
|
-
return bounds[0][0] > coordinates[0] && bounds[1][0] < coordinates[0] && bounds[0][1] > coordinates[1] && bounds[1][1] < coordinates[1];
|
|
643
|
-
}
|
|
644
592
|
const emailRegex = /^.+@.+\..+$/;
|
|
645
593
|
const fullAssetMarkerSize = 45;
|
|
646
594
|
const DEFAULT_ISSUE_STATUS = IssueStatus.BACKLOG;
|
|
@@ -7676,7 +7624,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7676
7624
|
exports2.authReducer = authReducer;
|
|
7677
7625
|
exports2.authSlice = authSlice;
|
|
7678
7626
|
exports2.blobToBase64 = blobToBase64;
|
|
7679
|
-
exports2.boundsContainPoint = boundsContainPoint;
|
|
7680
7627
|
exports2.categoryReducer = categoryReducer;
|
|
7681
7628
|
exports2.categorySlice = categorySlice;
|
|
7682
7629
|
exports2.classNames = classNames;
|
|
@@ -7684,9 +7631,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7684
7631
|
exports2.clearTokens = clearTokens;
|
|
7685
7632
|
exports2.constructUploadedFilePayloads = constructUploadedFilePayloads;
|
|
7686
7633
|
exports2.coordinatesAreEqual = coordinatesAreEqual;
|
|
7687
|
-
exports2.coordinatesToLiteral = coordinatesToLiteral;
|
|
7688
|
-
exports2.coordinatesToText = coordinatesToText;
|
|
7689
|
-
exports2.coordinatesToUrlText = coordinatesToUrlText;
|
|
7690
7634
|
exports2.createMultiPointGeometry = createMultiPointGeometry;
|
|
7691
7635
|
exports2.createOfflineAction = createOfflineAction;
|
|
7692
7636
|
exports2.createPointGeometry = createPointGeometry;
|
|
@@ -7749,8 +7693,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7749
7693
|
exports2.fileReducer = fileReducer;
|
|
7750
7694
|
exports2.fileSlice = fileSlice;
|
|
7751
7695
|
exports2.fileToBlob = fileToBlob;
|
|
7752
|
-
exports2.flipBounds = flipBounds;
|
|
7753
|
-
exports2.flipCoordinates = flipCoordinates;
|
|
7754
7696
|
exports2.formReducer = formReducer;
|
|
7755
7697
|
exports2.formRevisionAttachmentReducer = formRevisionAttachmentReducer;
|
|
7756
7698
|
exports2.formRevisionAttachmentSlice = formRevisionAttachmentSlice;
|
|
@@ -7817,18 +7759,14 @@ var __publicField = (obj, key, value) => {
|
|
|
7817
7759
|
exports2.issueUpdateSlice = issueUpdateSlice;
|
|
7818
7760
|
exports2.licenseReducer = licenseReducer;
|
|
7819
7761
|
exports2.licenseSlice = licenseSlice;
|
|
7820
|
-
exports2.literalToCoordinates = literalToCoordinates;
|
|
7821
7762
|
exports2.logOnlyOnce = logOnlyOnce;
|
|
7822
7763
|
exports2.markAsDeleted = markAsDeleted;
|
|
7823
7764
|
exports2.markForDeletion = markForDeletion;
|
|
7824
7765
|
exports2.memoize = memoize;
|
|
7825
7766
|
exports2.moveDocument = moveDocument;
|
|
7826
7767
|
exports2.offline = offline;
|
|
7827
|
-
exports2.offsetPositionByMeters = offsetPositionByMeters;
|
|
7828
7768
|
exports2.onlyUniqueHashes = onlyUniqueHashes;
|
|
7829
7769
|
exports2.onlyUniqueOfflineIds = onlyUniqueOfflineIds;
|
|
7830
|
-
exports2.openCoordsInGoogleMaps = openCoordsInGoogleMaps;
|
|
7831
|
-
exports2.openDirectionsInGoogleMaps = openDirectionsInGoogleMaps;
|
|
7832
7770
|
exports2.organizationAccessReducer = organizationAccessReducer;
|
|
7833
7771
|
exports2.organizationAccessSlice = organizationAccessSlice;
|
|
7834
7772
|
exports2.organizationReducer = organizationReducer;
|
|
@@ -8144,7 +8082,6 @@ var __publicField = (obj, key, value) => {
|
|
|
8144
8082
|
exports2.warningColor = warningColor;
|
|
8145
8083
|
exports2.workspaceReducer = workspaceReducer;
|
|
8146
8084
|
exports2.workspaceSlice = workspaceSlice;
|
|
8147
|
-
exports2.worldBounds = worldBounds;
|
|
8148
8085
|
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
|
|
8149
8086
|
});
|
|
8150
8087
|
//# sourceMappingURL=overmap-core.umd.cjs.map
|