@@ -23,10 +23,10 @@ enum EactiveTabs {
2323type TactiveTabs = keyof typeof EactiveTabs ;
2424
2525@Component ( {
26- selector : 'ukis-layerentry-group' ,
27- templateUrl : './layerentry-group.component.html' ,
28- styleUrls : [ './layerentry-group.component.scss' ] ,
29- imports : [ ClrIconModule , NgClass , ClrCommonFormsModule , CdkDropList , CdkDrag , LayerentryComponent , CdkDragHandle , ItemsFilterPipe , ReversePipe , DynamicComponent ]
26+ selector : 'ukis-layerentry-group' ,
27+ templateUrl : './layerentry-group.component.html' ,
28+ styleUrls : [ './layerentry-group.component.scss' ] ,
29+ imports : [ ClrIconModule , NgClass , ClrCommonFormsModule , CdkDropList , CdkDrag , LayerentryComponent , CdkDragHandle , ItemsFilterPipe , ReversePipe , DynamicComponent ]
3030} )
3131export class LayerentryGroupComponent implements OnInit {
3232 @HostBinding ( 'class.group-visible' ) get visible ( ) { return this . group . visible ; }
@@ -77,7 +77,7 @@ export class LayerentryGroupComponent implements OnInit {
7777 if ( Object . keys ( EactiveTabs ) . includes ( this . group . expanded . tab ) ) {
7878 this . switchTab ( this . group . expanded . tab as TactiveTabs ) ;
7979 /** let the user reset the default open tab */
80- if ( this . group . expanded . expanded === false ) {
80+ if ( this . group . expanded . expanded === false ) {
8181 this . activeTabs [ this . group . expanded . tab ] = false ;
8282 }
8383 } else {
@@ -187,8 +187,13 @@ export class LayerentryGroupComponent implements OnInit {
187187
188188
189189 zoomTo ( group : LayerGroup ) {
190- if ( this . mapState && group . bbox && group . bbox . length >= 4 ) {
191- this . mapState . setExtent ( group . bbox ) ;
190+ if ( this . mapState ) {
191+ const state = this . mapState . getMapState ( ) . value ;
192+ if ( group . bbox && group ?. nativeBbox ?. epsg !== state ?. proj ?. epsg ) {
193+ this . mapState . setExtent ( group . bbox ) ;
194+ } else if ( group . nativeBbox && group . nativeBbox . epsg === state ?. proj ?. epsg ) {
195+ this . mapState . setNativeExtent ( group . nativeBbox . bbox )
196+ }
192197 }
193198 }
194199
0 commit comments