Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mcwhittemore committed Jan 29, 2016
1 parent eddb319 commit f770392
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/feature_types/feature.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ export default class Geometry {
* @return {Object} GeoJSON feature
*/
toGeoJSON() {
return {
return JSON.parse(JSON.stringify({
type: 'Feature',
id: this.drawId,
properties: this.properties,
geometry: {
type: this.type,
coordinates: this.coordinates
}
};
}));
}

/**
Expand All @@ -119,7 +119,6 @@ export default class Geometry {

setProperties(props) {
props = JSON.parse(JSON.stringify(props));
props.drawId = this.drawId;
this.properties = props;
return this;
}
Expand Down
7 changes: 3 additions & 4 deletions src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,14 @@ export default class Store {
if (isStillAlive) { // checks to make sure we still have a map
var featureBuckets = Object.keys(this._features).reduce((buckets, id) => {
if (this._features[id].ready) {
let geojson = this._features[id].toGeoJSON();
geojson.properties.drawId = id;

if (this._features[id].selected === true) {
let geojson = this._features[id].toGeoJSON();
geojson.properties.drawId = id;
buckets.selected.push(geojson);
buckets.selected = buckets.selected.concat(createMidpoints([this._features[id]], this._map), createVertices([this._features[id]]));
}
else {
let geojson = this._features[id].toGeoJSON();
geojson.properties.drawId = id;
buckets.unselected.push(geojson);
}
}
Expand Down

0 comments on commit f770392

Please sign in to comment.