Fix imagery layers resetting eachother's classes

Fixes:
- Selecting a bubble then enabling a second imagery layer removes the hovered and selected highlighting
- If multiple imagery layers are enabled and you select a bubble it only temporarily becomes highlighted
- If multiple imagery layers are enabled and a bubble is highlighted, hovering over another imagery layer's bubble will remove the selected and hovered highlighting

Basically these all came down to style updates resetting all layers for
cases other than when the viewport was changed (where doing so makes
sense because the selected bubble/sequence needs to update as a result).

See #5494
This commit is contained in:
SilentSpike
2019-01-27 14:44:57 +00:00
parent da41d9d921
commit 99f7a90387
5 changed files with 13 additions and 6 deletions
+3
View File
@@ -556,6 +556,9 @@ export default {
},
// Updates the currently highlighted sequence and selected bubble.
// Reset is only necessary when interacting with the viewport because
// this implicitly changes the currently selected bubble/sequence
setStyles: function(hovered, reset) {
if (reset) { // reset all layers
d3_selectAll('.viewfield-group')
+3
View File
@@ -492,6 +492,9 @@ export default {
},
// Updates the currently highlighted sequence and selected bubble.
// Reset is only necessary when interacting with the viewport because
// this implicitly changes the currently selected bubble/sequence
setStyles: function(hovered, reset) {
if (reset) { // reset all layers
d3_selectAll('.viewfield-group')
+3 -3
View File
@@ -925,9 +925,9 @@ export default {
},
/**
* setStyles().
*/
// Updates the currently highlighted sequence and selected bubble.
// Reset is only necessary when interacting with the viewport because
// this implicitly changes the currently selected bubble/sequence
setStyles: function (hovered, reset) {
if (reset) { // reset all layers
d3_selectAll('.viewfield-group')
+1
View File
@@ -205,6 +205,7 @@ export function svgMapillaryImages(projection, context, dispatch) {
.attr('transform', 'scale(1.5,1.5),translate(-8, -13)')
.attr('d', viewfieldPath);
function viewfieldPath() {
var d = this.parentNode.__data__;
if (d.pano) {
+3 -3
View File
@@ -122,7 +122,7 @@ export function svgStreetside(projection, context, dispatch) {
function mouseover(d) {
var service = getService();
_hoveredBubble = d;
if (service) service.setStyles(d, true);
if (service) service.setStyles(d);
}
/**
@@ -131,7 +131,7 @@ export function svgStreetside(projection, context, dispatch) {
function mouseout() {
var service = getService();
_hoveredBubble = null;
if (service) service.setStyles(null, true);
if (service) service.setStyles(null);
}
/**
@@ -253,7 +253,7 @@ export function svgStreetside(projection, context, dispatch) {
if (service) {
service.setStyles(_hoveredBubble, true);
service.setStyles(_hoveredBubble);
}