You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-07 21:23:00 +03:00
Live location sharing: set map bounds to include all locations (#8324)
* open a dialog with map centered around first beacon Signed-off-by: Kerry Archibald <kerrya@element.io> * test dialog opening from beacon body Signed-off-by: Kerry Archibald <kerrya@element.io> * test beaconmarker Signed-off-by: Kerry Archibald <kerrya@element.io> * add bounds to Map comp Signed-off-by: Kerry Archibald <kerrya@element.io> * add focusBeacon to beaconviewdialog, use bounds Signed-off-by: Kerry Archibald <kerrya@element.io> * lint Signed-off-by: Kerry Archibald <kerrya@element.io> * use membercolor on beacon view markers Signed-off-by: Kerry Archibald <kerrya@element.io> * add lnglatbounds to maplibre mock Signed-off-by: Kerry Archibald <kerrya@element.io> * update snapshots for expanded maplibre Map mock Signed-off-by: Kerry Archibald <kerrya@element.io> * test map bounds Signed-off-by: Kerry Archibald <kerrya@element.io> * tidy copy paste comment Signed-off-by: Kerry Archibald <kerrya@element.io> * add fallback when no more live locations Signed-off-by: Kerry Archibald <kerrya@element.io> * accurate signature for getBoundsCenter Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const EventEmitter = require("events");
|
||||
const { LngLat, NavigationControl } = require('maplibre-gl');
|
||||
const { LngLat, NavigationControl, LngLatBounds } = require('maplibre-gl');
|
||||
|
||||
class MockMap extends EventEmitter {
|
||||
addControl = jest.fn();
|
||||
@@ -8,6 +8,7 @@ class MockMap extends EventEmitter {
|
||||
zoomOut = jest.fn();
|
||||
setCenter = jest.fn();
|
||||
setStyle = jest.fn();
|
||||
fitBounds = jest.fn();
|
||||
}
|
||||
const MockMapInstance = new MockMap();
|
||||
|
||||
@@ -24,5 +25,6 @@ module.exports = {
|
||||
GeolocateControl: jest.fn().mockReturnValue(MockGeolocateInstance),
|
||||
Marker: jest.fn().mockReturnValue(MockMarker),
|
||||
LngLat,
|
||||
LngLatBounds,
|
||||
NavigationControl,
|
||||
};
|
||||
|
Reference in New Issue
Block a user