<commit_before>import React, { Component } from "react";

import {
  GoogleMapLoader,
  GoogleMap,
} from "react-google-maps";

import { computeVoronoi } from './util/compute-voronoi';
import { customizeMap } from './util/customize-map';

const pragueLoc = { lat: 50.070569, lng: 14.419172 };

export default class SimpleMap extends Component {

  constructor(props) {
    super(props);
    this.setupMapB = this.setupMap.bind(this);
    this.handleMapClickB = this.handleMapClick.bind(this);
    this.handleHoverB = this.handleHover.bind(this);
  }

  componentWillReceiveProps(nextProps) {
    if (this.props.time !== nextProps.time) {
      this.updateMap(this.gmapRef, this.lastLat, this.lastLng);
      this.gmapRef.setMapTypeId(nextProps.time);
    }
  }

  handleMapClick(event) {
    this.updateMap(this.gmapRef, event.latLng.lat(), event.latLng.lng())
  }

  handleHover(stationName, travelTime) {
    this.props.onStopHover(stationName, travelTime)
  }

  updateMap(map, lat = pragueLoc.lat, lng = pragueLoc.lng) {
    this.lastLat = lat;
    this.lastLng = lng;
    fetch(`http://10.2.23.6:5000/accessibility?lat=${lat}&lng=${lng}&time=${this.props.time}`)
      .then(response => response.json())
      .then(data => {
        computeVoronoi(data.stations, map, this.handleHoverB)
      })
  }

  setupMap(ref) {
    const {map} = ref.props;
    this.gmapRef = map;
    this.updateMap(map);
    customizeMap(map);
  }

  render() {
    const props = this.props;
    const containerElement =(
      <div
        {...props.containerElementProps}
        style={{
          height: `100%`,
        }}
      />
    );

    const googleMapElement = (
      <GoogleMap
        time={props.time}
        ref={this.setupMapB}
        defaultZoom={12}
        defaultCenter={pragueLoc}
        onClick={this.handleMapClickB}
      />
    );

    return (
      <GoogleMapLoader
        containerElement={containerElement}
        googleMapElement={googleMapElement}
      />
    )
  }
}<commit_msg>Disable default map type buttons<commit_after>import React, { Component } from "react";

import {
  GoogleMapLoader,
  GoogleMap,
} from "react-google-maps";

import { computeVoronoi } from './util/compute-voronoi';
import { customizeMap } from './util/customize-map';

const pragueLoc = { lat: 50.070569, lng: 14.419172 };

export default class SimpleMap extends Component {

  constructor(props) {
    super(props);
    this.setupMapB = this.setupMap.bind(this);
    this.handleMapClickB = this.handleMapClick.bind(this);
    this.handleHoverB = this.handleHover.bind(this);
  }

  componentWillReceiveProps(nextProps) {
    if (this.props.time !== nextProps.time) {
      this.updateMap(this.gmapRef, this.lastLat, this.lastLng);
      this.gmapRef.setMapTypeId(nextProps.time);
    }
  }

  handleMapClick(event) {
    this.updateMap(this.gmapRef, event.latLng.lat(), event.latLng.lng())
  }

  handleHover(stationName, travelTime) {
    this.props.onStopHover(stationName, travelTime)
  }

  updateMap(map, lat = pragueLoc.lat, lng = pragueLoc.lng) {
    this.lastLat = lat;
    this.lastLng = lng;
    fetch(`http://10.2.22.105:5555/accessibility?lat=${lat}&lng=${lng}&time=${this.props.time}`)
      .then(response => response.json())
      .then(data => {
        computeVoronoi(data.stations, map, this.handleHoverB)
      })
  }

  setupMap(ref) {
    const {map} = ref.props;
    this.gmapRef = map;
    this.updateMap(map);
    customizeMap(map);
  }

  render() {
    const props = this.props;
    const containerElement =(
      <div
        {...props.containerElementProps}
        style={{
          height: `100%`,
        }}
      />
    );

    const googleMapElement = (
      <GoogleMap
        time={props.time}
        ref={this.setupMapB}
        defaultZoom={12}
        defaultCenter={pragueLoc}
        defaultOptions={{
          streetViewControl: false,
          mapTypeControl: false,
        }}
        mapTypeControl={false}
        onClick={this.handleMapClickB}
      />
    );

    return (
      <GoogleMapLoader
        containerElement={containerElement}
        googleMapElement={googleMapElement}
      />
    )
  }
}
{'fraction_non_alphanumeric': 0.1389423076923077, 'fraction_numerical': 0.015384615384615385, 'mean_word_length': 2.7827272727272727, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4299390', 'n_tokens_mistral': 1443, 'n_tokens_neox': 1384, 'n_words': 212}