added: svg notes, TODO: add icon, test

This commit is contained in:
Thomas Hervey
2018-06-20 17:38:45 -04:00
parent cf2a9ad935
commit 3df01e27c0
5 changed files with 243 additions and 11 deletions
+1
View File
@@ -1,6 +1,7 @@
export { osmChangeset } from './changeset';
export { osmEntity } from './entity';
export { osmNode } from './node';
export { osmNote } from './note';
export { osmRelation } from './relation';
export { osmWay } from './way';
+34
View File
@@ -0,0 +1,34 @@
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';
});
}
});