Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add map fullscreen control #952

Merged
merged 3 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"react-inlinesvg": "^3.0.2",
"react-intl": "^6.2.1",
"react-leaflet": "3.1.0",
"react-leaflet-fullscreen": "^4.1.0",
"react-leaflet-markercluster": "^3.0.0-rc1",
"react-leaflet-textpath": "2.1.0",
"react-media-hook": "^0.5.0",
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/Map/DetailsMap/DetailsMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import React, { useContext, useEffect } from 'react';
import { MapContainer, ScaleControl } from 'react-leaflet';
import 'leaflet/dist/leaflet.css';
import styled, { css } from 'styled-components';

Check warning on line 6 in frontend/src/components/Map/DetailsMap/DetailsMap.tsx

View workflow job for this annotation

GitHub Actions / install-and-test

'styled' is defined but never used

import { ArrowLeft } from 'components/Icons/ArrowLeft';

Expand Down Expand Up @@ -39,6 +39,7 @@
import DetailsMapDrawer from '../components/DetailsMapDrawer';
import { ResetView } from '../components/ResetView';
import TileLayerManager from '../components/TileLayerManager';
import FullscreenControl from '../components/FullScreenControl';

export interface GeometryListProps {
geometry:
Expand Down Expand Up @@ -171,6 +172,7 @@
) : (
<BackButton icon={<ArrowLeft size={24} />} onClick={hideMap} />
)}
{props.hasZoomControl && <FullscreenControl />}
<ResetView />
<ScaleControl />
<ControlSection
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/Map/SearchMap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { BackButton } from '../components/BackButton';
import { FilterButton } from '../components/FilterButton';
import { ResetView } from '../components/ResetView';
import TileLayerManager from '../components/TileLayerManager';
import FullscreenControl from '../components/FullScreenControl';

export type PropsType = {
segments?: { x: number; y: number }[];
Expand Down Expand Up @@ -41,6 +42,7 @@ const SearchMap: React.FC<PropsType> = props => {
<TileLayerManager />
<BackButton icon={<ArrowLeft size={24} />} onClick={hideMap} />
<FilterButton openFilterMenu={props.openFilterMenu} />
{props.hasZoomControl === true && <FullscreenControl />}
<ResetView />
<ScaleControl />
<SearchMapChildrens {...props} />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { FullscreenControl } from 'react-leaflet-fullscreen';
import 'react-leaflet-fullscreen/styles.css';

export default FullscreenControl;
12 changes: 12 additions & 0 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7828,6 +7828,11 @@ leaflet-textpath@^1.2.3:
resolved "https://registry.yarnpkg.com/leaflet-textpath/-/leaflet-textpath-1.2.3.tgz#0adef3a2d438c1c781f4e1154b8fa2f963cfd8a7"
integrity sha512-mPb5m2MlihNkLlo762j8S8FJCUyLvDU2fJTjjmDWKfqqyUQkV3ca3IzrxwsfzYz2DXrV2ytCVHb5+DjQymF+8w==

leaflet.fullscreen@2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/leaflet.fullscreen/-/leaflet.fullscreen-2.4.0.tgz#8503c69b6f6afe6f54594c9cdd5e4f131cfa97b4"
integrity sha512-41O0ikdUR0bVC0QfoFN3W5S+9yoeHqL74i0QQafa/W79+ij/G7IRZwpfwPuxoNwpydoUJ/9Mq/6Hp7WZOnkWzQ==

leaflet.locatecontrol@0.74.0:
version "0.74.0"
resolved "https://registry.yarnpkg.com/leaflet.locatecontrol/-/leaflet.locatecontrol-0.74.0.tgz#a62153a0de5e05ef7efd73df7247a23060330fd7"
Expand Down Expand Up @@ -9581,6 +9586,13 @@ react-is@^18.0.0:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b"
integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==

react-leaflet-fullscreen@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/react-leaflet-fullscreen/-/react-leaflet-fullscreen-4.1.0.tgz#b3a1b610e968b19f50e809e56c3e540022a28e9d"
integrity sha512-Kfs0M0RFtQ/l+h/aSMDxi/BprD08YxWl8H155RqXt+7TXtEM/OWRnDu/c6o29MRsKw+3dnX4sEFe5T18v0h3Dg==
dependencies:
leaflet.fullscreen "2.4.0"

react-leaflet-markercluster@^3.0.0-rc1:
version "3.0.0-rc1"
resolved "https://registry.yarnpkg.com/react-leaflet-markercluster/-/react-leaflet-markercluster-3.0.0-rc1.tgz#4e45392d599fb410eac413aeee6cb52f51d0fc5c"
Expand Down
Loading