feat: traffic sign highlighting

This commit is contained in:
Nikola Plesa
2020-08-03 14:30:51 +02:00
parent fe1aabbf31
commit f002df5493
3 changed files with 18 additions and 10 deletions

View File

@@ -776,7 +776,7 @@ export default {
if (_mlyHighlightedDetection === data.key) {
color = 0xffff00;
text = valueParts[1];
if (text === 'flat' || text === 'discrete' || text === 'sign' || text === 'traffic-light') {
if (text === 'flat' || text === 'discrete' || text === 'sign') {
text = valueParts[2];
}
text = text.replace(/-/g, ' ');

View File

@@ -76,11 +76,12 @@ export function svgMapillaryMapFeatures(projection, context, dispatch) {
service
.highlightDetection(highlightedDetection)
.selectImage(context, imageKey);
} else {
service
.highlightDetection(highlightedDetection)
.updateViewer(context, imageKey)
.showViewer(context);
}
service
.highlightDetection(highlightedDetection)
.updateViewer(context, imageKey)
.showViewer(context);
}

View File

@@ -62,19 +62,26 @@ export function svgMapillarySigns(projection, context, dispatch) {
var selectedImageKey = service.getSelectedImageKey();
var imageKey;
var highlightedDetection;
// Pick one of the images the sign was detected in,
// preference given to an image already selected.
d.detections.forEach(function(detection) {
if (!imageKey || selectedImageKey === detection.image_key) {
imageKey = detection.image_key;
highlightedDetection = detection;
}
});
service
.highlightDetection(d)
.updateViewer(context, imageKey)
.showViewer(context);
if (imageKey === selectedImageKey) {
service
.highlightDetection(highlightedDetection)
.selectImage(context, imageKey);
} else {
service
.highlightDetection(highlightedDetection)
.updateViewer(context, imageKey)
.showViewer(context);
}
}