<commit_before>'use strict';
/* global L */
import React from 'react';
import _ from 'lodash';

var AAMap = React.createClass({
  displayName: 'AAMap',

  propTypes: {
    bounds: React.PropTypes.array
  },

  mapInitialView: [10.995, 122.267],
  mapInitialZoom: 6,

  map: null,

  setupMap: function () {
    this.map = L.mapbox.map(this.refs.map, 'devseed.524e060f', { zoomControl: false, scrollWheelZoom: false })
      .setView(this.mapInitialView, this.mapInitialZoom);

    new L.Control.Zoom({ position: 'bottomright' }).addTo(this.map);
  },

  componentDidMount: function () {
    this.setupMap();
  },

  componentDidUpdate: function (prevProps) {
    if (this.props.bounds && this.props.bounds.length && !_.isEqual(prevProps.bounds, this.props.bounds)) {
      let b = this.props.bounds;
      this.map.fitBounds([
        [b[1], b[0]],
        [b[3], b[2]]
      ]);
    }
  },

  render: function () {
    return (
      <div className='aa-map-wrapper'>
        <div ref='map' className='aa-map'>{/* Map renders here */}</div>
      </div>
    );
  }
});

module.exports = AAMap;
<commit_msg>Add the road network layer. Fix developmentseed/openroads#288<commit_after>'use strict';
/* global L */
import React from 'react';
import _ from 'lodash';

var AAMap = React.createClass({
  displayName: 'AAMap',

  propTypes: {
    bounds: React.PropTypes.array
  },

  mapInitialView: [10.995, 122.267],
  mapInitialZoom: 6,

  map: null,

  setupMap: function () {
    this.map = L.mapbox.map(this.refs.map, 'devseed.524e060f', { zoomControl: false, scrollWheelZoom: false })
      .setView(this.mapInitialView, this.mapInitialZoom);

    L.tileLayer('http://50.16.162.86/{z}/{x}/{y}.png').addTo(this.map);
    new L.Control.Zoom({ position: 'bottomright' }).addTo(this.map);
  },

  componentDidMount: function () {
    this.setupMap();
  },

  componentDidUpdate: function (prevProps) {
    if (this.props.bounds && this.props.bounds.length && !_.isEqual(prevProps.bounds, this.props.bounds)) {
      let b = this.props.bounds;
      this.map.fitBounds([
        [b[1], b[0]],
        [b[3], b[2]]
      ]);
    }
  },

  render: function () {
    return (
      <div className='aa-map-wrapper'>
        <div ref='map' className='aa-map'>{/* Map renders here */}</div>
      </div>
    );
  }
});

module.exports = AAMap;

{'fraction_non_alphanumeric': 0.17710120068610635, 'fraction_numerical': 0.024013722126929673, 'mean_word_length': 3.008591065292096, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '6187380', 'n_tokens_mistral': 860, 'n_tokens_neox': 809, 'n_words': 159}