本文整理汇总了C#中FeatureLayer.LoadAsync方法的典型用法代码示例。如果您正苦于以下问题:C# FeatureLayer.LoadAsync方法的具体用法?C# FeatureLayer.LoadAsync怎么用?C# FeatureLayer.LoadAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FeatureLayer
的用法示例。
在下文中一共展示了FeatureLayer.LoadAsync方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
private async void Initialize()
{
// Create new Map with basemap
Map myMap = new Map(BasemapType.Topographic, 34.056, -117.196, 4);
// Create uri to the used feature service
var serviceUri = new Uri(
"http://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0");
// Initialize a new feature layer
ServiceFeatureTable myFeatureTable = new ServiceFeatureTable(serviceUri);
FeatureLayer myFeatureLayer = new FeatureLayer(myFeatureTable);
// Make sure that the feature layer gets loaded
await myFeatureLayer.LoadAsync();
// Add the feature layer to the Map
myMap.OperationalLayers.Add(myFeatureLayer);
// Provide used Map to the MapView
_myMapView.Map = myMap;
// Hook up the DrawStatusChanged event
_myMapView.DrawStatusChanged += OnMapViewDrawStatusChanged;
// Animate the activity spinner
_activityIndicator.StartAnimating();
}
示例2: Initialize
private async void Initialize()
{
// Create new Map with basemap
Map myMap = new Map(Basemap.CreateTopographic());
// Create a mappoint the map should zoom to
MapPoint mapPoint = new MapPoint(-13630484, 4545415, SpatialReferences.WebMercator);
// Set the initial viewpoint for map
myMap.InitialViewpoint = new Viewpoint(mapPoint, 90000);
// Provide used Map to the MapView
_myMapView.Map = myMap;
// Create the uri for the feature service
Uri featureServiceUri = new Uri("https://sampleserver6.arcgisonline.com/arcgis/rest/services/SF311/FeatureServer/0");
// Initialize feature table using a url to feature server url
ServiceFeatureTable featureTable = new ServiceFeatureTable(featureServiceUri);
// Initialize a new feature layer based on the feature table
_featureLayer = new FeatureLayer(featureTable);
// Load the layer
await _featureLayer.LoadAsync();
// Check for the load status. If the layer is loaded then add it to map
if (_featureLayer.LoadStatus == Esri.ArcGISRuntime.LoadStatus.Loaded)
{
//Add the feature layer to the map
myMap.OperationalLayers.Add(_featureLayer);
}
}
示例3: Initialize
private async void Initialize()
{
// Create new Map with basemap
var myMap = new Map(Basemap.CreateTopographic());
// Create envelope to be used as a target extent for map's initial viewpoint
Envelope myEnvelope = new Envelope(
-1131596.019761, 3893114.069099, 3926705.982140, 7977912.461790,
SpatialReferences.WebMercator);
// Set the initial viewpoint for map
myMap.InitialViewpoint = new Viewpoint(myEnvelope);
// Provide used Map to the MapView
_myMapView.Map = myMap;
// Create Uri for the feature service
Uri featureServiceUri = new Uri(
"http://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0");
// Initialize feature table using a url to feature server url
var featureTable = new ServiceFeatureTable(featureServiceUri);
// Initialize a new feature layer based on the feature table
_featureLayer = new FeatureLayer(featureTable);
// Set the selection color for feature layer
_featureLayer.SelectionColor = Color.Cyan;
// Set the selection width
_featureLayer.SelectionWidth = 3;
// Make sure that used feature layer is loaded before we hook into the tapped event
// This prevents us trying to do selection on the layer that isn't initialized
await _featureLayer.LoadAsync();
// Check for the load status. If the layer is loaded then add it to map
if (_featureLayer.LoadStatus == Esri.ArcGISRuntime.LoadStatus.Loaded)
{
// Add the feature layer to the map
myMap.OperationalLayers.Add(_featureLayer);
// Add tap event handler for mapview
_myMapView.GeoViewTapped += OnMapViewTapped;
}
}
示例4: Initialize
private async void Initialize()
{
// Create new Map with basemap
Map myMap = new Map(Basemap.CreateTopographic());
// Create and set initial map area
Envelope initialLocation = new Envelope(
-1.30758164047166E7, 4014771.46954516, -1.30730056797177E7, 4016869.78617381,
SpatialReferences.WebMercator);
// Set the initial viewpoint for map
myMap.InitialViewpoint = new Viewpoint(initialLocation);
// Provide used Map to the MapView
_myMapView.Map = myMap;
// Create uri to the used feature service
var serviceUri = new Uri(
"http://sampleserver6.arcgisonline.com/arcgis/rest/services/PoolPermits/FeatureServer/0");
// Initialize feature table using a url to feature server url
ServiceFeatureTable featureTable = new ServiceFeatureTable(serviceUri);
// Initialize a new feature layer based on the feature table
_featureLayer = new FeatureLayer(featureTable);
// Make sure that the feature layer gets loaded
await _featureLayer.LoadAsync();
// Check for the load status. If the layer is loaded then add it to map
if (_featureLayer.LoadStatus == Esri.ArcGISRuntime.LoadStatus.Loaded)
{
// Add the feature layer to the map
myMap.OperationalLayers.Add(_featureLayer);
}
}