<p>Hi,</p>
<p>What do you mean by 2. and 3.? You should call layer.redraw(true) to reload the layer.</p>
<p>If you do so, then you may be running into <a href="http://trac.geoext.org/ticket/406">http://trac.geoext.org/ticket/406</a>, which is fixed on trunk already, but was broken in 1.0.</p>
<p>Regards,<br>
Andreas.</p>
<p><blockquote type="cite">Am 15.02.2011 03:29 schrieb "Chris Kelley" <<a href="mailto:iamchriskelley@gmail.com">iamchriskelley@gmail.com</a>>:<br><br>Hi,<div><br></div><div>This is my first post to the GeoExt Users forum. The short question is whether you can manually trigger a legendpanel refresh or update event in javascript. The explanation is provided below.</div>
<div>
<br></div><div>Explanation:</div><div>I have a webpage that includes a GeoExt mappanel and legendpanel that pull information from a geoserver instance on the same machine, and works perfectly for layers with static styles. I've added a form and some PHP scripts (called via AJAX) to allow the user to update the SLD file (e.g. changing the color scheme). The mappanel worked fine after adding layer.redraw(true). I don't know how to force a legendpanel update, and furthermore the legendpanel currently shows some unwanted caching. </div>
<div><br></div><div>As an example:</div><div>1. I load a map at a given zoom level</div><div>2. I trigger a server-side redraw of the SLD (using the Geoserver Rest API)</div><div>3. The webpage correctly redraws the map with the new SLD</div>
<div>4. I zoom further in on the map, and the legendpanel updates properly</div><div>5. I zoom back to the zoom level I was at when the SLD was updated, and the legend REVERTS to the previous legend (although the map continues to render properly).</div>
<div><br></div><div>I'd appreciate any help with this. Let me know if it requires any further explanation.</div><div><br></div><div>Best,</div><div>Chris</div><font color="#888888"><div><br></div>
</font><br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@geoext.org">Users@geoext.org</a><br>
<a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></p>