'use strict';
define(function() {
  var mapBlock = function() {
    return {
      restrict: 'AE',
      templateUrl: 'js/XG/modules/print/views/directives/blocks/mapBlock.html',
      //controllerAs: 'ModelGUICtrl',
      scope: {
        pagemanager: '=pagemanager',
        selectmanager: '=selectmgr',
      },
      link: function(scope) {
        scope.newBlock = function() {
          var block = {
            label: 'Carte',
            type: 'mapBlock',
            render: {
              color: '#009084',
              w: 300,
              h: 300,
            },
            data: {
              class: 'org.mapfish.print.config.layout.MapBlock',
              spacingAfter: '30',
              absoluteX: 0,
              absoluteY: 0,
              width: '300',
              height: '300',
              borderSize: '2',
            },
          };
          scope.selectmanager.add(block);
        };
        scope.delBlock = function() {
          scope.deletefct();
        };
      },
    };
  };

  mapBlock.$inject = [];
  return mapBlock;
});
