Did anyone ever tried using a "proper" object
as a Style context ?

What I'm trying to do is create a class of style
contexts and pass instances of them (for parametrized
styles) as a Style.context, but 'this', within the
callbacks, seem to always evaluate to the top of DOM.

Example code:

  MyContextClass = function(radius) {
        this.radius = radius;
  };
  
  MyContextClass.prototype.getRadius() {
        alert(this.radius);
  };
  
  myContext = new MyContextClass(4);
  
  myStyle = OpenLayers.Style(
        { pointRadius: '${getRadius)' },
        { context: myContext }
  );

--strk; 

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to