南昌市物联网技防平台-前端
shuishen
2021-01-29 c0cba2f33dd6b1329b94d7ec4e4606fd46c28151
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: yangsx
 * @LastEditTime: 2019-12-14 10:47:05
 */
/**
 * 位置查询工具
 * @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: 117.32627608398445,
        ymin: 26.028863800659224,
        xmax: 119.20493819335945,
        ymax: 27.11788357604985,
        spatialReference: { wkid: 4326 }
      });
      console.log(1234,extent);
      
      this._map.setExtent(extent);
    },
    postCreate: function() {
      this.inherited(arguments);
    },
    deactivate: function() {
      this.inherited(arguments);
      var extent = new Extent({
        xmin: 117.32627608398445,
        ymin: 26.028863800659224,
        xmax: 119.20493819335945,
        ymax: 27.11788357604985,
        spatialReference: { wkid: 4326 }
      });
      console.log(1234,extent);
      this._map.setExtent(extent);
    }
  });
  return RL;
});