react-google-maps-addons

Collection of addons for react-google-maps

Usage no npm install needed!

<script type="module">
  import reactGoogleMapsAddons from 'https://cdn.skypack.dev/react-google-maps-addons';
</script>

README

react-google-maps-addons

Collection of addons for react-google-maps

Addon Components: * Padding

Padding (offset)

It will add invisible divs to map controls at CENTER ControlPosition.

Aware of the padding: * opened InfoWindow

Unaware: * fitBounds, zoom, ... (for now... WIP)

Props

Name Type Default Examples
top, right, bottom, left String null "200px", "10%"

Example

import {GoogleMap} from "react-google-maps";
import {Padding} from "react-google-maps-addons";

export default function PaddedMap (props) {
    return (
        <section style={{height: "100%"}}>
            <GoogleMap containerProps={{
                    style: {
                        height: "100%",
                    },
                }}
                defaultZoom={3}
            >
                <Padding left="300px" />
                // other components...
            </GoogleMap>
        </section>
    );
}