aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/MapBox/MapPushpinBox.tsx
blob: 13fb11054edf658d9df57bfbabdbad53c7a6b99b (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
36
37
38
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() {
        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>);
    }
}