@@ -47,7 +47,7 @@ export default class MVTLayer extends TileLayer {
47
47
48
48
/* eslint-disable complexity */
49
49
async _updateTileData ( ) {
50
- let { data, minZoom , maxZoom } = this . props ;
50
+ let { data} = this . props ;
51
51
let tileJSON = null ;
52
52
53
53
if ( typeof data === 'string' && ! isURLTemplate ( data ) ) {
@@ -69,21 +69,30 @@ export default class MVTLayer extends TileLayer {
69
69
70
70
if ( tileJSON ) {
71
71
data = tileJSON . tiles ;
72
+ }
73
+
74
+ this . setState ( { data, tileJSON} ) ;
75
+ }
76
+
77
+ _getTilesetOptions ( props ) {
78
+ const opts = super . _getTilesetOptions ( props ) ;
79
+ const { tileJSON} = this . state ;
72
80
73
- if ( Number . isFinite ( tileJSON . minzoom ) && tileJSON . minzoom > minZoom ) {
74
- minZoom = tileJSON . minzoom ;
81
+ if ( tileJSON ) {
82
+ if ( Number . isFinite ( tileJSON . minzoom ) && tileJSON . minzoom > props . minZoom ) {
83
+ opts . minZoom = tileJSON . minzoom ;
75
84
}
76
85
77
86
if (
78
87
Number . isFinite ( tileJSON . maxzoom ) &&
79
- ( ! Number . isFinite ( maxZoom ) || tileJSON . maxzoom < maxZoom )
88
+ ( ! Number . isFinite ( props . maxZoom ) || tileJSON . maxzoom < props . maxZoom )
80
89
) {
81
- maxZoom = tileJSON . maxzoom ;
90
+ opts . maxZoom = tileJSON . maxzoom ;
82
91
}
83
92
}
84
-
85
- this . setState ( { data, tileJSON, minZoom, maxZoom} ) ;
93
+ return opts ;
86
94
}
95
+
87
96
/* eslint-disable complexity */
88
97
89
98
renderLayers ( ) {
0 commit comments