Skip to content

Commit

Permalink
fix(cesium): Call signal before loop
Browse files Browse the repository at this point in the history
  • Loading branch information
jmacura committed Dec 15, 2024
1 parent 0524c93 commit 97b49f7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
5 changes: 3 additions & 2 deletions projects/hslayers-cesium/src/hscesium.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,9 @@ export class HsCesiumService {
this.cesiumPositionClicked.next(position);
});

//Remove overlays registered when init was called last time (when switching between 2d/3d)
for (const p of this.hsOverlayConstructorService.panels) {
//Remove overlays registered when init was called last time (when switching between 2D/3D)
const panelCollection = this.hsOverlayConstructorService.panels();
for (const p of panelCollection) {
if (this.HsUtilsService.instOf(p, HsQueryPopupComponent)) {
this.hsOverlayConstructorService.destroy(p);
}
Expand Down
7 changes: 5 additions & 2 deletions projects/hslayers/core/hslayers.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ import {HsLanguageService} from 'hslayers-ng/services/language';
})
export class HslayersService {
embeddedEnabled = true;
config: any;
//TODO: remove
//config: any;
initCalled: boolean;
missingLRFunctionsWarned: any;
//TODO: remove
//missingLRFunctionsWarned: any;

constructor(
private hsLanguageService: HsLanguageService,
Expand Down Expand Up @@ -99,6 +101,7 @@ export class HslayersService {
}
} else {
this.log.log('Map not yet initialized!');
return;
}
const neededSize = {
width: map.offsetWidth,
Expand Down
1 change: 0 additions & 1 deletion projects/hslayers/core/map/map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
ViewChild,
} from '@angular/core';


import {Subscription} from 'rxjs';
import {transform} from 'ol/proj';

Expand Down
2 changes: 1 addition & 1 deletion projects/hslayers/services/event-bus/event-bus.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export class HsEventBusService {
refreshLaymanLayer: Subject<VectorLayer<VectorSource<Feature>>> =
new Subject();
/**
* Fires when WFS filter should be reset - used when last filter is removed
* Fires when WFS filter should be reset - used when last filter is removed
*/
resetWfsFilter: Subject<void> = new Subject();
constructor() {}
Expand Down
6 changes: 3 additions & 3 deletions projects/hslayers/services/map/map.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable no-eq-null */
import {Injectable, Renderer2, RendererFactory2} from '@angular/core';
import {filter} from 'rxjs';

import ImageWrapper from 'ol/Image';
import RenderFeature from 'ol/render/Feature';
Expand Down Expand Up @@ -48,7 +49,6 @@ import {HsLayoutService} from 'hslayers-ng/services/layout';
import {HsLogService} from 'hslayers-ng/services/log';
import {HsQueuesService} from 'hslayers-ng/services/queues';
import {HsUtilsService} from 'hslayers-ng/services/utils';
import {filter} from 'rxjs';
import {
getDimensions,
getEnableProxy,
Expand Down Expand Up @@ -102,7 +102,7 @@ export class HsMapService {
*/
originalView: {center: number[]; zoom: number; rotation: number};
/**
* Keeps track of zoomWithModifier listener so its not registered multiple times when using router
* Keeps track of zoomWithModifier listener so it's not registered multiple times when using router
*/
zoomWithModifierListener;
constructor(
Expand Down Expand Up @@ -347,7 +347,7 @@ export class HsMapService {
* @public
* @param mapElement - Map html element
*/
init(mapElement): void {
init(mapElement: HTMLElement): void {
let map: Map;
if (this.map) {
map = this.map;
Expand Down

0 comments on commit 97b49f7

Please sign in to comment.