<commit_before>angular.module('main').directive('leaflet', [
           'leaflet', 'langManager', '$http', 'apiClient', '$timeout', 'item',
  function (leaflet, langManager, $http, apiClient, $timeout, item) {
    return {
      template: '<div></div>',
      replace: true,
      scope: {
        previewData: '='
      },

      link: function ($scope, element, attributes) {

        $scope.$watchCollection(function(){return $scope.previewData}, function(newVal, oldVal) {
          if(Object.keys(newVal).length && newVal.geometry) {
            get_map(newVal);
          }
        });

        function get_map(data) {
          var lang = langManager.lang,
              cap_lang = lang[0].toUpperCase() + lang.slice(1),
              active_place_title = data.Header[cap_lang];


          //set map center
          var act_lat = data.geometry.coordinates[1],
              act_lng = data.geometry.coordinates[0],
              map = L.map(element[0])
              .setView([act_lat, act_lng], 10);

          $timeout(function () {
            map.invalidateSize();
           }, 0);

          //add tiles
          var pngTiles = L.tileLayer('http://stamen-tiles-{s}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png', {
            attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',
            maxZoom: 10,
            minZoom:7,
            subdomains: ['a', 'b', 'c']
          }).addTo(map);

          //build custom markers
          var smCustomIcon = L.Icon.extend({
              options: {
                iconSize: [19.5, 27], iconAnchor: [10, 27], popupAnchor: [0, -27]
              }
          });

          var bgCustomIcon = L.Icon.extend({
              options: {
                iconSize: [26.25, 35], iconAnchor: [13, 35], popupAnchor: [0, -35]
              }
          });

          var active_icon_s = new smCustomIcon({iconUrl: '/images/active_marker.png'}),
              icon_s = new smCustomIcon({iconUrl: '/images/blue_marker.png'}),
              active_icon_b = new bgCustomIcon({iconUrl: '/images/active_marker.png'}),
              icon_b = new bgCustomIcon({iconUrl: '/images/blue_marker.png'});

          var place_type = data.PlaceTypeDesc['En'];
              active_icon = eval(get_active_icon(place_type));

          var mark = L.marker([act_lat, act_lng], {icon: active_icon, title: active_place_title})
                    .on('click', function(e) { item.get_marker_link(data.Slug[cap_lang])})
                    .addTo(map);<commit_msg>Change default zoom level of map<commit_after>angular.module('main').directive('leaflet', [
           'leaflet', 'langManager', '$http', 'apiClient', '$timeout', 'item',
  function (leaflet, langManager, $http, apiClient, $timeout, item) {
    return {
      template: '<div></div>',
      replace: true,
      scope: {
        previewData: '='
      },

      link: function ($scope, element, attributes) {

        $scope.$watchCollection(function(){return $scope.previewData}, function(newVal, oldVal) {
          if(Object.keys(newVal).length && newVal.geometry) {
            get_map(newVal);
          }
        });

        function get_map(data) {
          var lang = langManager.lang,
              cap_lang = lang[0].toUpperCase() + lang.slice(1),
              active_place_title = data.Header[cap_lang];


          //set map center
          var act_lat = data.geometry.coordinates[1],
              act_lng = data.geometry.coordinates[0],
              map = L.map(element[0])
              .setView([act_lat, act_lng], 7);

          $timeout(function () {
            map.invalidateSize();
           }, 0);

          //add tiles
          var pngTiles = L.tileLayer('http://stamen-tiles-{s}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png', {
            attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',
            maxZoom: 10,
            minZoom: 7,
            subdomains: ['a', 'b', 'c']
          }).addTo(map);

          //build custom markers
          var smCustomIcon = L.Icon.extend({
              options: {
                iconSize: [19.5, 27], iconAnchor: [10, 27], popupAnchor: [0, -27]
              }
          });

          var bgCustomIcon = L.Icon.extend({
              options: {
                iconSize: [26.25, 35], iconAnchor: [13, 35], popupAnchor: [0, -35]
              }
          });

          var active_icon_s = new smCustomIcon({iconUrl: '/images/active_marker.png'}),
              icon_s = new smCustomIcon({iconUrl: '/images/blue_marker.png'}),
              active_icon_b = new bgCustomIcon({iconUrl: '/images/active_marker.png'}),
              icon_b = new bgCustomIcon({iconUrl: '/images/blue_marker.png'});

          var place_type = data.PlaceTypeDesc['En'];
              active_icon = eval(get_active_icon(place_type));

          var mark = L.marker([act_lat, act_lng], {icon: active_icon, title: active_place_title})
                    .on('click', function(e) { item.get_marker_link(data.Slug[cap_lang])})
                    .addTo(map);
{'fraction_non_alphanumeric': 0.1529064039408867, 'fraction_numerical': 0.013990147783251231, 'mean_word_length': 1.9771260997067448, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '3132549', 'n_tokens_mistral': 1602, 'n_tokens_neox': 1513, 'n_words': 283}