Skip to content

Commit 93ae18e

Browse files
committed
Embed the csv data to the source code since the data is not that large.
1 parent 3fa3695 commit 93ae18e

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

articles/azure-maps/spatial-io-add-simple-data-layer.md

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,18 @@ function InitMap()
6363
map.layers.add(layer);
6464

6565
//Load an initial data set.
66-
loadDataSet('{Your-Data-Source-File}');
66+
const dataSet = {
67+
"type": "Feature",
68+
"geometry": {
69+
"type": "Point",
70+
"coordinates": [0, 0]
71+
},
72+
"properties": {
73+
"color": "red"
74+
}
75+
};
76+
77+
loadDataSet(dataSet);
6778

6879
function loadDataSet(url) {
6980
//Read the spatial data and add it to the map.
@@ -86,21 +97,6 @@ function InitMap()
8697
}
8798
```
8899

89-
The _initial data set_ passed to the `loadDataSet` function in this example points to the following json:
90-
91-
```json
92-
{
93-
"type": "Feature",
94-
"geometry": {
95-
"type": "Point",
96-
"coordinates": [0, 0]
97-
},
98-
"properties": {
99-
"color": "red"
100-
}
101-
}
102-
```
103-
104100
Once you add features to the data source, the simple data layer figures out how best to render them. Styles for individual features can be set as properties on the feature.
105101

106102
The above sample code shows a GeoJSON point feature with a `color` property set to `red`.

0 commit comments

Comments
 (0)