[Geomoose-users] Toggle or Turn A Layer On or Off Programmatically from an Action or Service

Reynolds, Michael J. (MNIT) mike.reynolds at state.mn.us
Fri Aug 31 09:21:52 PDT 2018


I tucked that into a search service resultsAsHtml function but that resulted in the pesky
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`.

Do I use app.registerAction and app.startAction instead? Or should I use app.dispatch from some other service location?

From: Dan Little [mailto:theduckylittle at gmail.com]
Sent: Friday, August 31, 2018 10:22 AM
To: Reynolds, Michael J. (MNIT) <mike.reynolds at state.mn.us>
Cc: GeoMOOSE Users List <geomoose-users at lists.osgeo.org>
Subject: Re: [Geomoose-users] Toggle or Turn A Layer On or Off Programmatically from an Action or Service

This is the ugly answer:

app.dispatch({type: "MAPSOURCE_LAYER_VIS", mapSourceName: 'source', layerName: 'layer', on: true});

We should write a wrapper function to make that easier.

On Thu, Aug 30, 2018 at 9:02 AM Reynolds, Michael J. (MNIT) <mike.reynolds at state.mn.us<mailto:mike.reynolds at state.mn.us>> wrote:
Looking for the object and method that will toggle a layer visibility from an Action or Service.

I didn't see examples within the docs or existing services/actions.

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?
_______________________________________________
Geomoose-users mailing list
Geomoose-users at lists.osgeo.org<mailto:Geomoose-users at lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/geomoose-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geomoose-users/attachments/20180831/4e1eae40/attachment.html>


More information about the Geomoose-users mailing list