mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
35 lines
700 B
JavaScript
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';
|
|
});
|
|
}
|
|
});
|