mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-06 19:31:41 +00:00
feat: traffic sign highlighting
This commit is contained in:
@@ -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, ' ');
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user