|
1 | | -## Data Sources |
2 | | - |
3 | | -Most of the layers require `data sources` to read their data from. A data source needs to be added on the `Map` and its ID needs needs to be provided on the options of the layer. It does not matter if the data source or the layer is added first, the layer being refreshed whenever the data source changes. |
| 1 | +A data source manages raw location data in GeoJSON format locally. Good for small to medium data sets (upwards of hundreds of thousands of shapes). |
4 | 2 |
|
5 | 3 | ## Adding geometries |
6 | 4 |
|
@@ -31,7 +29,7 @@ You can add geometry on a data source using the `AddAsync` method. |
31 | 29 | { |
32 | 30 | const string dataSourceId = "bubbleDataSource"; |
33 | 31 | var dataSource = new AzureMapsControl.Components.Data.DataSource(dataSourceId); |
34 | | - await events.Map.AddDataSourceAsync(dataSource); |
| 32 | + await events.Map.AddSourceAsync(dataSource); |
35 | 33 |
|
36 | 34 |
|
37 | 35 | var geometries = new List<AzureMapsControl.Components.Atlas.Geometry>(); |
@@ -80,7 +78,7 @@ You can import data on the data source using the `ImportDataFromUrlAsync` method |
80 | 78 | { |
81 | 79 | const string dataSourceId = "heatmapDataSource"; |
82 | 80 | var dataSource = new AzureMapsControl.Components.Data.DataSource(dataSourceId); |
83 | | - await events.Map.AddDataSourceAsync(dataSource); |
| 81 | + await events.Map.AddSourceAsync(dataSource); |
84 | 82 | await dataSource.ImportDataFromUrlAsync("https://services1.arcgis.com/0MSEUqKaxRlEPj5g/arcgis/rest/services/ncov_cases/FeatureServer/1/query?where=1%3D1&f=geojson&outFields=*"); |
85 | 83 |
|
86 | 84 | var layer = new AzureMapsControl.Components.Layers.HeatmapLayer |
@@ -111,8 +109,4 @@ Geometries can be removed from the data source using the `RemoveAsync` method. |
111 | 109 |
|
112 | 110 | ## Clear the data source |
113 | 111 |
|
114 | | -The data source can be cleared using the `ClearAsync` method. This will remove all the geometries from the data source. |
115 | | - |
116 | | -## Removing the data source |
117 | | - |
118 | | -A data source can be removed from the map using the `RemoveDataSourceAsync` method. A call to `ClearDataSourcesAsync` removes all the data sources from the map. |
| 112 | +The data source can be cleared using the `ClearAsync` method. This will remove all the geometries from the data source. |
0 commit comments