@@ -8,7 +8,7 @@ import styles from './MapHistory.scss';
8
8
9
9
const DATE_FORMAT = 'YYYY-MM-DD HH:mm:ss' ;
10
10
11
- const tipFormatter = ( v ) => moment ( v ) . format ( DATE_FORMAT ) ;
11
+ const tipFormatter = ( v ) => moment ( v ) . format ( DATE_FORMAT ) ; // eslint-disable-line new-cap
12
12
13
13
class MapHistory extends React . Component {
14
14
constructor ( props ) {
@@ -44,7 +44,7 @@ class MapHistory extends React.Component {
44
44
45
45
// a overlay to translate from pixel to latlng and the reverse
46
46
this . overlay = new google . maps . OverlayView ( ) ;
47
- this . overlay . draw = ( ) => { } ;
47
+ this . overlay . draw = _ . noop ;
48
48
this . overlay . setMap ( this . map ) ;
49
49
50
50
// a info window to show location created date
@@ -58,7 +58,7 @@ class MapHistory extends React.Component {
58
58
// get map's bounds based on locations
59
59
getBounds ( ) {
60
60
const bounds = new google . maps . LatLngBounds ( ) ;
61
- _ . each ( this . props . locations , ( l ) => {
61
+ _ . forEach ( this . props . locations , ( l ) => {
62
62
bounds . extend ( _ . pick ( l , 'lat' , 'lng' ) ) ;
63
63
} ) ;
64
64
return bounds ;
@@ -86,7 +86,7 @@ class MapHistory extends React.Component {
86
86
} ) ;
87
87
88
88
// interpolate start location if not existed
89
- _ . each ( this . props . locations , ( l , i , c ) => {
89
+ _ . forEach ( this . props . locations , ( l , i , c ) => {
90
90
const time1 = new Date ( l . createdAt ) . getTime ( ) ;
91
91
if ( time1 >= this . dateRange [ 0 ] ) {
92
92
if ( time1 > this . dateRange [ 0 ] ) {
@@ -104,7 +104,7 @@ class MapHistory extends React.Component {
104
104
} ) ;
105
105
106
106
// interpolate end location if not existed
107
- _ . eachRight ( this . props . locations , ( l , i , c ) => {
107
+ _ . forEachRight ( this . props . locations , ( l , i , c ) => {
108
108
const time1 = new Date ( l . createdAt ) . getTime ( ) ;
109
109
if ( time1 <= this . dateRange [ 1 ] ) {
110
110
if ( time1 < this . dateRange [ 1 ] ) {
@@ -128,7 +128,7 @@ class MapHistory extends React.Component {
128
128
filterMarkers ( ) {
129
129
this . omitMarkers = 0 ;
130
130
let lastMarker ;
131
- _ . each ( this . markers , ( m ) => {
131
+ _ . forEach ( this . markers , ( m ) => {
132
132
if ( ! lastMarker ) {
133
133
lastMarker = m ;
134
134
m . setVisible ( true ) ;
@@ -166,7 +166,7 @@ class MapHistory extends React.Component {
166
166
167
167
// clear exsiting markers
168
168
if ( this . markers ) {
169
- _ . each ( this . markers , ( m ) => {
169
+ _ . forEach ( this . markers , ( m ) => {
170
170
m . setMap ( null ) ;
171
171
} ) ;
172
172
}
0 commit comments