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

On change of map layer, save new layer to local storage #4165

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ddrury
Copy link
Contributor

@ddrury ddrury commented Jan 19, 2022

  • Added a name property to each layer object.
  • Added leafletjs.baselayerchange() function to the map which when it fires saves the name property to local storage.
  • On page load use the stored value to set the displayed layer.
  • Tidy formatting in Bing maps module (unrelated to above)

@codecov
Copy link

codecov bot commented Jan 19, 2022

Codecov Report

Merging #4165 (ed4e614) into main (64fe0e9) will decrease coverage by 0.02%.
The diff coverage is 30.00%.

@@             Coverage Diff              @@
##               main    #4165      +/-   ##
============================================
- Coverage     31.75%   31.73%   -0.03%     
+ Complexity    11119    11102      -17     
============================================
  Files          1106     1106              
  Lines         39106    39103       -3     
============================================
- Hits          12417    12408       -9     
- Misses        26689    26695       +6     
Impacted Files Coverage Δ
app/Module/IndividualFactsTabModule.php 0.00% <0.00%> (ø)
app/Module/PlaceHierarchyListModule.php 0.00% <0.00%> (ø)
app/Statistics.php 93.66% <ø> (+0.29%) ⬆️
app/Statistics/Repository/MediaRepository.php 100.00% <ø> (ø)
app/Statistics/Google/ChartDistribution.php 45.00% <24.67%> (+3.03%) ⬆️
app/Module/IndividualListModule.php 50.50% <55.55%> (+0.12%) ⬆️
app/Statistics/Repository/PlaceRepository.php 98.98% <94.73%> (+10.61%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0125e23...ed4e614. Read the comment docs.

@ddrury ddrury force-pushed the persist_map_providers branch 4 times, most recently from e8cbc5d to e53cc44 Compare January 20, 2022 10:05
@ddrury ddrury changed the title On change of map provider/layer save change to local storage On change of map layer save change to local storage Jan 20, 2022
@ddrury ddrury changed the title On change of map layer save change to local storage On change of map layer, save change to local storage Jan 20, 2022
@ddrury ddrury changed the title On change of map layer, save change to local storage On change of map layer, save new layer to local storage Jan 20, 2022
@ddrury ddrury mentioned this pull request Jan 29, 2022
@ddrury
Copy link
Contributor Author

ddrury commented Jan 16, 2023

See also #4727 and #4703

As this PR provides a method to save a users preferred map provider and layer to local storage it mitigates the problem whereby the default layer may change depending on how the map providers are enabled/disabled in the control panel, therefore the defaultLayer concept becomes redundant and the associated code can be removed.

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.

None yet

1 participant