[OpenLayers-Users] Setting a renderer after a vector layer's, construction

Mike Ryan mr at mry4n.net
Tue Jul 10 14:51:35 PDT 2012


Hi,

I don't think you need to worry about changing the renderer. See if this 
makes sense.

features is a property of a Vector layer:

http://dev.openlayers.org/releases/OpenLayers-2.12/doc/apidocs/files/OpenLayers/Layer/Vector-js.html#OpenLayers.Layer.Vector.features

In other words vectorLayer.features will return the array of the 
features you want.

When you create the new cloned layer, create it with the renderer option 
set to "Canvas" then add features.

clonedLayer = new OpenLayers.Layer.Vector("Cloned Vector", {renderer: 
"Canvas", features: vectorLayer.features});

Or something like that, anyway.

-Mike


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120710/e9099278/attachment.html>


More information about the Users mailing list