The Spectrum Spatial Analyst extensibility platform envisages cases where more than one
instance of newly created angular 11 third-party components need to be on-boarded.
There can be cases where multiple instances of the new component may need to share
the same set of information. For example, a developer may create a new component
that shows Google Street View that is shown in multiple instances and needs to share
the API key for Google between them. The Spectrum Spatial Analyst extensibility
platform supports parameter sharing using the init parameters among multiple
component instances. To get access to the init parameter, the developer needs to:
- Declare an input field called data in its component.
- Add an entry corresponding to the component in
CustomAnalystModuleConfig.json. For example:
"modules": [{ "name": "GIQueryModule", Spectrum Spatial Analyst Extensibility Guide v.2019.1 26 "description": "Module For GI query", "modulePath": "../../../extensions/dynamic.module.ts#DynamicModule", "components":[{componentName:"TestComponent","parentComponentName": "SettingsPanel", "initParameters": { "apiKey": “abcdef” } }}] }]
- Once this is declared in CustomAnalystModuldeConfig.json one can access the key like data.initParameters.apiKey in the component instance.
The init parameter supports the data types that JavaScript supports. It does not put restrictions on the size of the parameters supplied.