Merge pull request #17 from betatim/dont-move-marker-on-zoom

Do not move marker on double click
This commit is contained in:
Kevin Dungs 2014-11-24 15:53:01 +01:00
commit 990ebd3ee5
1 changed files with 11 additions and 1 deletions

View File

@ -60,7 +60,17 @@ var These3Words = (function () {
}); });
google.maps.event.addListener(that.map, 'click', function (evt) { google.maps.event.addListener(that.map, 'click', function (evt) {
that.mapZoom = that.map.getZoom();
setTimeout(function() {
// if zoom level has changed then the user
// double clicked instead of single clicked
// so we do not want to move, just zoom
if (that.map.getZoom() != that.mapZoom) {
return;
}
that.moveTo(evt.latLng); that.moveTo(evt.latLng);
},
300);
}); });
that.searchInput = document.createElement('input'); that.searchInput = document.createElement('input');