blob: 8ebc901578b5811974f1cd3f8d88f86e121b3958 (
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
|
import * as React from 'react';
import { ViewBoxBaseComponent } from '../../DocComponent';
import { FieldView, FieldViewProps } from '../FieldView';
import { MapBoxContainer } from '../MapboxMapBox/MapboxContainer';
/**
* Map Pushpin doc class
*/
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);
}
get mapBoxView() {
return this.DocumentView?.()?.containerViewPath?.().lastElement()?.ComponentView as MapBoxContainer;
}
get mapBox() {
return this.DocumentView?.().containerViewPath?.().lastElement()?.Document;
}
render() {
return <div />;
}
}
|