Fix unnecessary "hops" after zooming
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
This commit is contained in:
parent
dad8e061ea
commit
050fda377b
@ -178,7 +178,6 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
||||
let rotation = parseFloat(params.get("rotation"));
|
||||
let baseLayer = params.get("baseLayer")?params.get("baseLayer"):"";
|
||||
newMapState = { xCenter: xCenter, yCenter: yCenter, zoom: zoom, rotation: rotation, baseLayerCode: baseLayer }
|
||||
mapStateChanged = (JSON.stringify(lastMapState) != JSON.stringify(newMapState));
|
||||
window.localStorage.setItem("FarmMapsCommonMap_mapState",JSON.stringify(newMapState));
|
||||
}
|
||||
if (params.has("queryState")) {
|
||||
@ -194,13 +193,11 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
||||
if(setStateCount==0) t=600;
|
||||
setTimeout(() => {
|
||||
this.zone.run(()=> {
|
||||
if ( (queryStateChanged && mapStateChanged) || setStateCount ==0) {
|
||||
if (setStateCount ==0) {
|
||||
this.store.dispatch(new mapActions.SetState(newMapState,newQueryState));
|
||||
} else if(queryStateChanged) {
|
||||
this.store.dispatch(new mapActions.SetQueryState(newQueryState));
|
||||
} else if (mapStateChanged) {
|
||||
this.store.dispatch(new mapActions.SetMapState(newMapState));
|
||||
}
|
||||
}
|
||||
})
|
||||
},t);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user