'use strict';
define(function() {
  var basemapwidget = function(
    gcPropertiesLayers,
    gclayers,
    ParametersFactory,
    gcPopup,
    extendedNgDialog,
    gaDomUtils,
    GeoTreatmentFactory,
    $timeout,
    QueryFactory
  ) {
    return {
      templateUrl:
        'js/XG/widgets/mapapp/geotreatment/views/corrections/correctFusion.html',

      restrict: 'A',

      link: function(scope, elt, attrs, ctrl) {
        var map = scope.map;
        scope.activetreatment = '';
        scope.res = {};
        scope.selecteditem = {};
        scope.attributes_select = [];

        scope.correct = function(geometry, id, historize) {
          var param = {
            fti1: fti1.uid,
            attributes: attr,
          };
        };
        scope.update = function() {
          QueryFactory.get(scope.fti1.uid, scope.idchoose).then(function(res) {
            console.log(res.data);
            scope.selecteditem = res.data.features[0];
          });
        };
      },
    };
  };

  basemapwidget.$inject = [
    'gcPropertiesLayers',
    'gclayers',
    'ParametersFactory',
    'gcPopup',
    'extendedNgDialog',
    'gaDomUtils',
    'GeoTreatmentFactory',
    '$timeout',
    'QueryFactory',
  ];
  return basemapwidget;
});
