Hi list,

I am trying to use a custom renderer for a Vector Layer. However, if I 
interpret the code correctly, there is an issue there right now. Hopefully 
somebody can clarify if I am doing something wrong.

I am defining my layer in the following way:

    vectorLayer = new OpenLayers.Layer.Vector("Bekendmakingen", {
        styleMap: new OpenLayers.StyleMap({'default':{
            cssClass: "${category}"
        }}),
        renderer: new Geozet.Renderer.Anchor(),
        strategies: [new Geozet.Strategy.PrintList()]
    });

However, the constructor of the renderer normally gets the root div as the 
first argument, but since the vectorLayer has not yet been rendered, I cannot 
assign it as yet.

If I look in the Vector.js code I see in the initialize function:

        OpenLayers.Layer.prototype.initialize.apply(this, arguments);

        // allow user-set renderer, otherwise assign one
        if (!this.renderer || !this.renderer.supported()) {
            this.assignRenderer();
        }

So after the prototype initialize has been called, this.div is there, and I 
need to "assign' it to my custom renderer.

So I would expect:

Renderer to have a setContainer function, and the constructor of the Vector 
layer to use that function if a user-set renderer has been used.

TIA.

Best regards,
Bart
_______________________________________________
Dev mailing list
Dev@openlayers.org
http://openlayers.org/mailman/listinfo/dev

Reply via email to