Live location sharing - consolidate maps (#8236)
* extract location markers into generic Marker Signed-off-by: Kerry Archibald <kerrya@element.io> * wrap marker in smartmarker Signed-off-by: Kerry Archibald <kerrya@element.io> * test smartmarker Signed-off-by: Kerry Archibald <kerrya@element.io> * working map in location body Signed-off-by: Kerry Archibald <kerrya@element.io> * test Map Signed-off-by: Kerry Archibald <kerrya@element.io> * remove skinned sdk Signed-off-by: Kerry Archibald <kerrya@element.io> * update snaps with new mocks Signed-off-by: Kerry Archibald <kerrya@element.io> * use new ZoomButtons in MLocationBody Signed-off-by: Kerry Archibald <kerrya@element.io> * make LocationViewDialog map interactive Signed-off-by: Kerry Archibald <kerrya@element.io> * test MLocationBody Signed-off-by: Kerry Archibald <kerrya@element.io> * test LocationViewDialog Signed-off-by: Kerry Archibald <kerrya@element.io> * add copyrights, shrink snapshot Signed-off-by: Kerry Archibald <kerrya@element.io> * update comment Signed-off-by: Kerry Archibald <kerrya@element.io> * lint Signed-off-by: Kerry Archibald <kerrya@element.io> * lint Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
parent
944e11d7d6
commit
9ba55d1d14
16 changed files with 890 additions and 235 deletions
|
@ -27,3 +27,159 @@ exports[`MLocationBody <MLocationBody> with error displays correct fallback cont
|
|||
Shared a location: Found at geo:51.5076,-0.1276 at 2021-12-21T12:22+0000
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`MLocationBody <MLocationBody> without error renders map correctly 1`] = `
|
||||
<MLocationBody
|
||||
highlightLink=""
|
||||
highlights={Array []}
|
||||
mediaEventHelper={Object {}}
|
||||
mxEvent={
|
||||
Object {
|
||||
"content": Object {
|
||||
"body": "Found at geo:51.5076,-0.1276 at 2021-12-21T12:22+0000",
|
||||
"geo_uri": "geo:51.5076,-0.1276",
|
||||
"msgtype": "m.location",
|
||||
"org.matrix.msc1767.text": "Found at geo:51.5076,-0.1276 at 2021-12-21T12:22+0000",
|
||||
"org.matrix.msc3488.asset": Object {
|
||||
"type": "m.pin",
|
||||
},
|
||||
"org.matrix.msc3488.location": Object {
|
||||
"description": "Human-readable label",
|
||||
"uri": "geo:51.5076,-0.1276",
|
||||
},
|
||||
"org.matrix.msc3488.ts": 252523,
|
||||
},
|
||||
"event_id": "$2",
|
||||
"type": "org.matrix.msc3488.location",
|
||||
}
|
||||
}
|
||||
onHeightChanged={[MockFunction]}
|
||||
onMessageAllowed={[MockFunction]}
|
||||
permalinkCreator={Object {}}
|
||||
>
|
||||
<LocationBodyContent
|
||||
mapId="mx_MLocationBody_$2_1f9acffa"
|
||||
mxEvent={
|
||||
Object {
|
||||
"content": Object {
|
||||
"body": "Found at geo:51.5076,-0.1276 at 2021-12-21T12:22+0000",
|
||||
"geo_uri": "geo:51.5076,-0.1276",
|
||||
"msgtype": "m.location",
|
||||
"org.matrix.msc1767.text": "Found at geo:51.5076,-0.1276 at 2021-12-21T12:22+0000",
|
||||
"org.matrix.msc3488.asset": Object {
|
||||
"type": "m.pin",
|
||||
},
|
||||
"org.matrix.msc3488.location": Object {
|
||||
"description": "Human-readable label",
|
||||
"uri": "geo:51.5076,-0.1276",
|
||||
},
|
||||
"org.matrix.msc3488.ts": 252523,
|
||||
},
|
||||
"event_id": "$2",
|
||||
"type": "org.matrix.msc3488.location",
|
||||
}
|
||||
}
|
||||
onClick={[Function]}
|
||||
onError={[Function]}
|
||||
tooltip="Expand map"
|
||||
>
|
||||
<div
|
||||
className="mx_MLocationBody"
|
||||
>
|
||||
<TooltipTarget
|
||||
alignment={5}
|
||||
label="Expand map"
|
||||
maxParentWidth={450}
|
||||
>
|
||||
<div
|
||||
onBlur={[Function]}
|
||||
onFocus={[Function]}
|
||||
onMouseLeave={[Function]}
|
||||
onMouseOver={[Function]}
|
||||
tabIndex={0}
|
||||
>
|
||||
<Map
|
||||
centerGeoUri="geo:51.5076,-0.1276"
|
||||
className="mx_MLocationBody_map"
|
||||
id="mx_MLocationBody_$2_1f9acffa"
|
||||
onClick={[Function]}
|
||||
onError={[Function]}
|
||||
>
|
||||
<div
|
||||
className="mx_Map mx_MLocationBody_map"
|
||||
id="mx_Map_mx_MLocationBody_$2_1f9acffa"
|
||||
onClick={[Function]}
|
||||
>
|
||||
<SmartMarker
|
||||
geoUri="geo:51.5076,-0.1276"
|
||||
id="mx_MLocationBody_$2_1f9acffa-marker"
|
||||
map={
|
||||
MockMap {
|
||||
"_events": Object {
|
||||
"error": Array [
|
||||
[Function],
|
||||
[Function],
|
||||
],
|
||||
},
|
||||
"_eventsCount": 1,
|
||||
"_maxListeners": undefined,
|
||||
"addControl": [MockFunction],
|
||||
"removeControl": [MockFunction],
|
||||
"setCenter": [MockFunction] {
|
||||
"calls": Array [
|
||||
Array [
|
||||
Object {
|
||||
"lat": 51.5076,
|
||||
"lon": -0.1276,
|
||||
},
|
||||
],
|
||||
Array [
|
||||
Object {
|
||||
"lat": 51.5076,
|
||||
"lon": -0.1276,
|
||||
},
|
||||
],
|
||||
],
|
||||
"results": Array [
|
||||
Object {
|
||||
"type": "return",
|
||||
"value": undefined,
|
||||
},
|
||||
Object {
|
||||
"type": "return",
|
||||
"value": undefined,
|
||||
},
|
||||
],
|
||||
},
|
||||
"setStyle": [MockFunction],
|
||||
"zoomIn": [MockFunction],
|
||||
"zoomOut": [MockFunction],
|
||||
Symbol(kCapture): false,
|
||||
}
|
||||
}
|
||||
>
|
||||
<ForwardRef
|
||||
id="mx_MLocationBody_$2_1f9acffa-marker"
|
||||
>
|
||||
<div
|
||||
className="mx_Marker mx_Marker_defaultColor"
|
||||
id="mx_MLocationBody_$2_1f9acffa-marker"
|
||||
>
|
||||
<div
|
||||
className="mx_Marker_border"
|
||||
>
|
||||
<div
|
||||
className="mx_Marker_icon"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</ForwardRef>
|
||||
</SmartMarker>
|
||||
</div>
|
||||
</Map>
|
||||
</div>
|
||||
</TooltipTarget>
|
||||
</div>
|
||||
</LocationBodyContent>
|
||||
</MLocationBody>
|
||||
`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue