Skip to content

Commit

Permalink
Add attribution to map
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo-Duke committed May 2, 2024
1 parent c6bc33f commit 7d78ddb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/api/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ type BaseLayers = {
id: number;
label: string;
url: string;
attribution: string;
control: {
attribution: string;
};
}[];

export type RawLayer = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default function SearchMap() {
<LayersControl position="topright">
{baseLayers.map(({ id, label, ...layer }, index) => (
<LayersControl.BaseLayer key={id} checked={index === 0} name={label}>
<TileLayer {...layer} />
<TileLayer {...layer} attribution={layer.control.attribution} />
</LayersControl.BaseLayer>
))}
</LayersControl>
Expand Down
1 change: 1 addition & 0 deletions translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"coordinatesHelptext": "Indiquez la position de l'observation sur la carte",
"submit": "Soumettre votre observation",
"title": "Observation",
"password": "Mot de passe",
"contributedAt": "Observé le",
"station": "Station",
"labelButton": "Ajouter une observation",
Expand Down

0 comments on commit 7d78ddb

Please sign in to comment.