Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#75 closed enhancement (fixed)

create an opacity slider

Reported by: bartvde Owned by: fredj
Priority: minor Milestone: 0.6
Component: GeoExt.LayerOpacitySlider Version:
Keywords: Cc:
State: Commit

Description

create a slider to change the opacity of a layer

Attachments (6)

75.0.patch (4.6 KB) - added by fredj 9 years ago.
fix the widget construction: accepts instances of OpenLayers.Layer, GeoExt.data.LayerRecord or GeoExt.tree.LayerNode
75.0.2.patch (13.1 KB) - added by fredj 9 years ago.
add an example and a slider tip, still needs some unit tests
75.0.3.patch (13.4 KB) - added by fredj 9 years ago.
add a delay option to the slider
75.0.4.patch (15.7 KB) - added by fredj 8 years ago.
wrong value if the initial opacity is 0.0
75.0.5.patch (16.9 KB) - added by fredj 8 years ago.
finish tests, update doc comments and example
75.0.6.patch (16.1 KB) - added by elemoine 8 years ago.

Download all attachments as: .zip

Change History (18)

comment:1 Changed 9 years ago by fredj

Hi Bart, I'm also working on that.

The slider will need to be informed when the layer opacity change, I've open a ticket for that http://trac.openlayers.org/ticket/2112

comment:2 Changed 9 years ago by bartvde

Hi Frederic, right but is there any chance that there will be multiple controls in an application changing the opacity of a layer? Only in that case the event will be necessary. Can you give me a use case of that?

comment:3 Changed 9 years ago by fredj

I agree that it would be unusual, be why not ?

Very first draft here: browser:/sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/LayerOpacitySlider.js

It would be nice if this slider is available on a layer node right click (in the tree); just like http://demo.mapfish.org/mapfishsample/trunk/examples/tree/tree_automatic.html

comment:4 Changed 9 years ago by fredj

the slider constructor must accept an OpenLayer.Layer or a GeoExt.data.LayerRecord as argument

comment:5 Changed 9 years ago by fredj

(In [944]) opacity slider (see #75)

Changed 9 years ago by fredj

fix the widget construction: accepts instances of OpenLayers.Layer, GeoExt.data.LayerRecord or GeoExt.tree.LayerNode

comment:6 Changed 9 years ago by fredj

  • Owner set to fredj

Changed 9 years ago by fredj

add an example and a slider tip, still needs some unit tests

comment:7 Changed 9 years ago by fredj

  • State changed from None to Needs more work
  • Type changed from task to enhancement

Changed 9 years ago by fredj

add a delay option to the slider

comment:8 Changed 8 years ago by yves

Line 101 of lib/GeoExt/widgets/LayerOpacitySlider.js in 75.0.3.patch, it should be

if (this.layer && this.layer.opacity != undefined && this.layer.opacity != null) {

Now it doesn't work if initial opacity == 0.

Changed 8 years ago by fredj

wrong value if the initial opacity is 0.0

Changed 8 years ago by fredj

finish tests, update doc comments and example

comment:9 Changed 8 years ago by fredj

  • State changed from Needs more work to Review

All tests pass on FF 3.5, please review.

Changed 8 years ago by elemoine

comment:10 Changed 8 years ago by elemoine

  • State changed from Review to Commit

75.0.6.patch changes the tests a bit and the API docs here and there, nothing serious. fredj, please commit if the final patch is for you.

comment:11 Changed 8 years ago by fredj

  • Resolution set to fixed
  • Status changed from new to closed

(In [1273]) Add an opacity slider with an optional slider tip, r=elemoine (closes #75)

comment:12 Changed 8 years ago by tschaub

  • Component changed from widgets to GeoExt.LayerOpacitySlider
Note: See TracTickets for help on using tickets.