We are using Geodatabase and GeodatabaseSyncTask classes from the SDK to download and synchronize feature layers. In the ArcGIS Online portal, we have defined the visualization of the feature layers we use (color, for instance). When the app is started with no internet connectivity, we load the feature layers from the geodatabase and add them onto a map, as operational layers. When creating an instance of GenerateGeodatabaseParameters, we set syncContingentValues, syncDimensions, syncAttributeRules and syncAnnotations to true.
Problem: Visualization settings are ignored if we load the map from the geodatabase file. No color settings at all. The default blue color is used to render the feature layers on the map.
Is it possible to load visualization attributes altogether with feature layer data when using the geodatabase? If not, what would be an alternative to achieve it?
When using the GeodatabaseSyncTask to download and sync feature layers from ArcGIS Online, it's important to understand that visualization settings (like symbology, renderers, and labeling) are not included in the geodatabase itself. The geodatabase stores the data, but not the map-specific styling that you see in the web map or feature service.
✅ Recommended Solution
The first-class approach for preserving both data and visualization is to use the Offline Map Task (e.g., via OfflineMapTask or by downloading a Mobile Map Package - MMPK). This method ensures that:
- All layer styling (colors, symbols, labels)
- Map configuration (basemaps, operational layers)
- And even pop-ups and bookmarks
...are preserved exactly as they appear online.
👉 Why Geodatabase Alone Doesn’t Work
When you generate a geodatabase (via GenerateGeodatabaseParameters or the REST createReplica endpoint), it only includes the raw feature data. It does not include:
- Renderers
- Label definitions
- Pop-up configurations
This is why, when loading layers from the geodatabase offline, you see default symbology (like the default blue symbols).
🛠 Workaround (Advanced)
If switching to MMPKs or Offline Maps isn't feasible, a workaround is to:
1. Capture the renderer JSON from the feature layer while online.
2. Store it locally.
3. When offline, deserialize the JSON into a Renderer and apply it manually to the feature layer.
This approach works, but it requires extra handling and may not support all styling nuances (e.g., complex label expressions or Arcade-based renderers).
Summary
- ✅ Use OfflineMapTask or MMPKs for full fidelity offline maps.
- 👉 Geodatabases alone do not carry styling.
- 🛠 Renderer JSON workaround is possible but limited.