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() { 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
; } }