Map centerEase to selected marker

This commit is contained in:
Bryan Housel
2016-02-10 22:41:18 -05:00
parent e5fc872a19
commit 6b1fe52d0d
2 changed files with 6 additions and 4 deletions

View File

@@ -115,12 +115,13 @@ iD.MapillaryImageLayer = function(context) {
.append('svg')
.style('display', enabled ? 'block' : 'none')
.on('click', function() { // deselect/select
var imageKey = d3.event.target.__data__.key;
if (imageKey === mapillary.selectedThumbnail()) {
var image = d3.event.target.__data__;
if (image.key === mapillary.selectedThumbnail()) {
hideThumbnail();
} else {
mapillary.selectedThumbnail(imageKey);
showThumbnail(imageKey);
mapillary.selectedThumbnail(image.key);
context.map().centerEase(image.loc);
showThumbnail(image.key);
}
})
.on('mouseover', function() {

View File

@@ -80,6 +80,7 @@ iD.MapillarySignLayer = function(context) {
hideThumbnail();
} else {
mapillary.selectedThumbnail(d.key);
context.map().centerEase(d.loc);
showThumbnail(d.key);
}
})