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.rolive...@gmail.com<mail.rolive...@gmail.com>
To: <openlayers-users@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
_______________________________________________
Users mailing list
us...@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to