<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>this is how I do it:</div>
<div>AJAX request:</div>
<div>open the session map set the visibility of the layer and possibly the groups recursively to true, save the session map.</div>
<div>After response: refresh the map.</div>
<div>This works with the fusion viewer.</div>
<div><br/>
But in the legend of the react layout the layer remains not visible (not checked) and the next request GETDYNAMICMAPOVERLAY contains this layerid in the parameter hidelayers.</div>
<div>
<div>so my idea was toggle the checkbox in the legend but don't no how.</div>
<div>setLayerVisibility(layerid, true) or setLayerVisibility(mapname, {id: layerid, value: true}) both don't work.</div>
<div>
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b> Montag, 05. Juli 2021 um 19:49 Uhr<br/>
<b>Von:</b> "Gordon Luckett" <gordon.luckett@arrowgeomatics.com><br/>
<b>An:</b> "MapGuide Users Mail List" <mapguide-users@lists.osgeo.org><br/>
<b>Betreff:</b> Re: [mapguide-users] React Layout - set layer visibility</div>
<div name="quoted-content">
<div>Normally I would call the server side request to toggle the layer visibility with a javascript ajax call
<div> and then just use javascript to refresh the map without reloading the page.
<div> </div>
<div> </div>
</div>
</div>
<div class="gmail_quote">
<div class="gmail_attr">On Mon, Jul 5, 2021 at 4:47 PM Svlad <<a href="mailto:svlad.cjelli42@web.de" onclick="parent.window.location.href='mailto:svlad.cjelli42@web.de'; return false;" target="_blank">svlad.cjelli42@web.de</a>> wrote:</div>
<blockquote class="gmail_quote" style="margin: 0.0px 0.0px 0.0px 0.8ex;border-left: 1.0px solid rgb(204,204,204);padding-left: 1.0ex;">
<div>
<div style="font-family: Verdana;font-size: 12.0px;">
<div>Hi, how can I programmatically change the visibility of a layer?</div>
<div>I modified and saved the map on server side but the viewer allways sends "hidelayers= layerid" in the request.</div>
<div>Is it possible top change the visibility on the client side?</div>
<div>Thanks svlad</div>
<div> </div>
</div>
</div>
_______________________________________________<br/>
mapguide-users mailing list<br/>
<a href="mailto:mapguide-users@lists.osgeo.org" onclick="parent.window.location.href='mailto:mapguide-users@lists.osgeo.org'; return false;" target="_blank">mapguide-users@lists.osgeo.org</a><br/>
<a href="https://lists.osgeo.org/mailman/listinfo/mapguide-users" target="_blank">https://lists.osgeo.org/mailman/listinfo/mapguide-users</a></blockquote>
</div>
_______________________________________________ mapguide-users mailing list mapguide-users@lists.osgeo.org <a href="https://lists.osgeo.org/mailman/listinfo/mapguide-users" target="_blank">https://lists.osgeo.org/mailman/listinfo/mapguide-users</a></div>
</div>
</div>
</div></div></body></html>