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

Viewpoints HD to Trek and OutdoorSite detail page #967

Merged
merged 37 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
7b97756
Create viewPoint module
dtrucs Sep 5, 2023
4f1b996
Define state to select map ID
dtrucs Sep 5, 2023
0e85397
Create BackToMapButton component
dtrucs Sep 5, 2023
3622e59
Create viewpoints annotations components
dtrucs Sep 5, 2023
3238193
Display map by default
dtrucs Sep 5, 2023
78b9ccb
Install leaflet-rastercoords package
dtrucs Sep 5, 2023
a371e8e
Create Viewpoint component
dtrucs Sep 5, 2023
4b67fdb
Get viewpoint from trek page
dtrucs Sep 5, 2023
e594bec
Get viewpoint from outdoorsite page
dtrucs Sep 5, 2023
01bc469
Define the rules of map projection according to viewpoints
dtrucs Sep 5, 2023
96316b9
Display viewpoint photo instead of map
dtrucs Sep 5, 2023
5ee7885
Active report redifine default map
dtrucs Sep 5, 2023
8679f26
Handle OpenMapbutton component with viewpoint
dtrucs Sep 5, 2023
7149a43
Create detailsMedias component
dtrucs Sep 5, 2023
5855e2c
Call detailMedias section in details pages
dtrucs Sep 5, 2023
4fb0da1
Display annotation in control section
dtrucs Sep 6, 2023
edfabf9
Remove backToMapButton on fullscreen mode
dtrucs Sep 6, 2023
5eafbc2
Get viewpoint for POI module
dtrucs Sep 13, 2023
b185a3e
Improve DetailsMedia component to use it as accordion
dtrucs Sep 13, 2023
ecf9068
Improve DetailsCard to support medias prop
dtrucs Sep 13, 2023
f70fcc6
Add geometry field to viewPoints adapter
dtrucs Sep 19, 2023
57063d7
Fix POI viewPoints display
dtrucs Sep 19, 2023
7759e61
Review viewPoint HD wording
dtrucs Sep 27, 2023
5acf6c2
Create ViewPoint icon component
dtrucs Sep 27, 2023
3f7a143
Create ClickableMarker component
dtrucs Sep 27, 2023
63eae8d
Add viewPoint to controlPanel
dtrucs Sep 27, 2023
cbe629b
Add ViewPointMarker component
dtrucs Sep 27, 2023
110f3f7
Links details Viewpoints and map interaction
dtrucs Sep 27, 2023
249fa05
Review display viewPoint HD CTA wording
dtrucs Oct 31, 2023
23ccb44
Add classNames to annotations geometry and make tooltip bigger
dtrucs Oct 31, 2023
36a41c1
Restyle show more poi card
dtrucs Oct 31, 2023
9749b72
Define default fill and stroke for annotations
dtrucs Jan 15, 2024
7238413
Add baseline to HDViewpoint section
dtrucs Jan 17, 2024
4f4b754
Add Leaflet-rastercoords typescript definition
dtrucs Jan 26, 2024
bb41b36
Avoid breaking the rule of hook for ViewPointHD component
dtrucs Jan 26, 2024
959a6f4
Simplify DetailsCardProps interface
dtrucs Jan 26, 2024
0e9fe1f
Do not save/display HD viewpoint for offline content
dtrucs Jan 29, 2024
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/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ module.exports = [
&& !url.host.includes('stamen-tiles')
&& !url.host.includes('wxs.ign.fr')
&& !url.host.includes('data.geopf.fr')
&& !url.pathname.startsWith('/api/hdviewpoint/drf/hdviewpoints/')
&& request.destination === 'image'
},
handler: 'NetworkFirst',
Expand Down
12 changes: 12 additions & 0 deletions frontend/config/details.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
"anchor": true,
"order": 10
},
{
"name": "medias",
"display": true,
"anchor": false,
"order": 15
},
{
"name": "itinerancySteps",
"display": true,
Expand Down Expand Up @@ -170,6 +176,12 @@
"anchor": true,
"order": 10
},
{
"name": "medias",
"display": true,
"anchor": false,
"order": 15
},
{
"name": "poi",
"display": true,
Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"html-react-parser": "^2.0.0",
"leaflet": "^1.7.1",
"leaflet-boundary-canvas": "^1.0.0",
"leaflet-rastercoords": "^1.0.5",
"leaflet.locatecontrol": "0.74.0",
"leaflet.offline": "^3.0.1",
"next": "^13.1.6",
Expand Down
34 changes: 34 additions & 0 deletions frontend/src/components/BackToMapButton/BackToMapButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { useCallback } from 'react';
import { Map } from 'components/Icons/Map';
import { FormattedMessage } from 'react-intl';
import { cn } from 'services/utils/cn';

export const BackToMapButton: React.FC<
React.ButtonHTMLAttributes<HTMLButtonElement> & {
displayMap?: () => void;
setMapId?: (key: string) => void;
}
> = ({ displayMap, setMapId, ...nativeButtonProps }) => {
const handleClick = useCallback(() => {
displayMap?.();
setMapId?.('default');
}, [displayMap, setMapId]);

return (
<button
id="backToMapButton"
type="button"
className={cn(
`flex items-center fixed z-mapButton bottom-6 left-1/2 -translate-x-1/2
py-3 px-4
shadow-sm rounded-full text-sm
text-primary1 bg-white hover:bg-primary2 focus:bg-primary2 transition-all`,
)}
{...nativeButtonProps}
onClick={handleClick}
>
<FormattedMessage id="search.seeMap" />
<Map size={24} className="ml-1" />
</button>
);
};
1 change: 1 addition & 0 deletions frontend/src/components/BackToMapButton/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { BackToMapButton } from './BackToMapButton';
25 changes: 25 additions & 0 deletions frontend/src/components/Icons/ViewPoint/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';
import { GenericIconProps } from '../types';

export const ViewPoint: React.FC<GenericIconProps> = ({
color = 'currentColor',
opacity,
className,
size = 24,
}) => {
return (
<svg
width={size}
className={className}
opacity={opacity}
viewBox="0 0 32 40"
height={size}
xmlns="http://www.w3.org/2000/svg"
>
<path
fill={color}
d="M22.915 31.041H3.362a2.406 2.406 0 0 1-2.404-2.403V9.084a2.406 2.406 0 0 1 2.404-2.403h14.159V2.484A1.521 1.521 0 0 1 19.034.958h10.482a1.528 1.528 0 0 1 1.525 1.526v10.482a1.521 1.521 0 0 1-1.525 1.513h-4.198v14.159a2.406 2.406 0 0 1-2.403 2.403zm-6.2-11.737c.132 0 .26.053.353.147l4.989 4.987V14.48c-.863-.013-2.079.044-2.83 0a1.543 1.543 0 0 1-1.706-1.725c-.043-.748.012-1.95 0-2.811H4.22V22.01l4.345-4.346a.5.5 0 0 1 .708.001l4.424 4.45 2.663-2.663a.498.498 0 0 1 .354-.147zm5.844-5.825h6.957a.52.52 0 0 0 .525-.513V2.484a.526.526 0 0 0-.525-.526H19.034a.52.52 0 0 0-.513.526c-.007.871.007 7.455 0 8.155.055.376-.163 2.564.207 2.736a1.4 1.4 0 0 0 .521.104c.884-.01 2.416.003 3.31 0zm-8.862 3.94c-2.313 0-2.313-3.47 0-3.47s2.313 3.47 0 3.47zm9-6.062H21.14a.49.49 0 0 1-.184-.036h-.001a.508.508 0 0 1-.275-.273.521.521 0 0 1-.037-.186V9.304c.012-.654.987-.654 1 0v.346l4.57-4.57h-.347c-.654-.012-.654-.987 0-1l1.57.001a.501.501 0 0 1 .484.494v1.559c-.013.654-.988.654-1 0v-.346l-4.57 4.57h.346c.654.012.654.987 0 1z"
/>
</svg>
);
};
Loading
Loading