Files
iD/modules/osm/note.js
2018-06-20 17:38:45 -04:00

35 lines
700 B
JavaScript

import _extend from 'lodash-es/extend';
import { osmEntity } from './entity';
import { geoExtent } from '../geo';
export function osmNote() {
if (!(this instanceof osmNote)) {
return (new osmNote()).initialize(arguments);
} else if (arguments.length) {
this.initialize(arguments);
}
}
osmEntity.note = osmNote;
osmNote.prototype = Object.create(osmEntity.prototype);
_extend(osmNote.prototype, {
type: 'note',
extent: function() {
return new geoExtent(this.loc);
},
geometry: function(graph) {
return graph.transient(this, 'geometry', function() {
return graph.isPoi(this) ? 'point' : 'vertex';
});
}
});