Commit 0a8c691e authored by Adrien Pavie's avatar Adrien Pavie
Browse files

Tags shown in feature side content (see #26)

parent 1d79380e
......@@ -140,3 +140,42 @@
.side-content-feature-detail .value a {
text-decoration: none;
}
/*
* Tags
*/
.side-content-feature-tags {
border-top: 1px solid white;
width: 100%;
margin: 10px 0;
}
.side-content-feature-tags h3 {
margin: 10px 0;
}
.side-content-feature-tags table {
width: 100%;
table-layout: fixed;
border-collapse: collapse;
}
.side-content-feature-tags table tr th,
.side-content-feature-tags table tr td {
white-space: normal;
word-break: break-all;
word-wrap: break-word;
width: auto;
border: 1px solid #173878;
padding: 2px 4px;
text-align: left;
}
.side-content-feature-tags table tr th {
background-color: rgb(12, 64, 167);
}
.side-content-feature-tags table tr a {
text-decoration: none;
}
......@@ -117,6 +117,24 @@ Feature.prototype.get = function() {
details.append(detailsMinor);
element.append(details);
/*
* Tags
*/
if(this._options.showTags) {
var tags = $("<div class=\"side-content-feature-tags\"></div>");
tags.append("<h3>Tags</h3>");
var table = $("<table></table>");
//Tag table
for(var k in this._feature.tags) {
table.append("<tr><th><a href=\"https://wiki.openstreetmap.org/wiki/Key:"+k+"\">"+k+"</a></th><td>"+this._feature.getTag(k)+"</td></tr>");
}
tags.append(table);
element.append(tags);
}
}
return element;
......
......@@ -46,5 +46,5 @@ var f = new OLU.model.Feature({
//Tests
var side = OLU.view.side("side").addTo(map);
side.contents.feature.set(f, config.feature.details, { iconFolder: config.view.icons.folder, mapillaryClient: config.images.mapillary.clientId });
side.contents.feature.set(f, config.feature.details, { iconFolder: config.view.icons.folder, mapillaryClient: config.images.mapillary.clientId, showTags: true });
side.show("feature");
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment