<commit_before>/**
 * @fileoverview Provides a drawn features service useful to share
 * information about the drawn features throughout the application.
 */

goog.provide('app.DrawnFeatures');

goog.require('app');
goog.require('ngeo.Location');
goog.require('ngeo.format.FeatureHash');
goog.require('ol.Collection');



/**
 * @constructor
 * @param {ngeo.Location} ngeoLocation Location service.
 * @param {app.Mymaps} appMymaps Mymaps service.
 * @ngInject
 */
app.DrawnFeatures = function(ngeoLocation, appMymaps) {

  /**
   * @type {app.Mymaps}
   * @private
   */
  this.appMymaps_ = appMymaps;

  /**
   * @type {ol.Collection}
   */
  this.features = new ol.Collection();

  /**
   * @type {ngeo.Location}
   * @private
   */
  this.ngeoLocation_ = ngeoLocation;

  /**
   * @const
   * @private
   */
  this.SHORT_PARAM_ = {
    'name' : 'n',
    'description': 'd',
    'color': 'c',
    'opacity': 'o',
    'stroke': 's',
    'linestyle': 'l',
    'shape': 's',
    'size': 't',
    'angle': 'a',
    'isLabel': 'i'
  };

  /**
   * @type {ngeo.format.FeatureHash}
   * @private
   */
  this.fhFormat_ = new ngeo.format.FeatureHash({
    encodeStyles: false,
    properties: (
        goog.bind(
        /**
         * @param {ol.Feature} feature Feature.
         * @return {Object.<string, (string|number)>} Properties to encode.
         */
        function(feature) {
          // Do not encode the __editable__ and __selected__ properties.<commit_msg>Use a unique short name<commit_after>/**
 * @fileoverview Provides a drawn features service useful to share
 * information about the drawn features throughout the application.
 */

goog.provide('app.DrawnFeatures');

goog.require('app');
goog.require('ngeo.Location');
goog.require('ngeo.format.FeatureHash');
goog.require('ol.Collection');



/**
 * @constructor
 * @param {ngeo.Location} ngeoLocation Location service.
 * @param {app.Mymaps} appMymaps Mymaps service.
 * @ngInject
 */
app.DrawnFeatures = function(ngeoLocation, appMymaps) {

  /**
   * @type {app.Mymaps}
   * @private
   */
  this.appMymaps_ = appMymaps;

  /**
   * @type {ol.Collection}
   */
  this.features = new ol.Collection();

  /**
   * @type {ngeo.Location}
   * @private
   */
  this.ngeoLocation_ = ngeoLocation;

  /**
   * @const
   * @private
   */
  this.SHORT_PARAM_ = {
    'angle': 'a',
    'color': 'c',
    'description': 'd',
    'stroke': 'e',
    'isLabel': 'i',
    'linestyle': 'l',
    'name' : 'n',
    'opacity': 'o',
    'shape': 's',
    'size': 't'
  };

  /**
   * @type {ngeo.format.FeatureHash}
   * @private
   */
  this.fhFormat_ = new ngeo.format.FeatureHash({
    encodeStyles: false,
    properties: (
        goog.bind(
        /**
         * @param {ol.Feature} feature Feature.
         * @return {Object.<string, (string|number)>} Properties to encode.
         */
        function(feature) {
          // Do not encode the __editable__ and __selected__ properties.
{'fraction_non_alphanumeric': 0.16757123473541383, 'fraction_numerical': 0.0, 'mean_word_length': 2.7281921618204805, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7144853', 'n_tokens_mistral': 1020, 'n_tokens_neox': 1001, 'n_words': 213}