<div dir="ltr">Try moving the dispatch to the query method. The Services don't expose the full react-component cycle yet.</div><br><div class="gmail_quote"><div dir="ltr">On Fri, Aug 31, 2018 at 11:21 AM Reynolds, Michael J. (MNIT) <<a href="mailto:mike.reynolds@state.mn.us">mike.reynolds@state.mn.us</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div class="m_-6267656021832917658WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">I tucked that into a search service resultsAsHtml function but that resulted in the pesky<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Warning: Cannot update during an existing state transition (such as within `render` or another component's constructor). Render methods should be a pure function
 of props and state; constructor side-effects are an anti-pattern, but can be moved to `componentWillMount`.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Do I use app.registerAction and app.startAction instead? Or should I use app.dispatch from some other service location?<u></u><u></u></span></p>
<p class="MsoNormal"><a name="m_-6267656021832917658__MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></a></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Dan Little [mailto:<a href="mailto:theduckylittle@gmail.com" target="_blank">theduckylittle@gmail.com</a>]
<br>
<b>Sent:</b> Friday, August 31, 2018 10:22 AM<br>
<b>To:</b> Reynolds, Michael J. (MNIT) <<a href="mailto:mike.reynolds@state.mn.us" target="_blank">mike.reynolds@state.mn.us</a>><br>
<b>Cc:</b> GeoMOOSE Users List <<a href="mailto:geomoose-users@lists.osgeo.org" target="_blank">geomoose-users@lists.osgeo.org</a>><br>
<b>Subject:</b> Re: [Geomoose-users] Toggle or Turn A Layer On or Off Programmatically from an Action or Service<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">This is the ugly answer:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">app.dispatch({type: "MAPSOURCE_LAYER_VIS", mapSourceName: 'source', layerName: 'layer', on: true});<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">We should write a wrapper function to make that easier.<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Thu, Aug 30, 2018 at 9:02 AM Reynolds, Michael J. (MNIT) <<a href="mailto:mike.reynolds@state.mn.us" target="_blank">mike.reynolds@state.mn.us</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">Looking for the object and method that will toggle a layer visibility from an Action or Service.<br>
<br>
I didn't see examples within the docs or existing services/actions.<br>
<br>
On a related note, the geomoose search service, doesn't seem to turn on the layer being searched.  It shows a results layer but along with it, we'd like to have the  whole layer appear as reference.  Do we have our search configured wrong?<br>
_______________________________________________<br>
Geomoose-users mailing list<br>
<a href="mailto:Geomoose-users@lists.osgeo.org" target="_blank">Geomoose-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/geomoose-users" target="_blank">https://lists.osgeo.org/mailman/listinfo/geomoose-users</a><u></u><u></u></p>
</blockquote>
</div>
</div>
</div>

</blockquote></div>