Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
akariv committed Jan 21, 2024
1 parent 1e9805c commit 2a56696
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion projects/srm/src/app/page/page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,10 @@ export class PageComponent implements OnInit, AfterViewInit, OnDestroy {

zoomOutMap(viewport: ViewPort) {
this.savedState = null;
if (viewport) {
console.log('ZOOM OUT MAP', viewport.top_left.lat, viewport.top_left.lon, viewport.bottom_right.lat, viewport.bottom_right.lon)
if (viewport && viewport.top_left && viewport.bottom_right &&
!Number.isNaN(viewport.top_left.lat) && !Number.isNaN(viewport.top_left.lon) &&
!Number.isNaN(viewport.bottom_right.lat) && !Number.isNaN(viewport.bottom_right.lon)) {
if (!viewport.zoom) {
this.queueMapAction((map) => {
map.fitBounds([viewport.top_left, viewport.bottom_right], {padding: {top: 70, bottom: 10, left: 10, right: 10}, maxZoom: 15});
Expand Down

0 comments on commit 2a56696

Please sign in to comment.