mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-26 07:23:40 +00:00
Don't show thumbnail when hovering over Mapillary markers
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user