Don't show thumbnail when hovering over Mapillary markers

This commit is contained in:
Bryan Housel
2016-05-27 22:42:46 -04:00
parent d13715ee81
commit 0eac0ff862
3 changed files with 17 additions and 38 deletions

View File

@@ -267,11 +267,15 @@ iD.services.mapillary = function() {
if (iD.services.mapillary) {
iD.services.mapillary.thumb = null;
}
d3.select('#content').selectAll('.mapillary-image')
.classed('hidden', true);
d3.select('#content').selectAll('.mly-wrapper')
.classed('active', false);
d3.selectAll('.layer-mapillary-images .viewfield-group, .layer-mapillary-signs .icon-sign')
.classed('selected', false);
};
mapillary.killThumbnail = function() {

View File

@@ -158,35 +158,22 @@ iD.svg.MapillaryImages = function(projection, context, dispatch) {
.append('g')
.attr('class', 'layer-mapillary-images')
.style('display', enabled ? 'block' : 'none')
.on('click', function() { // deselect/select
.on('click', function() {
var mapillary = getMapillary();
if (!mapillary) return;
var d = d3.event.target.__data__,
thumb = mapillary.selectedThumbnail();
if (thumb && thumb.key === d.key) {
removeThumbnail();
} else if (_mlyLoading) {
if (thumb && thumb.key === d.key) return;
if (_mlyLoading) {
showLoading(d);
} else {
mapillary.selectedThumbnail(d);
context.map().centerEase(d.loc);
showThumbnail(d, true);
}
})
.on('mouseover', function() {
var mapillary = getMapillary();
if (!mapillary) return;
showThumbnail(d3.event.target.__data__);
})
.on('mouseout', function() {
var mapillary = getMapillary();
if (!mapillary) return;
var thumb = mapillary.selectedThumbnail();
if (thumb) {
showThumbnail(thumb, true);
} else {
removeThumbnail();
}
});
layer.exit()

View File

@@ -84,28 +84,16 @@ iD.svg.MapillarySigns = function(projection, context, dispatch) {
.html(mapillary.signHTML);
enter
.on('click', function(d) { // deselect/select
.on('click', function(d) {
var mapillary = getMapillary();
if (!mapillary) return;
var thumb = mapillary.selectedThumbnail();
if (thumb && thumb.key === d.key) {
hideThumbnail();
} else {
mapillary.selectedThumbnail(d);
context.map().centerEase(d.loc);
showThumbnail(d, true);
}
})
.on('mouseover', showThumbnail)
.on('mouseout', function() {
var mapillary = getMapillary();
if (!mapillary) return;
var thumb = mapillary.selectedThumbnail();
if (thumb) {
showThumbnail(thumb, true);
} else {
hideThumbnail();
}
if (thumb && thumb.key === d.key) return;
mapillary.selectedThumbnail(d);
context.map().centerEase(d.loc);
showThumbnail(d, true);
});
// Exit