Ticket #14 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

Legend layer checkbox not updated after calling map.showLayer

Reported by: jfournier Owned by: madair
Priority: P2 Milestone: 2.0
Component: Widgets Version: 1.0.2
Severity: Minor Keywords:
Cc: External ID:
state: New Browser: All
Operating System: All

Description

When using the Map widget API to turn layers on or off directly, the Legend widget does not update the state of the associated checkbox.

Change History

Changed 3 years ago by pagameba

  • milestone changed from 1.1 to 2.0

Changed 3 years ago by madair

  • status changed from new to assigned

Currently, the correct way to show/hide layers programatically is using the Fusion.Layers.Layer object's show() and hide() methods (same goes for Groups).

We need to decide which object should expose the API method.

Changed 3 years ago by pagameba

  • status changed from assigned to closed
  • resolution set to fixed

The correct method is:

var map = Fusion.getMapByIndice(0); var base = map.getAllLayers()[0]; var layer = base.getLayerByName('Parcels'); layer.hide(); layer.show();

calling base.showLayer(layer) and base.hideLayer(layer) will have the same visual effect on the map but will not update the legend checkboxes.

Note: See TracTickets for help on using tickets.