Skip to content

Commit

Permalink
Merge pull request #676 from SUI-Components/feat/add-map-id-to-google…
Browse files Browse the repository at this point in the history
…-map

feat: Add support to inject mapId prop to google map component
  • Loading branch information
Pato2790 authored Nov 26, 2024
2 parents 1f9c39e + a074019 commit 7fd205d
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions components/map/google/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,26 @@ function MapGoogle({
center = DEFAULT_CENTER,
children,
errorNode,
isInteractive: isInteractiveProp,
height,
width,
isInteractive: isInteractiveProp,
language = DEFAULT_LANGUAGE,
loaderNode,
staticImageNode,
zoom = DEFAULT_ZOOM,
mapIds,
onError,
onLoad,
onUnmount,
signedUrl,
staticImageNode,
width,
zoom = DEFAULT_ZOOM,
...others
}) {
const [isInteractive, setIsInteractive] = useControlledState(isInteractiveProp)

const {isLoaded, loadError} = useLoadScript({
googleMapsApiKey: apiKey,
language
language,
mapIds
})

const handleOnLoad = useCallback(
Expand Down Expand Up @@ -107,16 +109,17 @@ MapGoogle.propTypes = {
children: PropTypes.node,
errorNode: PropTypes.node,
height: PropTypes.number,
width: PropTypes.number,
isInteractive: PropTypes.bool,
language: PropTypes.string,
loaderNode: PropTypes.node,
mapIds: PropTypes.array,
onError: PropTypes.func,
onLoad: PropTypes.func,
onUnmount: PropTypes.func,
signedUrl: PropTypes.string,
staticImageNode: PropTypes.node,
zoom: PropTypes.number,
signedUrl: PropTypes.string
width: PropTypes.number,
zoom: PropTypes.number
}

export default MapGoogle
Expand Down

0 comments on commit 7fd205d

Please sign in to comment.