<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2013/6/18 <a href="mailto:mail.roliveira@gmail.com">mail.roliveira@gmail.com</a> <span dir="ltr"><<a href="mailto:mail.roliveira@gmail.com" target="_blank">mail.roliveira@gmail.com</a>></span><br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br><br>I'm trying to create a vector layer. My code is quite similar to the source code in:<br>

<br><a href="http://openlayers.org/dev/examples/select-feature-multilayer.html?renderer=Canvas" target="_blank">http://openlayers.org/dev/examples/select-feature-multilayer.html?renderer=Canvas</a><br><br>However, I notice that the renderer=Canvas (url parameter) is not being used, because features are created using svg (inspecting with firebug)<br>

</blockquote><div><br></div><div><br></div><div style>If you check the source codes in the link you mentioned you will find this:</div><div style><br></div><div style><div><i>            // allow testing of specific renderers via "?renderer=Canvas", etc</i></div>

<div><i>            var renderer = OpenLayers.Util.getParameters(window.location.href).renderer;</i></div><div><i>            renderer = (renderer) ? [renderer] : OpenLayers.Layer.Vector.prototype.renderers;</i></div></div>

<div> </div><div style>This is how the example get the renderer from the url.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br>Here is my code for the layer creation:<br><br>var layer_style = new OpenLayers.StyleMap({<br>                <span>    </span>"default": new OpenLayers.Style(OpenLayers.Util.applyDefaults({fillColor: "red",strokeColor: "gray",rotation: 45,pointRadius: 15}, OpenLayers.Feature.Vector.style["default"])),<br>

                <span>    </span>"select": new OpenLayers.Style(OpenLayers.Util.applyDefaults({graphicName: "square", rotation: 45, pointRadius: 30}, OpenLayers.Feature.Vector.style["select"]))<br>

            })<br><br>var vectorLayer = new OpenLayers.Layer.Vector("vLayer", {<br>                                 <span>    </span>styleMap: layer_style,<br>                                   <span>    </span>renderers: ["Canvas"]<br>                                  });<br><br></blockquote>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">map.addLayer(vectorLayer);<div><br></div><div>I also notice that the options passed on the vector layer instantiation apparently don't mach the documentation:</div>

<div><a href="http://dev.openlayers.org/releases/OpenLayers-2.12/doc/apidocs/files/OpenLayers/Layer/Vector-js.html" target="_blank">http://dev.openlayers.org/releases/OpenLayers-2.12/doc/apidocs/files/OpenLayers/Layer/Vector-js.html</a><br>

<div><br></div><div>I'm using FF12, Chrome <span style="font-size:medium;font-family:monospace">22.0.1229.94</span></div><div><font face="monospace" size="3">Openlayers 2.12<br></font><br><div>Sent from Alto - <a href="http://altomail.com" target="_blank">altomail.com</a></div>

</div></div><br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
<br></blockquote></div><br></div></div>