OpenLayers OpenLayers

Ticket #354 (new feature)

Opened 2 years ago

Last modified 1 month ago

Add Ability to Hide/Show() BaseLayer

Reported by: euzuro Assigned to: euzuro
Priority: minor Milestone: 3.0 Release
Component: Layer Version:
Keywords: Cc:
State:

Description

As suggested by one Bart van den Eijden (OSGIS), it would be nice if the user had the ability to make the baselayer invisible (for a clean view of an overlay).

Use-Case from Bart in email to the users list:

displaying a thematic layer on top of a base layer (aerial photograph). To get a clearer view of the thematic map, it might help if someone can switch off the base layer, so the colours will come out clearer against a white background.

Also, it's what I am used to when using clients like Chameleon or Mapbuilder, but that's not the best of reasons ofcourse :-)

Change History

10/18/06 13:29:09 changed by euzuro

possible solution:

  • Add a [hide/show] toggle link after the "Base Layer" label in the layer switcher

10/18/06 14:12:29 changed by openlayers

The only distinction between the baselayer and a normal overlay layer is then that it is the lowest one in the stack. So this leads me to question the purpose of the distinction between a baselayer and an overlay layer ......

Thoughts?

Maybe then a more generic grouping of layers into themes would make more sense? Where you can group layers together in a topographic (basemap) theme, a roads theme etc.

Bart

10/25/06 06:19:17 changed by euzuro

Note that *any* layer can be shown/hidden through the layer.display() method.

04/05/07 14:09:40 changed by sderle

  • milestone set to 2.6 Release.

06/04/07 15:32:16 changed by openlayers

Possible workaround/solution:

Just add the following layer to your map...

var lyrBaseClear = new OpenLayers.Layer.Image(
	"None",
	'/path/to/clear.gif',
	new OpenLayers.Bounds(-180,-90,180,90),
	new OpenLayers.Size(8, 8),
	{isBaseLayer: true}
);

...where clear.gif is an 8 x 8 pixel transparent gif. You get a transparent base layer labelled "None" in your layer switcher. That works for me.

01/22/08 17:39:00 changed by crschmidt

  • state changed.
  • milestone changed from 2.6 Release to 2.7 Release.

Mass ticket move to 2.7 post dev meeting. If you are actively working on this task, please update this ticket with information and change the milestone to 2.6. At the time of the next IRC meeting (most likely 1-31-08), this will mean the ticket can *not* be brought back into 2.6 unless there is further feedback.

07/02/08 02:41:43 changed by euzuro

  • milestone changed from 2.7 Release to 3.0 Release.

No one has touched this in a while, which leads me to believe that one or the other of the two suggested workarounds here is "good enough" to get around this limitation.

It sounds like maybe we should reconsider the baselayer/overlay distinction... which is prime 3.0 material, in my mind.

If anyone is screaming to have this fixed, please move it back.