aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/MapBox/MapPushpinBox.tsx
blob: d28209ea1eb864390dc9efa39df27667e6a71b99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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.removePushpin(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></div>;
    }
}