[OpenLayers-Users] UPDATE: 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 08:39:18 PDT 2013


I also have a problem when zooming or panning the map.



                                var point = new OpenLayers.Geometry.Point(0,0)
;				var pointFeature = new OpenLayers.Feature.Vector(point,null);		
				
				
				vectorLayer.addFeatures([pointFeature])


;the pointFeature is not always  placed on the same place.


I'm using a google base layer and the map projection code is 4326

Sent from Alto - altomail.com


From: mail.roliveira at gmail.com<mail.roliveira at gmail.com>
To: <openlayers-users at lists.osgeo.org>
Sent: Tuesday, June 18, 2013
Subject: How to force a vector layer to use canvas instead of SVG?

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/8b3b37c4/attachment.html>


More information about the Users mailing list