@@ -23,6 +23,7 @@ import SdkConfig from '../../../SdkConfig';
23
23
import { replaceableComponent } from "../../../utils/replaceableComponent" ;
24
24
import { IBodyProps } from "./IBodyProps" ;
25
25
import { _t } from '../../../languageHandler' ;
26
+ import MemberAvatar from '../avatars/MemberAvatar' ;
26
27
27
28
interface IState {
28
29
error : Error ;
@@ -32,7 +33,6 @@ interface IState {
32
33
export default class MLocationBody extends React . Component < IBodyProps , IState > {
33
34
private map : maplibregl . Map ;
34
35
private coords : GeolocationCoordinates ;
35
- private description : string ;
36
36
37
37
constructor ( props : IBodyProps ) {
38
38
super ( props ) ;
@@ -49,8 +49,6 @@ export default class MLocationBody extends React.Component<IBodyProps, IState> {
49
49
this . state = {
50
50
error : undefined ,
51
51
} ;
52
-
53
- this . description = loc ?. description ?? content [ 'body' ] ;
54
52
}
55
53
56
54
componentDidMount ( ) {
@@ -65,13 +63,12 @@ export default class MLocationBody extends React.Component<IBodyProps, IState> {
65
63
zoom : 13 ,
66
64
} ) ;
67
65
68
- new maplibregl . Popup ( {
69
- closeButton : false ,
70
- closeOnClick : false ,
71
- closeOnMove : false ,
66
+ new maplibregl . Marker ( {
67
+ element : document . getElementById ( this . getMarkerId ( ) ) ,
68
+ anchor : 'bottom' ,
69
+ offset : [ 0 , - 1 ] ,
72
70
} )
73
71
. setLngLat ( coordinates )
74
- . setHTML ( this . description )
75
72
. addTo ( this . map ) ;
76
73
77
74
this . map . on ( 'error' , ( e ) => {
@@ -88,6 +85,10 @@ export default class MLocationBody extends React.Component<IBodyProps, IState> {
88
85
return `mx_MLocationBody_${ this . props . mxEvent . getId ( ) } ` ;
89
86
} ;
90
87
88
+ private getMarkerId = ( ) => {
89
+ return `mx_MLocationBody_marker_${ this . props . mxEvent . getId ( ) } ` ;
90
+ } ;
91
+
91
92
render ( ) {
92
93
const error = this . state . error ?
93
94
< div className = "mx_EventTile_tileError mx_EventTile_body" >
@@ -97,6 +98,22 @@ export default class MLocationBody extends React.Component<IBodyProps, IState> {
97
98
return < div className = "mx_MLocationBody" >
98
99
< div id = { this . getBodyId ( ) } className = "mx_MLocationBody_map" />
99
100
{ error }
101
+ < div className = "mx_MLocationBody_marker" id = { this . getMarkerId ( ) } >
102
+ < div className = "mx_MLocationBody_markerBorder" >
103
+ < MemberAvatar
104
+ member = { this . props . mxEvent . sender }
105
+ width = { 27 }
106
+ height = { 27 }
107
+ viewUserOnClick = { false }
108
+ />
109
+ </ div >
110
+ < img
111
+ className = "mx_MLocationBody_pointer"
112
+ src = { require ( "../../../../res/img/location/pointer.svg" ) }
113
+ width = "9"
114
+ height = "5"
115
+ />
116
+ </ div >
100
117
</ div > ;
101
118
}
102
119
}
0 commit comments