index.js
771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import React, { Component } from "react";
import { Map, GoogleApiWrapper, Marker } from 'google-maps-react';
import './style.css';
const mapStyles = {
width: '600px',
height: '600px',
};
class Demo1 extends Component {
constructor() {
super();
this.state = {
name: "React"
};
}
render() {
return (
<div class="map">
<Map
google={this.props.google}
zoom={14}
style={mapStyles}
initialCenter={{
lat: '37.5905144',
lng: '127.0576477'
}}
>
<Marker
onClick={this.onMarkerClick}
/>
</Map>
</div>
);
}
}
export default GoogleApiWrapper({
apiKey: 'AIzaSyAguo3zH8vWZJbzXEqyp8D8UvnBh3zX8rQ'
})(Demo1);