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
+3 -1
View File
@@ -1,7 +1,8 @@
/*
Copyright 2015, 2016 OpenMarket Ltd
Copyright 2017 Vector Creations Ltd
Copyright 2017 New Vector Ltd
Copyright 2017 - 2019 New Vector Ltd
Copyright 2019 - 2021 The Matrix.org Foundation C.I.C
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -19,6 +20,7 @@ limitations under the License.
@import "./_font-sizes.scss";
@import "./_font-weights.scss";
@import "./_animations.scss";
@import url("maplibre-gl/dist/maplibre-gl.css");
$hover-transition: 0.08s cubic-bezier(.46, .03, .52, .96); // quadratic
+2
View File
@@ -173,6 +173,7 @@
@import "./views/groups/_GroupPublicityToggle.scss";
@import "./views/groups/_GroupRoomList.scss";
@import "./views/groups/_GroupUserSettings.scss";
@import "./views/location/_LocationPicker.scss";
@import "./views/messages/_CallEvent.scss";
@import "./views/messages/_CreateEvent.scss";
@import "./views/messages/_DateSeparator.scss";
@@ -182,6 +183,7 @@
@import "./views/messages/_MImageBody.scss";
@import "./views/messages/_MImageReplyBody.scss";
@import "./views/messages/_MJitsiWidgetEvent.scss";
@import "./views/messages/_MLocationBody.scss";
@import "./views/messages/_MNoticeBody.scss";
@import "./views/messages/_MPollBody.scss";
@import "./views/messages/_MStickerBody.scss";
@@ -0,0 +1,44 @@
/*
Copyright 2021 The Matrix.org Foundation C.I.C
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
.mx_LocationPicker {
// placeholder sizing to be replaced once there's a proper design
width: 450px;
height: 500px;
border-radius: 4px;
display: flex;
flex-direction: column;
}
#mx_LocationPicker_map {
height: 324px;
border-radius: 8px 8px 0px 0px;
}
.mx_LocationPicker_footer {
margin: 24px;
.mx_Dropdown_menu {
max-height: 140px;
}
}
.mx_LocationPicker_error {
color: red;
margin: auto;
}
@@ -0,0 +1,22 @@
/*
Copyright 2021 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
.mx_MLocationBody_map {
width: 450px;
height: 300px;
border-radius: $timeline-image-border-radius;
}
@@ -256,6 +256,10 @@ limitations under the License.
mask-image: url('$(res)/img/element-icons/room/composer/emoji.svg');
}
.mx_MessageComposer_location::before {
mask-image: url('$(res)/img/element-icons/room/composer/location.svg');
}
.mx_MessageComposer_stickers::before {
mask-image: url('$(res)/img/element-icons/room/composer/sticker.svg');
}