Custom components can already interface with much of the functionality in Geocortex Web through commands and operations. However, sometimes more direct access to the data structures that power components is needed.
This article will teach you how to inject the Map model into a custom component so you can directly access the Esri Map object and add a graphics layer to it.
- Download and setup the Geocortex Web SDK.
- Check out the deployment instructions to learn more about deploying custom code to a Geocortex Web App.
First, we will create a custom component that has an associated model.
To learn more about registering and using a component in the layout, check out the component reference
Next, we can inject the Map model, which is the type
MapExtension, into the component using the model injection pattern.
Finally, we can use the
MapExtension to add a custom graphics layer to the ArcGIS Map object.
Check out a live SDK sample that demonstrates injecting the map model into a component.
Learn more about Component Interactions
Learn more about how components interact with each other through models and services
Learn how Components are Bound to Models in the Layout
Learn how layout structure can be used to bind components to their required models