File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,9 @@ export default class GoogleMap {
4141 options . googleMapsAPIKey
4242 } &language=${ options . language || defaultLanguage } ®ion=${ options . region || defaultRegion }
4343 }${
44- options . libraries && `&libraries=${ options . libraries . join ( ',' ) } `
44+ options . libraries ? `&libraries=${ options . libraries . join ( ',' ) } ` : ''
4545 } ${
46- options . mapIds && `&map_ids=${ options . mapIds . join ( ',' ) } `
46+ options . mapIds ? `&map_ids=${ options . mapIds . join ( ',' ) } ` : ''
4747 } `
4848 ) ;
4949 scriptTag . onload = ( ) : void => {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export interface GoogleMapProviderProps {
1010 libraries : string [ ] ;
1111 language ?: string ;
1212 region ?: string ;
13- mapIds : string [ ] ;
13+ mapIds ? : string [ ] ;
1414 onLoad ?: ( map : google . maps . Map ) => void ;
1515}
1616
@@ -44,7 +44,7 @@ const GoogleMapProvider = (props: GoogleMapProviderProps): JSX.Element => {
4444 const [ loading , setLoading ] = useState < boolean > ( true ) ;
4545 const [ map , setMap ] = useState < GoogleMap > ( ) ;
4646
47- const createGoogleMap = ( ( ) => {
47+ const createGoogleMap = ( ) => {
4848 if ( ! mapContainer ) {
4949 return ;
5050 }
@@ -67,7 +67,7 @@ const GoogleMapProvider = (props: GoogleMapProviderProps): JSX.Element => {
6767 } ;
6868 // Create Google Map instance
6969 new GoogleMap ( mapOptions ) ;
70- } ) ;
70+ } ;
7171
7272 // Initializes map on mount
7373 useEffect ( ( ) => {
@@ -78,8 +78,8 @@ const GoogleMapProvider = (props: GoogleMapProviderProps): JSX.Element => {
7878 // create new map instance
7979 createGoogleMap ( ) ;
8080
81- // Destroy Google Map when component unmounts
82- return ( ) : void => {
81+ // Destroy Google Map when component unmounts
82+ return ( ) : void => {
8383 map && map . destroyComplete ( ) ;
8484 } ;
8585 } , [ ] ) ;
@@ -89,7 +89,7 @@ const GoogleMapProvider = (props: GoogleMapProviderProps): JSX.Element => {
8989 if ( ! map || ! mapContainer ) {
9090 return ;
9191 }
92-
92+
9393 // Destroy old map instance listeners
9494 map . destroyListeners ( ) ;
9595
You can’t perform that action at this time.
0 commit comments