<div dir="ltr">Hi all,<div><br></div><div>I am having one trouble and I don't know what else to do. </div><div><br></div><div>I have my map and I have develop some javascript code that is working fine. </div><div>What happened this weekend is that I developed a function that had that some layers in the beginning:</div>
<div><br></div><div><br></div><div><div>var myStyle128684655922811250 = new OpenLayers.StyleMap({fillOpacity: 0.5});var rules128684655922811250 = {0: {fillColor: '#ffffff', fillOpacity:0.5} }; </div><div><br></div>
<div>myStyle128684655922811250.addUniqueValueRules('default', 'type', rules128684655922811250);</div><div><br></div><div>var layer128684655922811250 = new OpenLayers.Layer.GML('mercury layer', '../GML/glmush55qv3web45ak21mhrf128684655922811250.xml',{styleMap: myStyle128684655922811250} ); </div>
<div><br></div><div>map.addLayer(layer128684655922811250);</div><div><br></div><div><br></div></div><div>and this is working fine. What is really funny is that the following code only works if the code above is outside a function. If the code above is inside the init() function then this code don't work:</div>
<div><div><br></div><div>//// REMOVE THE LAYER</div><div>map.removeLayer(layer128684657963905000);</div><div>layer128684657963905000.destroy();</div></div><div><br></div><div><br></div><div>Why??? Anybody knows why??????</div>
<div><br></div><div>Thanks</div><div><br></div><div>Best,</div><div><br>Carlos</div></div>