Store the feature's commonly used id

To not clobber the feature's attributes, this is a separate
member property.
This commit is contained in:
ahocevar
2013-05-23 11:16:17 -05:00
parent d1beaff8e4
commit 8c0f1f979a
6 changed files with 42 additions and 1 deletions

View File

@@ -151,6 +151,7 @@ describe('ol.parser.GeoJSON', function() {
var first = result[0];
expect(first).to.be.a(ol.Feature);
expect(first.get('name')).to.be('Afghanistan');
expect(first.getFeatureId()).to.be('AFG');
var firstGeom = first.getGeometry();
expect(firstGeom).to.be.a(ol.geom.Polygon);
expect(ol.extent.equals(firstGeom.getBounds(),
@@ -160,6 +161,7 @@ describe('ol.parser.GeoJSON', function() {
var last = result[178];
expect(last).to.be.a(ol.Feature);
expect(last.get('name')).to.be('Zimbabwe');
expect(last.getFeatureId()).to.be('ZWE');
var lastGeom = last.getGeometry();
expect(lastGeom).to.be.a(ol.geom.Polygon);
expect(ol.extent.equals(lastGeom.getBounds(),