Files
iD/modules/osm/changeset.js
2017-03-11 01:12:37 -05:00

54 lines
1.0 KiB
JavaScript

import _ from 'lodash';
import { osmEntity } from './entity';
import { geoExtent } from '../geo';
export function osmChangeset() {
if (!(this instanceof osmChangeset)) {
return (new osmChangeset()).initialize(arguments);
} else if (arguments.length) {
this.initialize(arguments);
}
}
osmEntity.changeset = osmChangeset;
osmChangeset.prototype = Object.create(osmEntity.prototype);
_.extend(osmChangeset.prototype, {
type: 'changeset',
extent: function() {
return new geoExtent();
},
geometry: function() {
return 'changeset';
},
asJXON: function() {
return {
osm: {
changeset: {
tag: _.map(this.tags, function(value, key) {
return { '@k': key, '@v': value };
}),
'@version': 0.6,
'@generator': 'iD'
}
}
};
},
asGeoJSON: function() {
return {};
}
});