[OpenLayers-Users] How to force a vector layer to use canvas instead of SVG?

mail.roliveira at gmail.com mail.roliveira at gmail.com
Tue Jun 18 07:43:54 PDT 2013


Hi,

I'm trying to create a vector layer. My code is quite similar to the source code in:

http://openlayers.org/dev/examples/select-feature-multilayer.html?renderer=Canvas

However, I notice that the renderer=Canvas (url parameter) is not being used, because features are created using svg (inspecting with firebug)

Here is my code for the layer creation:

var layer_style = new OpenLayers.StyleMap({
                    "default": new OpenLayers.Style(OpenLayers.Util.applyDefaults({fillColor: "red",strokeColor: "gray",rotation: 45,pointRadius: 15}, OpenLayers.Feature.Vector.style["default"])),
                    "select": new OpenLayers.Style(OpenLayers.Util.applyDefaults({graphicName: "square", rotation: 45, pointRadius: 30}, OpenLayers.Feature.Vector.style["select"]))
            })

var vectorLayer = new OpenLayers.Layer.Vector("vLayer", {
					    styleMap: layer_style,
					    renderers: ["Canvas"]
					})

;map.addLayer(vectorLayer)


;I also notice that the options passed on the vector layer instantiation apparently don't mach the documentation:
http://dev.openlayers.org/releases/OpenLayers-2.12/doc/apidocs/files/OpenLayers/Layer/Vector-js.html



I'm using FF12, Chrome 22.0.1229.94
Openlayers 2.12

Sent from Alto - altomail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130618/283565a3/attachment.html>


More information about the Users mailing list