1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-11 20:22:36 +03:00

Simple static location sharing (#7135)

Adds maplibre as a dependency, and behind a labs flag, lets users send and receive [MSC3488](https://github.com/matrix-org/matrix-doc/blob/matthew/location/proposals/3488-location.md) style location shares - with backwards compatibility with old school `m.location` `msgtype` location shares too.

For this to work, you have to define a valid maptile server and API in your config.json's `map_style_url`.
This commit is contained in:
Matthew Hodgson
2021-12-06 09:45:12 +00:00
committed by GitHub
parent eb05044bc4
commit 1262021417
17 changed files with 703 additions and 3 deletions

View File

@@ -125,6 +125,14 @@ export default class MessageEvent extends React.Component<IProps> implements IMe
BodyType = sdk.getComponent('messages.MPollBody');
}
}
if ((type && type === "org.matrix.msc3488.location") ||
(type && type === EventType.RoomMessage && msgtype && msgtype === MsgType.Location)) {
// TODO: tidy this up once location sharing is out of labs
if (SettingsStore.getValue("feature_location_share")) {
BodyType = sdk.getComponent('messages.MLocationBody');
}
}
}
if (SettingsStore.getValue("feature_mjolnir")) {