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

feat(front): utiliser le localStorage pour stocker le fond cartographique actuel #2620

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

mvergez
Copy link
Contributor

@mvergez mvergez commented Jul 3, 2023

Ce qui a été fait :

  • Stockage seulement du nom du fond de carte dans le localStorage car la couche peut-être retrouvée grâce à la variable baseControl
  • A la création de la carte : prend la couche contenue dans le localStorage. La directive map.addLayer n'ajoute pas la couche si elle existe déjà (voir : https://stackoverflow.com/a/33762133) mais la met à jour
  • Ajout de conditions pour traiter les erreurs suivantes : localStorage vide, nom de la couche introuvable

Attention : cette PR ne traite pas du stockage des REF_LAYERS (ZNIEFF, communes etc), car lourd à afficher et n'a pas vocation, selon moi, à apparaitre constamment sur la carte.

Closes #2619

Store the name of the selected BaseLayer in the local storage, so that
it can be set on map creation. Only the name is stored since the actual
base layer can be retrieved from it.
Checks have been set to prevent errors when the layer does not exist or
if the localStorage is empty
@codecov
Copy link

codecov bot commented Jul 3, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (4a226c2) 68.27% compared to head (2b14515) 68.27%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2620   +/-   ##
========================================
  Coverage    68.27%   68.27%           
========================================
  Files           84       84           
  Lines         7419     7419           
========================================
  Hits          5065     5065           
  Misses        2354     2354           
Flag Coverage Δ
pytest 68.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@camillemonchicourt camillemonchicourt added this to the 2.13 milestone Jul 10, 2023
@Pierre-Narcisi Pierre-Narcisi merged commit d0b3493 into PnX-SI:develop Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants