The Block switcher always defaults to the same base layer selection on the radio buttons and on the map every time the page is refreshed. This happens regardless of previous selections made, it would be nice if the old state is remembered and restored even after page reloads.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

davidserene’s picture

Status: Active » Needs review
FileSize
19.4 KB

This patch adds two functions to the block switcher behavior; one function sets a cookie saving the current state of the map layers while the second function restores the old state on subsequent page reloads.

batje’s picture

Status: Needs review » Fixed

works, thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

designguru’s picture

Could this code be used in any way to save the currently visible/active layers when saving a node with a geofield?

Ref: https://drupal.org/node/2096497#comment-7894635

(I'm trying to use a single map for multiple nodes where the nodes themselves turn on whatever overlays they need to be active when a user views them.)

q./