File tree Expand file tree Collapse file tree
modules/react-mapbox/src/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ export default defineConfig(async () => {
99 resolve : {
1010 alias : {
1111 // Use root dependencies
12- 'react-map-gl/mapbox' : join ( rootDir , './modules/main /src/mapbox.ts ' ) ,
13- 'react-map-gl/maplibre' : join ( rootDir , './modules/main /src/maplibre.ts ' ) ,
12+ 'react-map-gl/mapbox' : join ( rootDir , './modules/react-mapbox /src' ) ,
13+ 'react-map-gl/maplibre' : join ( rootDir , './modules/react-maplibre /src' ) ,
1414 react : join ( rootDir , './node_modules/react' ) ,
1515 'react-dom' : join ( rootDir , './node_modules/react-dom' )
1616 }
Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ export type SourceProps = (SourceSpecification | CanvasSourceSpecification) & {
2525let sourceCounter = 0 ;
2626
2727function createSource ( map : MapInstance , id : string , props : SourceProps ) {
28- // @ts -ignore
2928 if ( map . isStyleLoaded ( ) ) {
3029 const options = { ...props } ;
3130 delete options . id ;
@@ -89,10 +88,12 @@ export function Source(props: SourceProps) {
8988 if ( map ) {
9089 /* global setTimeout */
9190 const forceUpdate = ( ) => setTimeout ( ( ) => setStyleLoaded ( version => version + 1 ) , 0 ) ;
91+ map . on ( 'load' , forceUpdate ) ;
9292 map . on ( 'styledata' , forceUpdate ) ;
9393 forceUpdate ( ) ;
9494
9595 return ( ) => {
96+ map . off ( 'load' , forceUpdate ) ;
9697 map . off ( 'styledata' , forceUpdate ) ;
9798 // @ts -ignore
9899 if ( map . style && map . style . _loaded && map . getSource ( id ) ) {
You can’t perform that action at this time.
0 commit comments