Components and services have multiple ways of interacting with other components and services.
- When possible, interaction through commands and operations should be preferred, as this introduces the loosest coupling.
- When you need stronger coupling and direct access to a service, then dependency injection can be used to reference services.
If a component or service needs access to the ArcGIS MapView object powering the applications map, it can reference it through an
Interacting with the
Components or services can interact with the
MapView by injecting an
ILayoutModel that takes a
MapView. The actual
MapView needs to be resolved once the map component has loaded, so it's best practice to resolve the
ILayoutModel in the initialization method of the component or service.
A layout model is resolved according to the layout hierarchy.
Check out the relevant Geocortex Mobile SDK Samples: