[OpenLayers-Users] OpenLayers.Control.Button with displayClass

Michael hedge h3xagon at web.de
Tue Oct 25 09:27:42 EDT 2011


Hello Developers,

this might be an easy question but i dont found it on this forum so here i
go:

i created a button with a function:

[CODE]
new OpenLayers.Control.Button({ 
              trigger: function() {  
                  if(this.box == null) {
                  	this.box = new OpenLayers.Handler.Box(control, {"done":
notice}); 
                  }
                  if(!activated) {
                  	activated = this.box.activate();
                  } else {
                  	this.box.deactivate();
                  	activated = false;
                  }
              },
         	  displayClass: "MyTest"
         })
[/CODE]

But on click on this button it wont change the icon. 

the initial load is with the inactive icon, which is correct, but on click
it should change to active icon, defined the same way.

This display class worked fine, when it changes a draw feature, for example:

[CODE]
new OpenLayers.Control.DrawFeature(layer,
		OpenLayers.Handler.Path,
		{'displayClass': 'MyTest'}),
[/CODE]

My Question is, why does it not work on buttons? 

And, if its just not supported by buttons, how can i call my own function
out of a toolbar but with full optical support like the "inactive-active"
thing?

Sorry for my bad english.

Regards

Michael

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/OpenLayers-Control-Button-with-displayClass-tp6928809p6928809.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list