diff options
Diffstat (limited to 'src/client/views/nodes/MapBox/MapPushpinBox.tsx')
| -rw-r--r-- | src/client/views/nodes/MapBox/MapPushpinBox.tsx | 35 | 
1 files changed, 35 insertions, 0 deletions
diff --git a/src/client/views/nodes/MapBox/MapPushpinBox.tsx b/src/client/views/nodes/MapBox/MapPushpinBox.tsx new file mode 100644 index 000000000..552bceace --- /dev/null +++ b/src/client/views/nodes/MapBox/MapPushpinBox.tsx @@ -0,0 +1,35 @@ +import { observer } from 'mobx-react'; +// import { SettingsManager } from '../../../util/SettingsManager'; +import { ViewBoxBaseComponent } from '../../DocComponent'; +import { FieldView, FieldViewProps } from '../FieldView'; +import React = require('react'); +import { computed } from 'mobx'; +import { MapBox } from './MapBox'; + +/** + * Map Pushpin doc class + */ +@observer +export class MapPushpinBox extends ViewBoxBaseComponent<FieldViewProps>() { +    public static LayoutString(fieldKey: string) { +        return FieldView.LayoutString(MapPushpinBox, fieldKey); +    } +    componentDidMount() { +        // if (this.mapBoxView) +        this.mapBoxView.addPushpin(this.rootDoc); +    } +    componentWillUnmount() { +        this.mapBoxView.deletePushpin(this.rootDoc); +    } + +    @computed get mapBoxView() { +        return this.props.DocumentView?.()?.props.docViewPath().lastElement()?.ComponentView as MapBox; +    } +    @computed get mapBox() { +        return this.props.DocumentView?.().props.docViewPath().lastElement()?.rootDoc; +    } + +    render() { +        return <div />; +    } +}  | 
