<commit_before>angular.module('magna-app')

.directive('ol3Map', ['$timeout', '$websocket', 'magnaConfig', 'ProjectService',
  function($timeout, $websocket, magnaConfig, ProjectService) {
    return {
      restrict: 'A',
      scope: {
          staticMap: '@',
          styles: '=',
          settings: '=ol3Map',
          gridsterItemElement: '='
      },
      link: {
        pre: function(scope) {
          var createMMLString = function() {
            var styles = [];
            angular.forEach(scope.styles, function(styleObj) {
              if(styleObj.active) {
                styles.push(styleObj.style);
              }
            });
            return styles.join(',');
          };

          scope.updateSource = function() {
            scope.params.mss = createMMLString();
            scope.params.t = Date.now();
            scope.params.wsid = scope.wsid;
            scope.olSource.updateParams(scope.params);

            if (scope.layer.source === undefined) {
              scope.layer.setSource(scope.olSource);
            }
          };

          scope.socket = ProjectService.getSocket();
          scope.staticMap = scope.staticMap === 'true' ? true : false;

          // intialize with default values
          scope.olControls = [];
          scope.olInteractions = [];
          if(scope.staticMap === false) {
            scope.olControls = ol.control.defaults();
            scope.olInteractions = ol.interaction.defaults({
              pinchZoom: false
            });
            scope.olInteractions.extend([
              new ol.interaction.PinchZoom({
                constrainResolution: true
              })
            ]);
          }
          scope.params = {
            LAYERS: magnaConfig.mapnikLayers,
            TRANSPARENT: false,
            VERSION: '1.1.1',
            mml: ProjectService.project.mml,
            mss: createMMLString,
            base: ProjectService.project.base,
            wsid: ProjectService.project.wsid,<commit_msg>Renamed function and fixed parameter assignment<commit_after>angular.module('magna-app')

.directive('ol3Map', ['$timeout', '$websocket', 'magnaConfig', 'ProjectService',
  function($timeout, $websocket, magnaConfig, ProjectService) {
    return {
      restrict: 'A',
      scope: {
          staticMap: '@',
          styles: '=',
          settings: '=ol3Map',
          gridsterItemElement: '='
      },
      link: {
        pre: function(scope) {
          var createMSSString = function() {
            var styles = [];
            angular.forEach(scope.styles, function(styleObj) {
              if(styleObj.active) {
                styles.push(styleObj.style);
              }
            });
            return styles.join(',');
          };

          scope.updateSource = function() {
            scope.params.mss = createMSSString();
            scope.params.t = Date.now();
            scope.params.wsid = scope.wsid;
            scope.olSource.updateParams(scope.params);

            if (scope.layer.source === undefined) {
              scope.layer.setSource(scope.olSource);
            }
          };

          scope.socket = ProjectService.getSocket();
          scope.staticMap = scope.staticMap === 'true' ? true : false;

          // intialize with default values
          scope.olControls = [];
          scope.olInteractions = [];
          if(scope.staticMap === false) {
            scope.olControls = ol.control.defaults();
            scope.olInteractions = ol.interaction.defaults({
              pinchZoom: false
            });
            scope.olInteractions.extend([
              new ol.interaction.PinchZoom({
                constrainResolution: true
              })
            ]);
          }
          scope.params = {
            LAYERS: magnaConfig.mapnikLayers,
            TRANSPARENT: false,
            VERSION: '1.1.1',
            mml: ProjectService.project.mml,
            mss: createMSSString(),
            base: ProjectService.project.base,
            wsid: ProjectService.project.wsid,
{'fraction_non_alphanumeric': 0.12370625924100542, 'fraction_numerical': 0.0024642681123706258, 'mean_word_length': 1.622093023255814, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '2744024', 'n_tokens_mistral': 1094, 'n_tokens_neox': 1070, 'n_words': 178}