diff --git a/src/module_vmap/module/javascript/app/vmap/tools/location.js b/src/module_vmap/module/javascript/app/vmap/tools/location.js index 4cd96440554191c47a0415289ddde0cb77eb6065..415bd9cb19f286c3fcb11ea2c8818f5b60dc3c30 100644 --- a/src/module_vmap/module/javascript/app/vmap/tools/location.js +++ b/src/module_vmap/module/javascript/app/vmap/tools/location.js @@ -197,12 +197,25 @@ nsVmap.nsToolsManager.Location.prototype.locationController = function ($scope, fHistoryDelayHandler = $timeout(function () { if(this_['iHistoryOffset'] === 0){ - this_["aLocationHistory"].push({ + + var oNewLocation = { center: this_.map_.getView().getCenter(), zoom: this_.map_.getView().getZoom() - }); + } + + var oLastLocation = this_['aLocationHistory'][this_['aLocationHistory'].length - 1]; + + if (this_['aLocationHistory'].length > 0) { + if (oNewLocation.zoom === oLastLocation.zoom && + oNewLocation.center[0] === oLastLocation.center[0] && + oNewLocation.center[1] === oLastLocation.center[1]) { + return 0; + } + } + + this_["aLocationHistory"].push(oNewLocation); } else { - // splice + // splice var iHistoryPosition = this_['aLocationHistory'].length - (this_['iHistoryOffset']); this_["aLocationHistory"].splice(iHistoryPosition, this_['iHistoryOffset'], { center: this_.map_.getView().getCenter(),