/* * @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; });