Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task/WG-79: fix zoom level #138

Merged
merged 4 commits into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion angular/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"leaflet": "^1.4.0",
"leaflet.markercluster": "^1.4.1",
"mapillary-js": "^4.1.0",
"ng-tapis": "^2.1.6",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pinning to the exact version of ng-tapis as we have a newer version which is not suitable for master

"ng-tapis": "2.1.6",
"ngx-toastr": "^11.3.3",
"patch-package": "^6.4.7",
"rxjs": "~6.5.3",
Expand Down
7 changes: 5 additions & 2 deletions angular/src/app/components/map/map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ export class MapComponent implements OnInit, OnDestroy {

mapillaryLayer: any;

private readonly MAX_FIT_TO_BOUNDS_ZOOM = 18;

constructor(
private projectsService: ProjectsService,
private geoDataService: GeoDataService,
Expand Down Expand Up @@ -187,7 +189,8 @@ export class MapComponent implements OnInit, OnDestroy {
this.map.fitBounds([
[bbox[1], bbox[0]],
[bbox[3], bbox[2]],
]);
],
{maxZoom: this.MAX_FIT_TO_BOUNDS_ZOOM});
})
);

Expand Down Expand Up @@ -374,7 +377,7 @@ export class MapComponent implements OnInit, OnDestroy {
try {
if (this.fitToFeatureExtent) {
this.fitToFeatureExtent = false;
this.map.fitBounds(this.features.getBounds());
this.map.fitBounds(this.features.getBounds(), {maxZoom: this.MAX_FIT_TO_BOUNDS_ZOOM});
}
} catch (e) {}
});
Expand Down