Forum Academy Marketplace Showcase Pricing Features

Assigning Values to Exposed States in Plug-ins

Hello, I am working on a map plugin. I have Element Actions to touch the map on different locations (those coordinates are saved to the instance.data). Then I have an Element Action to fill in a colored layer using those coordinates. I created an exposed state called layer where I want to be able to save the coordinates to the user so the layer is always there for them. How do I access those coordinates and return them only using the given function with properties and context? I can’t seem to save anything to context and then call it in this function.

Solved! Just in case anyone searches for answers. I figured out what my problem was. The box that appears with a function(properties, context) is only necessary for initially giving the exposed state a value. In order to change the value as new information is created you would do the instance.publishState('nameOfState', valueOfState). Every time the publish state code runs, it updates the value that the user can access.

Nice work!

And when you want to return an object I s a bit trickier but a similar setup. When you’re ready for that, cmon back!

I’ll make a quick vid showing how to return objects from client side plugins.