fix: fix warnings and update detection tags

This commit is contained in:
Nikola Plesa
2020-07-31 16:37:05 +02:00
parent e87b0b9432
commit 6d5222ceb4
4 changed files with 18 additions and 14 deletions
+10 -10
View File
@@ -47,7 +47,6 @@ var _mlyClicks;
var _mlySelectedImage;
var _mlySelectedImageKey;
var _mlyViewer;
var _mlyViewerFilter = ['all'];
var _mlyHighlightedDetection;
var _mlyShowFeatureDetections = false;
var _mlyShowSignDetections = false;
@@ -523,7 +522,7 @@ export default {
if (imageKey) {
hash.photo = imageKey;
} else {
delete hash.photo
delete hash.photo;
}
window.location.replace('#' + utilQsString(hash, true));
}
@@ -750,7 +749,7 @@ export default {
loadData('image_detections', url)
.then(() => {
showDetections(_mlyCache.image_detections.forImageKey[imageKey] || []);
})
});
} else {
showDetections(_mlyCache.image_detections.forImageKey[imageKey]);
}
@@ -769,18 +768,19 @@ export default {
var valueParts = data.value.split('--');
if (!valueParts.length) return;
var text = valueParts[1];
if (text === 'flat' || text === 'discrete' || text === 'sign' || text === 'traffic-light') {
text = valueParts[2];
}
text = text.replace(/-/g, ' ');
text = text.charAt(0).toUpperCase() + text.slice(1)
var tag;
var text;
var color = 0xffffff;
if (_mlyHighlightedDetection === data.key) {
color = 0xffff00;
text = valueParts[1];
if (text === 'flat' || text === 'discrete' || text === 'sign' || text === 'traffic-light') {
text = valueParts[2];
}
text = text.replace(/-/g, ' ');
text = text.charAt(0).toUpperCase() + text.slice(1);
_mlyHighlightedDetection = null;
}
-1
View File
@@ -154,7 +154,6 @@ export function svgMapillaryImages(projection, context, dispatch) {
var showViewfields = (z >= minViewfieldZoom);
var service = getService();
var selectedKey = service && service.getSelectedImageKey();
var sequences = (service ? service.sequences(projection) : []);
var images = (service && showMarkers ? service.images(projection) : []);
+6 -1
View File
@@ -68,10 +68,15 @@ export function svgMapillaryMapFeatures(projection, context, dispatch) {
d.detections.forEach(function(detection) {
if (!imageKey || selectedImageKey === detection.image_key) {
imageKey = detection.image_key;
highlightedDetection = detection
highlightedDetection = detection;
}
});
if (imageKey === selectedImageKey) {
service
.highlightDetection(highlightedDetection)
.selectImage(context, imageKey);
}
service
.highlightDetection(highlightedDetection)
.updateViewer(context, imageKey)
+2 -2
View File
@@ -5,7 +5,7 @@ import { svgPointTransform } from './helpers';
import { services } from '../services';
export function svgMapillaryPosition(projection, context, dispatch) {
export function svgMapillaryPosition(projection, context) {
var throttledRedraw = _throttle(function () { update(); }, 1000);
var minZoom = 12;
var minViewfieldZoom = 18;
@@ -157,7 +157,7 @@ export function svgMapillaryPosition(projection, context, dispatch) {
}
drawImages.enabled = function(_) {
drawImages.enabled = function() {
update();
return this;
};