'use strict';
define(function() {
  var toolbargeosignet = function() {
    return {
      templateUrl: 'js/XG/widgets/mapapp/geosignet/views/toolbargeosignet.html',
      restrict: 'A',

      link: function(scope, element, attrs, ctrl) {
        var m = scope.map;
        var cf = scope.config;

        // alert (m);
        element.bind('click', function() {
          //alert(m);
          //scope.addtools({title: "Géosignet", name: "Geosignet" ,directive:"geosignetwidget"});

          scope.addtools({
            title: 'Geosignet',
            name: 'Project',
            directive: 'geosignetwidget',
            config: 'creation_projet_01',
          });
          try {
            scope.$apply(scope);
          } catch(err) {}
        });
      },
    };
  };

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