From afa7b345dbb1788f6dd4bcefc09117397731ee7d Mon Sep 17 00:00:00 2001 From: panaaj <38519157+panaaj@users.noreply.github.com> Date: Thu, 6 Jul 2023 10:29:46 +0930 Subject: [PATCH] feature: limit zoom to selected maps. --- .../fb-openlayers/src/lib/view.directive.ts | 12 ++++++ src/app/app.component.css | 3 ++ src/app/app.component.html | 14 +++++++ src/app/app.component.ts | 8 ++++ src/app/app.info.ts | 36 ++++++++++++---- src/app/modules/map/fb-map.component.html | 7 ++-- src/app/modules/map/fb-map.component.ts | 9 +--- .../modules/skresources/resources.service.ts | 42 ++++++++++++++++++- 8 files changed, 112 insertions(+), 19 deletions(-) diff --git a/projects/fb-openlayers/src/lib/view.directive.ts b/projects/fb-openlayers/src/lib/view.directive.ts index 13ebced6..059ceae4 100644 --- a/projects/fb-openlayers/src/lib/view.directive.ts +++ b/projects/fb-openlayers/src/lib/view.directive.ts @@ -115,6 +115,18 @@ export class ViewDirective } else { properties[key] = fromLonLat(changes[key].currentValue); } + } else if (key === 'minZoom') { + if (this.view) { + this.view.setMinZoom(changes[key].currentValue); + } else { + properties[key] = changes[key].currentValue; + } + } else if (key === 'maxZoom') { + if (this.view) { + this.view.setMaxZoom(changes[key].currentValue); + } else { + properties[key] = changes[key].currentValue; + } } else { properties[key] = changes[key].currentValue; } diff --git a/src/app/app.component.css b/src/app/app.component.css index 058226e6..c17061c0 100644 --- a/src/app/app.component.css +++ b/src/app/app.component.css @@ -59,6 +59,9 @@ mat-nav-list { background-color: rgba(130,130,130,.3); padding: 10px 2px 2px 2px; } +.rightUtilsPanel div { + height: 60px; +} .mapButton { position: fixed; diff --git a/src/app/app.component.html b/src/app/app.component.html index bd155530..9f469e36 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -624,6 +624,20 @@
 
+ +
+ +
 
+
+