Created
April 30, 2020 22:09
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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