aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/trails/PresBox.tsx
diff options
context:
space:
mode:
authorEric <ericmabr@gmail.com>2023-07-10 14:26:37 -0400
committerEric <ericmabr@gmail.com>2023-07-10 14:26:37 -0400
commit9d48c95e5a556f5be4abde83d9443e384a33197c (patch)
tree153544573a279a487bb59b52026b7c05890a70c4 /src/client/views/nodes/trails/PresBox.tsx
parenta6878385b554c976f73fd14cfa29f6417cf4ee0b (diff)
Location metadata synced and reactions working
Diffstat (limited to 'src/client/views/nodes/trails/PresBox.tsx')
-rw-r--r--src/client/views/nodes/trails/PresBox.tsx19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx
index 858d83b7a..d1cfb86ae 100644
--- a/src/client/views/nodes/trails/PresBox.tsx
+++ b/src/client/views/nodes/trails/PresBox.tsx
@@ -41,6 +41,7 @@ export interface pinDataTypes {
scrollable?: boolean;
dataviz?: number[];
pannable?: boolean;
+ map?:boolean;
viewType?: boolean;
inkable?: boolean;
filters?: boolean;
@@ -378,6 +379,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
const inkable = [DocumentType.INK].includes(targetType);
const scrollable = [DocumentType.PDF, DocumentType.RTF, DocumentType.WEB].includes(targetType) || target?._viewType === CollectionViewType.Stacking;
const pannable = [DocumentType.IMG, DocumentType.PDF].includes(targetType) || (targetType === DocumentType.COL && target?._viewType === CollectionViewType.Freeform);
+ const map = [DocumentType.MAP].includes(targetType);
const temporal = [DocumentType.AUDIO, DocumentType.VID].includes(targetType);
const clippable = [DocumentType.COMPARISON].includes(targetType);
const datarange = [DocumentType.FUNCPLOT].includes(targetType);
@@ -387,7 +389,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
const filters = true;
const pivot = true;
const dataannos = false;
- return { scrollable, pannable, inkable, viewType, pivot, filters, temporal, clippable, dataview, datarange, poslayoutview, dataannos };
+ return { scrollable, pannable, inkable, viewType, pivot, map, filters, temporal, clippable, dataview, datarange, poslayoutview, dataannos };
}
@action
@@ -455,6 +457,17 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
changed = true;
}
}
+ if (pinDataTypes?.map || (!pinDataTypes && activeItem.presLat !== undefined)) {
+ if (bestTarget.latitude !== activeItem.presLat) {
+ Doc.SetInPlace(bestTarget, "latitude", NumCast(activeItem.presLat), true);
+ changed = true;
+ }
+ if (bestTarget.longitude !== activeItem.presLong) {
+ Doc.SetInPlace(bestTarget, "longitude", NumCast(activeItem.presLong), true);
+ bestTarget.restoreTargetOn = true;
+ changed = true;
+ }
+ }
if (pinDataTypes?.temporal || (!pinDataTypes && activeItem.presStartTime !== undefined)) {
if (bestTarget._layout_currentTimecode !== activeItem.presStartTime) {
bestTarget._layout_currentTimecode = activeItem.presStartTime;
@@ -633,6 +646,10 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
pinDoc.presXRange = undefined; //targetDoc?.xrange;
pinDoc.presYRange = undefined; //targetDoc?.yrange;
}
+ if (pinProps.pinData.map) {
+ pinDoc.presLat = targetDoc?.lat;
+ //...
+ }
if (pinProps.pinData.poslayoutview)
pinDoc.presPinLayoutData = new List<string>(
DocListCast(targetDoc[fkey] as ObjectField).map(d =>