Add support for reading id & properties

This commit is contained in:
Antoine Abt
2014-01-09 14:48:27 +01:00
parent 1dce04b6ec
commit c8e7c9f64e
2 changed files with 14 additions and 0 deletions

View File

@@ -9,6 +9,9 @@ var aruba = {
objects: {
aruba: {
type: 'Polygon',
properties: {
prop0: 'value0'
},
arcs: [[0]],
id: 533
}
@@ -46,6 +49,11 @@ describe('ol.format.TopoJSON', function() {
var geometry = feature.getGeometry();
expect(geometry).to.be.a(ol.geom.Polygon);
// Parses identifier
expect(feature.getId()).to.be(533);
// Parses properties
expect(feature.get('prop0')).to.be('value0');
expect(geometry.getExtent()).to.eql([
-70.08100810081008, 12.417091709170947,
-69.9009900990099, 12.608069195591469