zhongrj
2023-06-27 d74b495736f0c04522ec54274b70fed0ded2878d
public/map/controls/toolbar/tools/NavBaseTool.js
New file
@@ -0,0 +1,44 @@
/**
* 地图浏览工具的基类
* @author 温杨彪 2015-9-13
**/
define([
"dojo",
"dojo/_base/declare",
"controls/toolbar/tools/BaseTool",
"esri/toolbars/navigation"
], function(
  dojo,
  declare,
  BaseTool,
  Navigation
) {
  var RL = declare([BaseTool], {
     _navTool:null,
     _navType:"",
    constructor: function(args) {
    },
    activate:function(args)
    {
       if(this._activated || !this._enable)
         return;
       this.inherited(arguments);
       this._navTool.activate(this._navType);
    },
    postCreate:function()
    {
       this.inherited(arguments);
       this._navTool = new Navigation(this.map);
    },
    deactivate:function()
    {
       if(!this._enable || !this._activated)
         return;
       this.inherited(arguments);
       this._navTool.deactivate();
    }
  });
  return RL;
});