Ticket #516 (closed bug: invalid)

Opened 6 years ago

Last modified 6 years ago

layerSwitcher does not get updated when map.setBaseLayer is used

Reported by: bwoodall Owned by: euzuro
Priority: minor Milestone: 2.4 Release
Component: Control.LayerSwitcher Version:
Keywords: Cc:
State:

Description

While debugging another ticket I came across this. When you put the command map.setBaseLayer in your page then the layerSwitcher does not get updated to the new baselayer and shows the previous one.

Included is a example page

Attachments

layerSwitcher_Test.html Download (1.9 KB) - added by bwoodall 6 years ago.

Change History

Changed 6 years ago by bwoodall

Changed 6 years ago by sderle

  • milestone set to 2.4 Release

Changed 6 years ago by crschmidt

  • status changed from new to closed
  • resolution set to invalid

setBaseLayer's second argument is an internal-only argument to prevent the changebaselayer event from firing, which is what the layerswitcher uses to know when to draw it.

So, you're explicitly asking the baselayer to not cause changebaselayer to fire -- and the LayerSwitcher is dutifully not updating.

Remove that second param.

Note: See TracTickets for help on using tickets.