Treating geometry as just another attribute
The first set geometry is considered the default. As an added bonus, we're back to a single argument constructor. Later, we could allow a schema to be set. This would be done before setting values (calling constructor with no args).
This commit is contained in:
@@ -22,11 +22,13 @@ var source = new ol.source.Vector({
|
||||
});
|
||||
|
||||
source.addFeatures([
|
||||
new ol.Feature(
|
||||
new ol.geom.LineString([[-10000000, -10000000], [10000000, 10000000]])),
|
||||
new ol.Feature(
|
||||
new ol.geom.LineString([[-10000000, 10000000], [10000000, -10000000]])),
|
||||
new ol.Feature(new ol.geom.Point([-10000000, 5000000]))
|
||||
new ol.Feature({
|
||||
g: new ol.geom.LineString([[-10000000, -10000000], [10000000, 10000000]])
|
||||
}),
|
||||
new ol.Feature({
|
||||
g: new ol.geom.LineString([[-10000000, 10000000], [10000000, -10000000]])
|
||||
},
|
||||
new ol.Feature({g: new ol.geom.Point([-10000000, 5000000])})
|
||||
]);
|
||||
|
||||
var vector = new ol.layer.Vector({
|
||||
|
||||
Reference in New Issue
Block a user