1
1
import React from 'react' ;
2
2
import PropTypes from 'prop-types' ;
3
3
import { compose , withProps , withStateHandlers } from 'recompose' ;
4
- import { withScriptjs , withGoogleMap , GoogleMap , Circle , Polyline , InfoWindow } from 'react-google-maps' ;
4
+ import { withScriptjs , withGoogleMap , GoogleMap , Marker , Polyline , InfoWindow } from 'react-google-maps' ;
5
5
6
6
import styles from './GoogleMap.module.scss' ;
7
7
import { GOOGLE_MAP_API_KEY } from '../../../../constants' ;
@@ -34,7 +34,7 @@ const Map = compose(
34
34
withProps ( {
35
35
googleMapURL : `https://maps.googleapis.com/maps/api/js?key=${ GOOGLE_MAP_API_KEY } &v=3.exp&libraries=geometry,drawing,places` ,
36
36
loadingElement : < div style = { { height : '100%' } } /> ,
37
- containerElement : < div style = { { height : '500px ' } } /> ,
37
+ containerElement : < div style = { { height : '650px ' } } /> ,
38
38
mapElement : < div style = { { height : '100%' } } /> ,
39
39
} ) ,
40
40
withStateHandlers ( ( ) => ( {
@@ -64,17 +64,16 @@ const Map = compose(
64
64
defaultCenter = { defaultCenter }
65
65
>
66
66
{ ips . map ( ( item , index ) =>
67
- < Circle
67
+ < Marker
68
68
key = { index }
69
69
onClick = { ( ) => onToggleInfoWindow ( infoWindow . display , item ) }
70
70
options = { {
71
- center : { lat : item . lat , lng : item . lng } ,
72
- radius : 30000 ,
73
- fillColor : item . self ? '#ff0000' : '#0000ff' ,
74
- fillOpacity : 0.6 ,
75
- strokeWeight : 1 ,
76
- strokeOpacity : 0.8 ,
77
- strokeColor : item . self ? '#ff0000' : '#0000ff' ,
71
+ position : { lat : item . lat , lng : item . lng } ,
72
+ icon : item . self ? '' : {
73
+ url : require ( './destination.png' ) ,
74
+ scaledSize : { width : 16 , height : 16 } ,
75
+ anchor : { x : 8 , y : 8 } ,
76
+ } ,
78
77
} }
79
78
/>
80
79
) }
@@ -84,8 +83,7 @@ const Map = compose(
84
83
options = { {
85
84
path : [ defaultCenter , { lat : item . lat , lng : item . lng } ] ,
86
85
strokeWeight : 1 ,
87
- strokeOpacity : 0.8 ,
88
- strokeColor : item . inbound ? '#FFC940' : '#669EFF' ,
86
+ strokeColor : item . inbound ? '#ff8d1f' : '#6b6d70' ,
89
87
} }
90
88
/>
91
89
) }
@@ -125,7 +123,7 @@ export default class _GoogleMap extends React.Component {
125
123
126
124
render ( ) {
127
125
const { ips } = this . state ;
128
- const self = ips . filter ( ( { self } ) => self ) [ 0 ] || { lat : 0 , lng : 0 } ;
126
+ const self = ips . filter ( ( { self } ) => self ) [ 0 ] || { lat : 21.289 , lng : - 175.253 } ;
129
127
return (
130
128
< div className = { styles . container } >
131
129
< Map
0 commit comments