Skip to content

Instantly share code, notes, and snippets.

@martinoyovo
Created May 8, 2025 10:23
Show Gist options
  • Save martinoyovo/2e6051c0034745f30d9d9535d85738ae to your computer and use it in GitHub Desktop.
Save martinoyovo/2e6051c0034745f30d9d9535d85738ae to your computer and use it in GitHub Desktop.
Future<void> loadFeatureLayers() async {
final portal = Portal.arcGISOnline();
final item = PortalItem.withPortalAndItemId(
portal: portal,
itemId: '49e3861dd16d4b4abdadbb1acbf26bd8',
);
final bufferItem = PortalItem.withPortalAndItemId(
portal: portal,
itemId: 'ad36192fc08340cb877d31593e3ef204',
);
_pointFeatureLayer = FeatureLayer.withFeatureLayerItem(item);
_bufferFeatureLayer = FeatureLayer.withFeatureLayerItem(bufferItem);
await _pointFeatureLayer.load();
await _bufferFeatureLayer.load();
_pointFeatureLayer.isVisible = false;
_bufferFeatureLayer.isVisible = false;
_warningPointsTable = _pointFeatureLayer.featureTable;
_mapViewController.arcGISMap!.operationalLayers.addAll([
_bufferFeatureLayer,
_pointFeatureLayer,
]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment