Hi Eric,<br><br>No...it is not working yet. There is some improvement indeed: I can see now the selection style, but vertexes are still not editable.<br><br>I have tried to adapt the suggestion in post I have mentioned earlier. <br>
<br><span style="color: rgb(0, 0, 102);">var styleMap = new OpenLayers.StyleMap(); </span><br style="color: rgb(0, 0, 102);"><br style="color: rgb(0, 0, 102);"><span style="color: rgb(0, 0, 102);">var rules = [new OpenLayers.Rule({</span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);">symbolizer: template, </span><br style="color: rgb(0, 0, 102);"><span style="color: rgb(0, 0, 102);">elseFilter: true</span><br style="color: rgb(0, 0, 102);"><span style="color: rgb(0, 0, 102);">})];</span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);">styleMap.styles["default"].addRules(rules); </span><br><br>Using this the edit polygon works!!!. However, I did not figured out how to include "context" within this. Select style is also not visible (but I do not mind this, I can most probably find a work around for selection style).<br>
<br>Initially I have used:<br><span style="color: rgb(0, 0, 153);">var mystyle = new OpenLayers.Style(template, {context: context}); </span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">var styleMap = new OpenLayers.StyleMap(mystyle); </span><br>
And context worked fine.<br><br>Any hints on how to include context with rules?<br><br>Thank you,<br>Adorian<br><br><br><br><div class="gmail_quote">On Thu, Dec 4, 2008 at 5:58 PM, Eric Lemoine <span dir="ltr"><<a href="mailto:eric.c2c@gmail.com">eric.c2c@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello<br>
<br>
Try:<br>
<br>
new OpenLayers.StyleMap({<br>
"default": yourStyle<br>
});<br>
<br>
Hope this helps,<br>
<br>
Eric<br>
<br>
2008/12/4, Adorian Ardelean <<a href="mailto:mynature@gmail.com">mynature@gmail.com</a>>:<br>
<div><div></div><div class="Wj3C7c">> Hi again,<br>
><br>
> I have eliminated also the context for style as a source of problem for the<br>
> modifyFeature control not working. So it seems that just by specifying a<br>
> styleMap as option when declaring the vector layer makes the modifyFeature<br>
> control not functional.<br>
><br>
> var template = {<br>
> fillOpacity: 0.6,<br>
> fillColor: "red",<br>
> strokeColor:"orange",<br>
> strokeWidth:"1"<br>
> };<br>
><br>
> var mystyle = new OpenLayers.Style(template);<br>
><br>
> var regions = new OpenLayers.Layer.Vector("regions",{extractAttributes:true,<br>
> format: OpenLayers.Format.GeoJSON, projection: new<br>
> OpenLayers.Projection("EPSG:4326"), styleMap: new<br>
> OpenLayers.StyleMap(mystyle)});<br>
><br>
><br>
> I think the solution might be somewhere in the post:<br>
> StyleMap and ModifyFeatures aren't compatible ?I will give it a try.<br>
><br>
> All the best,<br>
> Adorian<br>
><br>
><br>
> Dr. Adorian Ardelean<br>
> coordinator of myNature Project<br>
><br>
> <a href="http://mybiosis.info/nature/portal.php?pagename=firstpage" target="_blank">http://mybiosis.info/nature/portal.php?pagename=firstpage</a> [a Romanian<br>
> biodiversity-database]<br>
> <a href="http://mybiosis.info/nature/portal.php?pagename=adorian" target="_blank">http://mybiosis.info/nature/portal.php?pagename=adorian</a> [CV]<br>
><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Dr. Adorian Ardelean<br>coordinator of myNature Project<br><br>proiectul myNature<br>str. Rascoala din 1907 nr 12<br>Timisoara 300523<br>Romania<br><br><a href="http://mybiosis.info/nature/portal.php?pagename=firstpage">http://mybiosis.info/nature/portal.php?pagename=firstpage</a> [a Romanian biodiversity-database]<br>
<a href="http://mybiosis.info/nature/portal.php?pagename=adorian">http://mybiosis.info/nature/portal.php?pagename=adorian</a> [CV]<br><br><br>Projects in which I was involved:<br><a href="http://hercules.kgs.ku.edu/Hexacoral/Anemone2/">http://hercules.kgs.ku.edu/Hexacoral/Anemone2/</a> [Hexacorallians of the World]<br>
<a href="http://www.ubio.org">http://www.ubio.org</a> [uBio Project]<br><a href="http://portal.ubio.org">http://portal.ubio.org</a> [uBio Portal]<br><a href="http://microscope.mbl.edu">http://microscope.mbl.edu</a> [micro*scope Project]<br>
<a href="http://starcentral.mbl.edu/biopedia">http://starcentral.mbl.edu/biopedia</a> [BioPedia]<br><a href="http://starcentral.mbl.edu/custar">http://starcentral.mbl.edu/custar</a> [CU*STAR]<br><a href="http://planktonnet.awi.de/index.php">http://planktonnet.awi.de/index.php</a> [planktonNet]<br>
<br>Yahoo messenger: transylvaniasan<br>