Skip to content

Instantly share code, notes, and snippets.

@sabesansathananthan
Created April 30, 2020 22:09
Show Gist options
  • Save sabesansathananthan/1b2e63c3284c3f792b7297c54bfaa7c0 to your computer and use it in GitHub Desktop.
Save sabesansathananthan/1b2e63c3284c3f792b7297c54bfaa7c0 to your computer and use it in GitHub Desktop.
How to use the Google Maps API with Custom styling in React.js
import googleMapStyles from "./GoogelMapStyle";
export class Maps extends React.Component {
render() {
return (
<Map
google={this.props.google}
zoom={8}
style={this.props.mapStyle}
initialCenter={{ lat: 9.761927, lng: 79.95244 }}
>
<Marker position={{ lat: 9.761927, lng: 79.95244 }} />
</Map>
);
}
}
Maps.defaultProps = googleMapStyles;
export default GoogleApiWrapper({
apiKey: "API_KEY",
})(Maps);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment