blob: 56f0a49b8f4017b49cc1e378ad6dece0708db3d0 (
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
|
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.Document);
}
componentWillUnmount() {
this.mapBoxView.deletePushpin(this.Document);
}
@computed get mapBoxView() {
return this.props.DocumentView?.()?.props.docViewPath().lastElement()?.ComponentView as MapBox;
}
@computed get mapBox() {
return this.props.DocumentView?.().props.docViewPath().lastElement()?.Document;
}
render() {
return <div />;
}
}
|