You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-maps/spatial-io-add-simple-data-layer.md
+12-16Lines changed: 12 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,18 @@ function InitMap()
63
63
map.layers.add(layer);
64
64
65
65
//Load an initial data set.
66
-
loadDataSet('{Your-Data-Source-File}');
66
+
constdataSet= {
67
+
"type":"Feature",
68
+
"geometry": {
69
+
"type":"Point",
70
+
"coordinates": [0, 0]
71
+
},
72
+
"properties": {
73
+
"color":"red"
74
+
}
75
+
};
76
+
77
+
loadDataSet(dataSet);
67
78
68
79
functionloadDataSet(url) {
69
80
//Read the spatial data and add it to the map.
@@ -86,21 +97,6 @@ function InitMap()
86
97
}
87
98
```
88
99
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
-
104
100
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.
105
101
106
102
The above sample code shows a GeoJSON point feature with a `color` property set to `red`.
0 commit comments