Skip to content

Commit

Permalink
fix: move view pin to pin with only one click
Browse files Browse the repository at this point in the history
  • Loading branch information
abelkhay committed Feb 15, 2024
1 parent 821a592 commit d9c6765
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
MarkersPresenter
} from '../../../core/presenters';
import {
inLieuxZoomLevel,
LabelPresentation,
labelToDisplayMap,
LieuMediationNumeriqueDetailsPresentation,
Expand Down Expand Up @@ -151,11 +150,7 @@ export class LieuxMediationNumeriqueDetailsPage {
}

private select(lieuMediationNumerique: LieuMediationNumeriqueDetailsPresentation): void {
lieuMediationNumerique.localisation &&
this._markersPresenter.center(
lieuMediationNumerique.localisation,
inLieuxZoomLevel(this._markersPresenter.getZoom()) ? 17 : this._zoomLevel.userPosition
);
lieuMediationNumerique.localisation && this._markersPresenter.center(lieuMediationNumerique.localisation);
this._markersPresenter.select(lieuMediationNumerique.id);
}

Expand Down
8 changes: 3 additions & 5 deletions src/features/core/presenters/markers/markers.presenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,9 @@ export class MarkersPresenter {
}

public center(localisation: Localisation, zoom: number = this._currentZoom): void {
setTimeout(() => {
this._localisation$.next(localisation);
this._zoom$.next(zoom);
this._currentZoom = zoom;
});
this._localisation$.next(localisation);
this._zoom$.next(zoom);
this._currentZoom = zoom;
}

public select(markerId: string): void {
Expand Down

0 comments on commit d9c6765

Please sign in to comment.