Maps.jsx
1.46 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
/*!
=========================================================
* Light Bootstrap Dashboard React - v1.3.0
=========================================================
* Product Page: https://www.creative-tim.com/product/light-bootstrap-dashboard-react
* Copyright 2019 Creative Tim (https://www.creative-tim.com)
* Licensed under MIT (https://github.com/creativetimofficial/light-bootstrap-dashboard-react/blob/master/LICENSE.md)
* Coded by Creative Tim
=========================================================
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*/
import React from "react";
// react components used to create a google map
import {
withScriptjs,
withGoogleMap,
GoogleMap,
Marker
} from "react-google-maps";
const CustomMap = withScriptjs(
withGoogleMap(props => (
<GoogleMap
defaultZoom={13}
defaultCenter={{ lat: 40.748817, lng: -73.985428 }}
defaultOptions={{
scrollwheel: false,
zoomControl: true
}}
>
<Marker position={{ lat: 40.748817, lng: -73.985428 }} />
</GoogleMap>
))
);
function Maps({ ...prop }) {
return (
<CustomMap
googleMapURL="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY_HERE"
loadingElement={<div style={{ height: `100%` }} />}
containerElement={<div style={{ height: `100vh` }} />}
mapElement={<div style={{ height: `100%` }} />}
/>
);
}
export default Maps;