Generate proper descriptions for notes
This commit is contained in:
parent
90fe21a04a
commit
0b981e4b7f
1 changed files with 12 additions and 1 deletions
|
@ -13,6 +13,17 @@ function addNoteLayer(map, notesUrl, newNoteControls, newNoteForm, minZoom) {
|
|||
newNotes = undefined;
|
||||
};
|
||||
|
||||
var describeNote = function (n) {
|
||||
var description = "<h2>Note " + n.id + "</h2>";
|
||||
|
||||
n.comments.forEach(function (c) {
|
||||
description += "<p><small class='deemphasize'>" + c.action + " by ";
|
||||
description += c.user + " at " + c.date + "</small><br/>" + c.text + "</p>";
|
||||
});
|
||||
|
||||
return description;
|
||||
}
|
||||
|
||||
var noteSelected = function (o) {
|
||||
var feature = o.feature;
|
||||
var location = feature.geometry.getBounds().getCenterLonLat();
|
||||
|
@ -25,7 +36,7 @@ function addNoteLayer(map, notesUrl, newNoteControls, newNoteForm, minZoom) {
|
|||
content = form.html();
|
||||
close = false;
|
||||
} else {
|
||||
content = "<p>" + feature.attributes.id + "</p>";
|
||||
content = describeNote(feature.attributes);
|
||||
close = true;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue