<p style="margin: 0px; padding: 0px;">Add another behavior..If add a new line with :</p><p style="margin: 0px; padding: 0px;"><br></p><p style="margin: 0px; padding: 0px;">control = new OpenLayers.Control.DrawFeature(layer_line,<br> OpenLayers.Handler.Path);<br></p><p style="margin: 0px; padding: 0px;">i can see it with the as described in style_line.Any suggestion?</p><p style="margin: 0px; padding: 0px;"><br></p><p style="margin: 0px; padding: 0px;">Thanks</p><p style="margin: 0px; padding: 0px;"><br></p><p style="margin: 0px; padding: 0px;">Francesco<br></p><p style="margin: 0px; padding: 0px;"><br></p><p style="margin: 0px; padding: 0px;"><br></p>
<blockquote>
----Messaggio originale----<br>
Da: francescoboccacci@libero.it<br>
Data: 16/03/2012 14.33<br>
A: <openlayers-dev@lists.osgeo.org><br>
Ogg: [OpenLayers-Dev] Features not visible<br>
<br>
<p style="margin: 0px; padding: 0px;" mce_style="margin: 0px; padding: 0px;">Hi all, <br></p><p style="margin: 0px; padding: 0px;" mce_style="margin: 0px; padding: 0px;"><br></p><p style="margin: 0px; padding: 0px;" mce_style="margin: 0px; padding: 0px;">I wrote this code to get data from a Geojson :<br></p><p style="margin: 0px; padding: 0px;" mce_style="margin: 0px; padding: 0px;"><br></p><p style="margin: 0px; padding: 0px;" mce_style="margin: 0px; padding: 0px;"> var saveStrategy = new OpenLayers.Strategy.Save();<br> saveStrategy.events.register('success', null, saveSuccess);<br> saveStrategy.events.register('fail', null, saveFail);<br></p><p style="margin: 0px; padding: 0px;" mce_style="margin: 0px; padding: 0px;"><br></p><p style="margin: 0px; padding: 0px;" mce_style="margin: 0px; padding: 0px;">var style_line = new OpenLayers.StyleMap({<br> "default": new OpenLayers.Style(OpenLayers.Util.applyDefaults({<br> <br> strokeWidth: 3,<br> strokeColor: "green",<br> pointRadius: 3<br> }, OpenLayers.Feature.Vector.style["default"])),<br> "select": new OpenLayers.Style(OpenLayers.Util.applyDefaults({<br> <br> strokeWidth: 3,<br> strokeColor: "red",<br> pointRadius: 2<br> }, OpenLayers.Feature.Vector.style["select"]))<br> });<br></p><p style="margin: 0px; padding: 0px;" mce_style="margin: 0px; padding: 0px;"><br></p><p style="margin: 0px; padding: 0px;" mce_style="margin: 0px; padding: 0px;">var myprotocol = new OpenLayers.Protocol.HTTP({<br> format: new OpenLayers.Format.GeoJSON(),<br> url: "/edit/data/Line",<br> params: {bbox: bb[0]+","+ bb[1]+"," + bb[2]+","+bb[3]}<br> <br> });<br> <br> <br><br> layer_line = new OpenLayers.Layer.Vector("Line", {<br> projection: "EPSG:4326",<br> strategies: [saveStrategy],<br> protocol:myprotocol,<br> styleMap: style_line<br><br> <br> });<br><br><br> layer_line.protocol.read({<br> <br> callback: function(resp) {<br> <br> <br> layer_line.addFeatures(resp.features);<br><br> }<br> });<br><br> map.addLayer(layer_line);</p><p style="margin: 0px; padding: 0px;" mce_style="margin: 0px; padding: 0px;"><br></p><p style="margin: 0px; padding: 0px;" mce_style="margin: 0px; padding: 0px;">In firebug i write command : layer_line.features.length and it show me a number. I think that it means that layer has feature but on map i can see the features. Where am i wrong?<br></p><p style="margin: 0px; padding: 0px;" mce_style="margin: 0px; padding: 0px;"><br></p><p style="margin: 0px; padding: 0px;" mce_style="margin: 0px; padding: 0px;"><br></p><p style="margin: 0px; padding: 0px;" mce_style="margin: 0px; padding: 0px;">Thanks</p><p style="margin: 0px; padding: 0px;" mce_style="margin: 0px; padding: 0px;"><br></p><p style="margin: 0px; padding: 0px;" mce_style="margin: 0px; padding: 0px;">Francesco<br></p><div style="position: absolute; left: -10000px; top: 953px; width: 1px; height: 1px; overflow: hidden;" id="_mcePaste"> </div><br>
</blockquote><p><br></p>