<commit_before>'use strict';

var React         = require('react');
var MapStore      = require('../stores/mapStore');
var Reflux        = require('reflux');
var Actions       = require('../actions');
var searchFactory = require('../leafletComponents/controlFrame');
var Constants     = require('../constants');


//TODO
// - Move "magic strings" to constants
// - Clean up "componentDidMount" funciton
// - DONE - Update map style
// - DONE - Make map full screen then remove style from main.less
// - Update map logo with Medelling heritage

var Map = React.createClass({
  componentDidMount: function () {
    var result;
    var items = MapStore.getFilteredHeritageItems();
    var filters = MapStore.getHeritageCategories();
    var map = this.map = L.map(this.getDOMNode(), {
      center: [6.201000, -75.572138],
      zoom: 15,
      minZoom: 2,
      maxZoom: 30,
      zoomControl: false
    });
    
    Reflux.ListenerMethods.listenTo(Actions.itemSelected, function (selectedFeature) {
      var lng = selectedFeature.geometry.coordinates[0];
      var lat = selectedFeature.geometry.coordinates[1];
      map.panTo(new L.LatLng(lat, lng));
    });

    L.tileLayer(
      'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {
        attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',
        maxZoom: 30,
        id: 'rickymetz.9458305e',
        accessToken: 'pk.eyJ1Ijoicmlja3ltZXR6IiwiYSI6IjQ0MDkxNWJiOTU0ZWJmMzNkMGVlODZiOWM0ODgwNmMwIn0.n3vqv0FdFTjASE09SDiUSg'
      }
    ).addTo(map);

    var statueIcon = new L.Icon({ iconUrl: Constants.icons.sculpture });
    var archsiteIcon = new L.Icon({ iconUrl: Constants.icons.archSite });

    var geoJsonLayer = L.geoJson(items, { onEachFeature: content }).addTo(map);

    var zoomCtrl = L.control.zoom({ position: 'bottomleft' });
    zoomCtrl.addTo(map);

    var searchCtrlOpts = {
      position: 'topleft'
    };
    var searchCtrl = searchFactory(searchCtrlOpts);
    searchCtrl.addTo(map);

    MapStore.listen(onSearch);
<commit_msg>updated zoom setting so map wouldn't disappear<commit_after>'use strict';

var React         = require('react');
var MapStore      = require('../stores/mapStore');
var Reflux        = require('reflux');
var Actions       = require('../actions');
var searchFactory = require('../leafletComponents/controlFrame');
var Constants     = require('../constants');


//TODO
// - Move "magic strings" to constants
// - Clean up "componentDidMount" funciton
// - DONE - Update map style
// - DONE - Make map full screen then remove style from main.less
// - Update map logo with Medelling heritage

var Map = React.createClass({
  componentDidMount: function () {
    var result;
    var items = MapStore.getFilteredHeritageItems();
    var filters = MapStore.getHeritageCategories();
    var map = this.map = L.map(this.getDOMNode(), {
      center: [6.201000, -75.572138],
      zoom: 15,
      minZoom: 2,
      maxZoom: 22,
      zoomControl: false
    });
    
    Reflux.ListenerMethods.listenTo(Actions.itemSelected, function (selectedFeature) {
      var lng = selectedFeature.geometry.coordinates[0];
      var lat = selectedFeature.geometry.coordinates[1];
      map.panTo(new L.LatLng(lat, lng));
    });

    L.tileLayer(
      'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {
        attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',
        maxZoom: 22,
        id: 'rickymetz.9458305e',
        accessToken: '<KEY>'
      }
    ).addTo(map);

    var statueIcon = new L.Icon({ iconUrl: Constants.icons.sculpture });
    var archsiteIcon = new L.Icon({ iconUrl: Constants.icons.archSite });

    var geoJsonLayer = L.geoJson(items, { onEachFeature: content }).addTo(map);

    var zoomCtrl = L.control.zoom({ position: 'bottomleft' });
    zoomCtrl.addTo(map);

    var searchCtrlOpts = {
      position: 'topleft'
    };
    var searchCtrl = searchFactory(searchCtrlOpts);
    searchCtrl.addTo(map);

    MapStore.listen(onSearch);

{'fraction_non_alphanumeric': 0.1497584541062802, 'fraction_numerical': 0.01840349666436623, 'mean_word_length': 3.2254616132167153, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '3495485', 'n_tokens_mistral': 1489, 'n_tokens_neox': 1417, 'n_words': 296}