zengh
2022-05-16 63ad2c3598400370dd7da5534659fd7e768a0a4a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
 * @Description: 
 * @Version: 1.0
 * @Author: yangsx
 * @Date: 2019-12-09 19:01:40
 * @LastEditors: song
 * @LastEditTime: 2021-02-03 17:11:24
 */
/**
 * 位置查询工具
 * @author Tengzh 2018-11-21
 **/
define([
  "dojo/_base/declare",
  "controls/toolbar/tools/BaseTool",
  "dojo/dom-style",
  "dojo/dom-construct",
  "esri/geometry/Extent"
], function(declare, BaseTool, domStyle, domConstruct, Extent) {
  var RL = declare([BaseTool], {
    _map: null,
    constructor: function(args) {
      this._normalIconClass = "tool-local-normal";
      this._overIconClass = "tool-local-over";
      this._selectedIconClass = "tool-local-select";
      this._disableClass = "";
      this.tooltip = "复位";
      this._map = args.map;
    },
    activate: function(args) {
      this.inherited(arguments);
      var extent = new Extent({
        "xmin": 12881727,
        "ymin": 3326410,
        "xmax": 12918360,
        "ymax": 3344162,
        "spatialReference": { "wkid": 102100 }
    });
      console.log(1234,extent);
      
      this._map.setExtent(extent);
    },
    postCreate: function() {
      this.inherited(arguments);
    },
    deactivate: function() {
      this.inherited(arguments);
      var extent = new Extent({
        "xmin": 12881727,
        "ymin": 3326410,
        "xmax": 12918360,
        "ymax": 3344162,
        "spatialReference": { "wkid": 102100 }
    });
      console.log(1234,extent);
      this._map.setExtent(extent);
    }
  });
  return RL;
});