{"size": 1064, "ext": "js", "max_stars_repo_path": "client/analytics/components/partials/maps/Route.js", "max_stars_repo_name": "Haaarp/geo", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "client/analytics/components/partials/maps/Route.js", "max_issues_repo_name": "Haaarp/geo", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "client/analytics/components/partials/maps/Route.js", "max_forks_repo_name": "Haaarp/geo", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.1666666667, "max_line_length": 74, "alphanum_fraction": 0.5422932331}
import React from 'react';
import { connect } from 'react-redux';

import { Polyline } from 'react-google-maps';
import { map } from './../../../actions';

const initialConfig = {
    strokeColor: '#00ccbe',
    strokeOpacity: 1.0,
    strokeWeight: 1
};

class Route extends React.Component {
    constructor (props) {
        super(props);

        this.state = {hovered: false};
    }

    getStyle () {
        let style = initialConfig;
        if (this.props.selected) {
            style = Object.assign({}, style, {strokeColor: '#000'});
        }

        return style;
    }

    render () {
        return (
            <Polyline
                mapHolderRef={this.props.mapHolderRef}
                path={this.props.routeSegment}
                geodesic={true}
                key={this.props.key}
                options={this.getStyle()} />
        );
    }
}

const stateMap = (state, props, ownProps) => {
    return {
        selected : (state.selected.routes.indexOf(props.route.id) !== -1),
    };
};

export default connect(stateMap)(Route);
