diff options
| author | Aubrey-Li <63608597+Aubrey-Li@users.noreply.github.com> | 2021-07-28 13:46:48 -0700 |
|---|---|---|
| committer | Aubrey-Li <63608597+Aubrey-Li@users.noreply.github.com> | 2021-07-28 13:46:48 -0700 |
| commit | df83cc8ae5e4ca5db2c1ca79b0017263f83ef496 (patch) | |
| tree | 4876457234c1a827a8470e35e8ab6c2531eec361 /src/client/views/nodes/MapMarker | |
| parent | 0e24f759b8315e414be4f4a282b095e294ff8c6e (diff) | |
marker updates
Diffstat (limited to 'src/client/views/nodes/MapMarker')
| -rw-r--r-- | src/client/views/nodes/MapMarker/MapMarker.tsx | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/src/client/views/nodes/MapMarker/MapMarker.tsx b/src/client/views/nodes/MapMarker/MapMarker.tsx deleted file mode 100644 index d87fd1b11..000000000 --- a/src/client/views/nodes/MapMarker/MapMarker.tsx +++ /dev/null @@ -1,98 +0,0 @@ -import { action, computed, IReactionDisposer, observable } from "mobx"; -import { observer } from "mobx-react"; -import { Transaction } from "prosemirror-state"; -import { EditorView } from "prosemirror-view"; -import * as React from "react"; -import { Doc, DocListCast, Opt } from "../../../../fields/Doc"; -import { documentSchema } from "../../../../fields/documentSchemas"; -import { Id } from "../../../../fields/FieldSymbols"; -import { createSchema, makeInterface } from "../../../../fields/Schema"; -import { CurrentUserUtils } from "../../../util/CurrentUserUtils"; -import { DragManager } from "../../../util/DragManager"; -import { ViewBoxAnnotatableProps, ViewBoxAnnotatableComponent } from "../../DocComponent"; -import { AnchorMenu } from "../../pdf/AnchorMenu"; -import { FieldView, FieldViewProps } from "../FieldView"; -import { FormattedTextBox } from "../formattedText/FormattedTextBox"; -import { RichTextMenu } from "../formattedText/RichTextMenu"; - -type MarkerDocument = makeInterface<[typeof documentSchema]>; -const MarkerDocument = makeInterface(documentSchema); - -@observer -export class MapMarker extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps & FieldViewProps, MarkerDocument>(MarkerDocument) { - makeLinkAnchor(arg1: string, undefined: undefined, arg3: string) { - throw new Error("Method not implemented."); - } - public static LayoutString(fieldKey: string) { return FieldView.LayoutString(MapMarker, fieldKey); } - private _markerRef: React.RefObject<google.maps.Marker> = React.createRef(); - private _disposers: { [name: string]: IReactionDisposer } = {}; - private _latlngLocation!: google.maps.LatLng; - private _markerId!: number; - private _editorView: Opt<EditorView> // we'll see if this becomes useful for marker annotation/create link - @observable _title: string = ""; // the title of the marker - @observable _description: string = ""; // the description of the marker contents - @observable isMarkerActive: boolean = false; // whether the marker is selected (we'll see if we need this) - @observable associatedDocs: Doc[] = []; // a list of documents with the same/similar geographic coordinates - @observable activeLinks: Doc[] = []; //TBD: what linking data structure looks like - - /** - * Methods - */ - - componentDidMount() { } - - componentWillMount() { } - - @computed private get filterAssociatedDocs() { - return - } - - addLinkToMarker = () => { } - - - - @action - setupAnchorMenu = () => { - AnchorMenu.Instance.Status = "marquee"; - AnchorMenu.Instance.Highlight = action((color: string, isLinkButton: boolean) => { - this._editorView?.state && RichTextMenu.Instance.insertHighlight(color, this._editorView.state, this._editorView?.dispatch); - return undefined; - }); - /** - * This function is used by the PDFmenu to create an anchor highlight and a new linked text annotation. - * It also initiates a Drag/Drop interaction to place the text annotation. - */ - AnchorMenu.Instance.StartDrag = action(async (e: PointerEvent, ele: HTMLElement) => { - e.preventDefault(); - e.stopPropagation(); - const targetCreator = (annotationOn?: Doc) => { - const target = CurrentUserUtils.GetNewTextDoc("Note linked to " + this.rootDoc.title, 0, 0, 100, 100, undefined, annotationOn); - FormattedTextBox.SelectOnLoad = target[Id]; - return target; - }; - - // DragManager.StartAnchorAnnoDrag([ele], new DragManager.AnchorAnnoDragData(this.props.docViewPath().lastElement(), this.getAnchor, targetCreator), e.pageX, e.pageY); - }); - const coordsB = this._editorView!.coordsAtPos(this._editorView!.state.selection.to); - this.props.isSelected(true) && AnchorMenu.Instance.jumpTo(coordsB.left, coordsB.bottom); - } - - // will see if end up using this - dispatchTransaction = (tx: Transaction) => { } - - - //will see if needed - // for inserting timestamps - insertTime = () => { } - - //for setting the title of the marker - @action - private updateTitle = () => { } - - //for updating the description of the marker - @action - private updateDescrption = () => { } - - - -}
\ No newline at end of file |
