Skip to content

Commit

Permalink
Simple static location sharing (#19754)
Browse files Browse the repository at this point in the history
Adds static location share a la [MSC3488](matrix-org/matrix-spec-proposals#3488) behind a labs flag, supporting legacy `m.location` `msgtype` too.  Powered by matrix-org/matrix-react-sdk#7135.  Adds maplibre as a dependency.

To make this work, you have to add a valid `map_style_url` to your config.json.
  • Loading branch information
ara4n authored Dec 6, 2021
1 parent 95a2b8e commit 9b780e0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ For a good example, see https://develop.element.io/config.json.
1. `sentry`: [Sentry](https://sentry.io/) configuration for rageshake data being sent to sentry.
1. `dsn`: the Sentry [DSN](https://docs.sentry.io/product/sentry-basics/dsn-explainer/)
2. `environment`: (optional) The [Environment](https://docs.sentry.io/product/sentry-basics/environments/) to pass to sentry
1. `map_style_url`: Maptile server URL for location sharing. e.g.
'https://api.maptiler.com/maps/basic/style.json?key=YOUR_KEY_GOES_HERE'
1. `analyticsOwner`: The entity that analytics data is being sent to. Used in copy
when explaining to the user where data is being sent. If not set, defaults to `brand`.

Expand Down
13 changes: 13 additions & 0 deletions docs/labs.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,19 @@ entirely incomplete and may not work at all - it is not recommended for general
Metaspaces are automatically populated spaces you can enable in your Space panel.
By default, you'll have Home or All rooms, but you can opt in to a People, Favourites, and Other Rooms metaspace too.

## Location sharing (`feature_location_share`) [In Development]

Allows users to send and display location data using [maplibre](https://maplibre.org).

The current implementation is a quick in-progress development spike to
demonstrate viability and prove [MSC3488](https://github.com/matrix-org/matrix-doc/pull/3488)
and [MSC3489](https://github.com/matrix-org/matrix-doc/pull/3489) - **the UI has not yet
been designed, and it will not exit labs until it has**.

For this to work, you must specify a valid maptiler.com API key in
`"map_style_url": "https://api.maptiler.com/maps/basic/style.json?key=YOUR_KEY_GOES_HERE"`
in your config.json, or find an alternative map tile server.

## Breadcrumbs v2 (`feature_breadcrumbs_v2`)

Instead of showing the horizontal list of breadcrumbs under the filter field, the new UX is an interactive context menu
Expand Down
2 changes: 1 addition & 1 deletion src/vector/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
font-src 'self' data:;
media-src * blob: data:;
child-src * blob: data:;
worker-src 'self';
worker-src 'self' blob:;
frame-src * blob: data:;
form-action 'self';
manifest-src 'self';
Expand Down
3 changes: 3 additions & 0 deletions test/jest-mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ Object.defineProperty(window, 'matchMedia', {
dispatchEvent: jest.fn(),
})),
});

// maplibre requires a createObjectURL mock
global.URL.createObjectURL = jest.fn();

0 comments on commit 9b780e0

Please sign in to comment.