Add option to find own location in map views

This commit is contained in:
Johannes Marbach 2023-02-04 19:58:19 +01:00
parent a756b33fe9
commit e5a7e83b48
6 changed files with 93 additions and 25 deletions

View file

@ -125,6 +125,9 @@ const BeaconViewDialog: React.FC<IProps> = ({ initialFocusedBeacon, roomId, matr
setFocusedBeaconState({ beacon, ts: Date.now() });
};
const hasOwnBeacon =
liveBeacons.filter((beacon) => beacon?.beaconInfoOwner === matrixClient.getUserId()).length > 0;
return (
<BaseDialog className="mx_BeaconViewDialog" onFinished={onFinished} fixedWidth={false}>
<MatrixClientContext.Provider value={matrixClient}>
@ -136,6 +139,7 @@ const BeaconViewDialog: React.FC<IProps> = ({ initialFocusedBeacon, roomId, matr
interactive
onError={setMapDisplayError}
className="mx_BeaconViewDialog_map"
allowGeolocate={!hasOwnBeacon}
>
{({ map }: { map: maplibregl.Map }) => (
<>