Allow TopoJSON features with id equal to 0
This commit is contained in:
@@ -22,6 +22,16 @@ var aruba = {
|
||||
]
|
||||
};
|
||||
|
||||
var zeroId = {
|
||||
type: 'Topology',
|
||||
objects: {
|
||||
foobar: {
|
||||
type: 'Point',
|
||||
id: 0,
|
||||
coordinates: [0, 42]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
describe('ol.format.TopoJSON', function() {
|
||||
|
||||
@@ -60,6 +70,15 @@ describe('ol.format.TopoJSON', function() {
|
||||
]);
|
||||
});
|
||||
|
||||
it('can read a feature with id equal to 0', function() {
|
||||
var features = format.readFeaturesFromObject(zeroId);
|
||||
expect(features).to.have.length(1);
|
||||
|
||||
var feature = features[0];
|
||||
expect(feature).to.be.a(ol.Feature);
|
||||
expect(feature.getId()).to.be(0);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('#readFeatures()', function() {
|
||||
|
||||
Reference in New Issue
Block a user