diff --git a/projects/common-map/src/fm-map/components/map/map.component.ts b/projects/common-map/src/fm-map/components/map/map.component.ts index 1f24e4c..9403645 100644 --- a/projects/common-map/src/fm-map/components/map/map.component.ts +++ b/projects/common-map/src/fm-map/components/map/map.component.ts @@ -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); });