@@ -75,7 +75,7 @@ type MapMaplibreGlState = {
75
75
geocoder : MaplibreGeocoder | null ;
76
76
zoomControl : ZoomControl | null ;
77
77
zoom ?: number ;
78
- protocol : Protocol | null ;
78
+ pmtilesProtocol : Protocol | null ;
79
79
} ;
80
80
81
81
class MapMaplibreGlInternal extends React . Component < MapMaplibreGlInternalProps , MapMaplibreGlState > {
@@ -95,7 +95,7 @@ class MapMaplibreGlInternal extends React.Component<MapMaplibreGlInternalProps,
95
95
inspect : null ,
96
96
geocoder : null ,
97
97
zoomControl : null ,
98
- protocol : new Protocol ( { metadata : true } )
98
+ pmtilesProtocol : new Protocol ( { metadata : true } )
99
99
}
100
100
i18next . on ( 'languageChanged' , ( ) => {
101
101
this . forceUpdate ( ) ;
@@ -140,7 +140,7 @@ class MapMaplibreGlInternal extends React.Component<MapMaplibreGlInternalProps,
140
140
141
141
if ( this . props . localPMTiles ) {
142
142
const file = this . props . localPMTiles ;
143
- this . state . protocol ! . add ( file ) ; // this is necessary for non-HTTP sources
143
+ this . state . pmtilesProtocol ! . add ( file ) ; // this is necessary for non-HTTP sources
144
144
145
145
if ( map ) {
146
146
file . getMetadata ( ) . then ( ( metadata : any ) => {
@@ -166,8 +166,7 @@ class MapMaplibreGlInternal extends React.Component<MapMaplibreGlInternalProps,
166
166
localIdeographFontFamily : false
167
167
} satisfies MapOptions ;
168
168
169
- const protocol = this . state . protocol ;
170
- MapLibreGl . addProtocol ( "pmtiles" , protocol ! . tile ) ;
169
+ MapLibreGl . addProtocol ( "pmtiles" , this . state . pmtilesProtocol ! . tile ) ;
171
170
172
171
const map = new MapLibreGl . Map ( mapOpts ) ;
173
172
0 commit comments