webtrees icon indicating copy to clipboard operation
webtrees copied to clipboard

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

Open ddrury opened this issue 3 years ago • 2 comments

  • 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)

ddrury avatar Jan 19 '22 10:01 ddrury

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%) :arrow_up:
app/Statistics/Repository/MediaRepository.php 100.00% <ø> (ø)
app/Statistics/Google/ChartDistribution.php 45.00% <24.67%> (+3.03%) :arrow_up:
app/Module/IndividualListModule.php 50.50% <55.55%> (+0.12%) :arrow_up:
app/Statistics/Repository/PlaceRepository.php 98.98% <94.73%> (+10.61%) :arrow_up:

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.

codecov[bot] avatar Jan 19 '22 10:01 codecov[bot]

See also https://github.com/fisharebest/webtrees/pull/4727 and https://github.com/fisharebest/webtrees/pull/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.

ddrury avatar Jan 16 '23 14:01 ddrury