Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc738143

Browse files
author
gondzo
committed
location history lint issues fix
1 parent3b8c8fd commitc738143

File tree

6 files changed

+32
-22
lines changed

6 files changed

+32
-22
lines changed

‎src/components/MapHistory/MapHistory.jsx‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
importReact,{PropTypes}from'react';
1+
importReact,{PropTypes}from'react';
22
importCSSModulesfrom'react-css-modules';
33
import_from'lodash';
44
importmomentfrom'moment';
@@ -28,7 +28,9 @@ class MapHistory extends React.Component {
2828
}
2929

3030
componentDidMount(){
31-
if(this.props.locations.length===0)return;
31+
if(this.props.locations.length===0){
32+
return;
33+
}
3234
constbounds=this.getBounds();
3335
constmapSettings={
3436
center:bounds.getCenter(),
@@ -164,7 +166,9 @@ class MapHistory extends React.Component {
164166

165167
// clear exsiting markers
166168
if(this.markers){
167-
_.each(this.markers,(m)=>{m.setMap(null);});
169+
_.each(this.markers,(m)=>{
170+
m.setMap(null);
171+
});
168172
}
169173

170174
// create markers based on filtered locations
@@ -206,7 +210,11 @@ class MapHistory extends React.Component {
206210
this.props.locations.length===0 ?
207211
(<divstyleName="no-history">No location history</div>) :
208212
(<divstyleName="history-wrap">
209-
<divstyleName="map-history"ref={(node)=>{this.node=node;}}/>
213+
<div
214+
styleName="map-history"ref={(node)=>{
215+
this.node=node;
216+
}}
217+
/>
210218
<divstyleName="history-toolbar">
211219
<divstyleName="slider">
212220
<Slider

‎src/routes/DronesMap/components/DronesMapView.jsx‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
importReact,{PropTypes}from'react';
1+
importReact,{PropTypes}from'react';
22
importCSSModulesfrom'react-css-modules';
33
importMarkerClustererfrom'node-js-marker-clusterer';
44
importMapHistoryfrom'components/MapHistory';
@@ -20,7 +20,7 @@ const getIcon = (status) => {
2020

2121
constHIDE_INFO_DELAY=500;
2222

23-
constgetLatLng=({currentLocation})=>({lng:currentLocation[0],lat:currentLocation[1]});
23+
constgetLatLng=({currentLocation})=>({lng:currentLocation[0],lat:currentLocation[1]});
2424

2525
constgetMarkerPoint=(marker,overlay)=>(overlay.getProjection().fromLatLngToContainerPixel(marker.getPosition()));
2626

@@ -35,12 +35,14 @@ class DronesMapView extends React.Component {
3535
}
3636

3737
componentDidMount(){
38-
const{drones, mapSettings, showInfo, hideInfo}=this.props;
38+
const{drones, mapSettings, showInfo, hideInfo}=this.props;
3939
this.map=newgoogle.maps.Map(this.node,mapSettings);
4040
constoverlay=newgoogle.maps.OverlayView();
4141
overlay.draw=()=>{};
4242
overlay.setMap(this.map);
43-
consthideInfoWindow=()=>{this.props.infoDrone&&hideInfo();};
43+
consthideInfoWindow=()=>{
44+
this.props.infoDrone&&hideInfo();
45+
};
4446
this.map.addListener('zoom_changed',hideInfoWindow);
4547
this.map.addListener('dragstart',hideInfoWindow);
4648
constid2Marker={};
@@ -73,11 +75,11 @@ class DronesMapView extends React.Component {
7375
returnmarker;
7476
});
7577
this.id2Marker=id2Marker;
76-
this.markerCluster=newMarkerClusterer(this.map,markers,{imagePath:'/img/m'});
78+
this.markerCluster=newMarkerClusterer(this.map,markers,{imagePath:'/img/m'});
7779
}
7880

7981
componentWillReceiveProps(nextProps){
80-
const{drones}=nextProps;
82+
const{drones}=nextProps;
8183
drones.forEach((drone)=>{
8284
constmarker=this.id2Marker[drone.id];
8385
if(marker){
@@ -114,7 +116,7 @@ class DronesMapView extends React.Component {
114116
<divstyleName="map-view"ref={(node)=>(this.node=node)}/>
115117
{
116118
this.props.infoDrone ?
117-
(<divstyleName="map-popover"onMouseEnter={this.cancelHideInfo}onMouseLeave={this.props.hideInfo}style={{top:this.props.infoPos.y-30,left:this.props.infoPos.x}}>
119+
(<divstyleName="map-popover"onMouseEnter={this.cancelHideInfo}onMouseLeave={this.props.hideInfo}style={{top:this.props.infoPos.y-30,left:this.props.infoPos.x}}>
118120
<Infodrone={this.props.infoDrone}showHistory={this.showHistory}/>
119121
</div>) :null
120122
}

‎src/routes/DronesMap/components/Info/Info.jsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
importReact,{PropTypes}from'react';
1+
importReact,{PropTypes}from'react';
22
importCSSModulesfrom'react-css-modules';
33
importstylesfrom'./Info.scss';
44

5-
exportconstInfo=({drone:{name, serialNumber}, showHistory})=>(
5+
exportconstInfo=({drone:{name, serialNumber}, showHistory})=>(
66
<divstyleName="info">
77
<divstyleName="group">
88
<divstyleName="label">Drone Name</div>

‎src/routes/DronesMap/modules/DronesMap.js‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,23 @@ export const disconnect = () => () => {
6565

6666
// get location history of drone
6767
exportconstgetLocations=(id)=>async(dispatch)=>{
68-
const{body:{items:locations}}=awaitAPIService.getLocations(id,LOCATION_LIMIT);
69-
dispatch({type:LOCATIONS_LOADED,payload:{drone:id,locations:_.reverse(locations)}});
68+
const{body:{items:locations}}=awaitAPIService.getLocations(id,LOCATION_LIMIT);
69+
dispatch({type:LOCATIONS_LOADED,payload:{drone:id,locations:_.reverse(locations)}});
7070
};
7171

7272
// clear location history of drone
7373
exportconsthideHistory=()=>(dispatch)=>{
74-
dispatch({type:HIDE_HISTORY});
74+
dispatch({type:HIDE_HISTORY});
7575
};
7676

7777
// show info window of drone
7878
exportconstshowInfo=(drone,pos)=>(dispatch)=>{
79-
dispatch({type:SHOW_DRONE_INFO,payload:{drone, pos}});
79+
dispatch({type:SHOW_DRONE_INFO,payload:{drone, pos}});
8080
};
8181

8282
// hide info window of drone
8383
exportconsthideInfo=()=>(dispatch)=>{
84-
dispatch({type:HIDE_DRONE_INFO});
84+
dispatch({type:HIDE_DRONE_INFO});
8585
};
8686

8787
exportconstactions={
@@ -105,8 +105,8 @@ export default handleActions({
105105
returnupdated||drone;
106106
}),
107107
}),
108-
[LOCATIONS_LOADED]:(state,{payload:{drone, locations}})=>({...state,historyDrone:drone, locations}),
109-
[SHOW_DRONE_INFO]:(state,{payload:{drone, pos}})=>({
108+
[LOCATIONS_LOADED]:(state,{payload:{drone, locations}})=>({...state,historyDrone:drone, locations}),
109+
[SHOW_DRONE_INFO]:(state,{payload:{drone, pos}})=>({
110110
...state,
111111
infoDrone:drone,
112112
infoPos:pos,

‎src/services/APIService.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,6 @@ export default class APIService {
586586
*@returns {{total: Number, items: Array}} the result
587587
*/
588588
staticgetLocations(id,limit){
589-
returnrequest.get(`${config.api.basePath}/api/v1/droneposition/${id}`).query({limit}).end();
589+
returnrequest.get(`${config.api.basePath}/api/v1/droneposition/${id}`).query({limit}).end();
590590
}
591591
}

‎webpack.config.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ module.exports = {
162162
loaders:['style','css?modules'],
163163
include:/flexboxgrid/,
164164
}),
165-
fixStyleLoader({
165+
fixStyleLoader({
166166
test:/\.css$/,
167167
loaders:['style','css'],
168168
include:/rc-slider/,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp