[Google Maps Library] Google Maps Mobile (React) - Client actions is not public

Forge Component
(24)
Published on 26 Feb by Labs
24 votes
Published on 26 Feb by Labs

Why are the client actions of this component all not public? If you need actions that are already defined in the component, shouldn't you be able to instantiate them (for example centering the map on a point)? Currently the component as it is, obliges me to clone the actions or to clone the module itself.

Hi Luis

some client actions are not public in this. But if you really required them then can clone actions. If you have many client actions which you want to use directly then copy the module directly.

But when you will clone the plugin, you will not be able to get further update on this plugin. 

Thanks.

Luis,

I noticed the same thing about the component, but I think the idea is that you use the webblock to be able to control the things that are done in the client actions.  Because of the On Parameters Changed event, the web block will fire those actions when necessary anytime you change a parameter.  For example, change the lat/lng in the web block for the center, and the Map SetCenter action will fire.  Change the zoom level in the web block, and the SetZoom action will fire.  Add a Marker to your array, and the AddMarker action will fire.  Those actions don't need to be public, because they are all controlled by the parameters in the web block.

That said, if you want to expose them, you are free to just set the public property of each action to Yes and republish the component without actually cloning the component.  However, I would advise to use caution with this, as you don't want the block parameters to get out of sync with what you are executing in the actions.  It could potentially lead to some unexpected behavior.  Hopefully this helps.