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
var layer =newatlas.layer.SimpleDataLayer(datasource);
64
+
map.layers.add(layer);
65
+
66
+
//Load an initial data set.
67
+
constdataSet= {
68
+
type:"FeatureCollection",
69
+
bbox: [0, 0, 0, 0],
70
+
features: [
71
+
{
72
+
type:"Feature",
73
+
geometry: {
74
+
type:"Point",
75
+
coordinates: [0, 0]
76
+
},
77
+
properties: {
78
+
color:"red"
79
+
}
80
+
}
81
+
]
82
+
};
83
+
84
+
loadDataSet(dataSet);
85
+
86
+
functionloadDataSet(r) {
87
+
//Update the features in the data source.
88
+
datasource.setShapes(r);
89
+
90
+
//If bounding box information is known for data, set the map view to it.
91
+
if (r.bbox) {
92
+
map.setCamera({
93
+
bounds:r.bbox,
94
+
padding:50
95
+
});
96
+
}
97
+
}
98
+
});
95
99
}
96
-
});
97
-
}
100
+
</script>
98
101
```
99
102
100
103
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.
@@ -114,10 +117,6 @@ This sample code renders the point feature using the simple data layer, and appe
0 commit comments