| | |
| | | /** |
| | | * 富地图widget |
| | | * @author Liuyl |
| | | * @date 2015/10/20 |
| | | */ |
| | | define([ |
| | | "dojo/_base/declare", |
| | | "dojo/_base/lang", |
| | |
| | | this.map = new Map(this.mapBoxDom.id, { |
| | | logo: this._parseResult.maplogo, |
| | | showAttribution: true, |
| | | extent: this._parseResult.extent, |
| | | extent: extent, |
| | | maxZoom: 17, |
| | | minZoom: 0, |
| | | navigationMode: "classic" |
| | |
| | | this._eventHandlers.push(this.map.on("mouse-move", lang.hitch(this, this._onMouseMove))); |
| | | AppEvent.addAppEventListener(AppEvent.SWITCH_BASEMAP, lang.hitch(this, this.onSwitchBaseMap)); |
| | | AppEvent.addAppEventListener(AppEvent.ADD_TOP_MOST_LAYER, lang.hitch(this, this.onAddTopMostLayer)); |
| | | AppEvent.addAppEventListener("goto", lang.hitch(this, this.goto)); |
| | | }, |
| | | goto: function (evt) { |
| | | this.map.centerAndZoom(new Point(evt.x,evt.y, new SpatialReference({ wkid: 4326 })), 14); |
| | | }, |
| | | onload: function () { |
| | | //var listNode = this.map.attribution.listNode; |
| | |
| | | }, listNode); |
| | | on(locationb, 'click', lang.hitch(this, function () { |
| | | var extent = new Extent({ |
| | | "xmin": 117.32627608398445, |
| | | "ymin": 26.028863800659224, |
| | | "xmax": 119.20493819335945, |
| | | "ymax": 27.11788357604985, |
| | | "spatialReference": { "wkid": 4326 } |
| | | "xmin": 12881727, |
| | | "ymin": 3326410, |
| | | "xmax": 12918360, |
| | | "ymax": 3344162, |
| | | "spatialReference": { "wkid": 102100 } |
| | | }); |
| | | this.map.setExtent(extent); |
| | | })); |
| | |
| | | } |
| | | } |
| | | })) |
| | | |
| | | AppEvent.dispatchAppEvent("mapLoad", this.map); |
| | | return this.map |
| | | }, |
| | | appendToolHandler: function (data) { |
| | |
| | | }); |
| | | this.map.addLayer(cycleMap); |
| | | |
| | | this.map.centerAndZoom(new Point(115.806669,28.68635, new SpatialReference({ wkid: 4326 })), 14); |
| | | //this.map.centerAndZoom(new Point(115.806669,28.68635, new SpatialReference({ wkid: 4326 })), 14); |
| | | |
| | | |
| | | // //添加多时相图层 |
| | |
| | | |
| | | }, |
| | | _getStartExtent: function () { |
| | | return new esri.geometry.Extent({ |
| | | "xmin": ConfigData.basemap.initExtent[0], |
| | | "ymin": ConfigData.basemap.initExtent[1], |
| | | "xmax": ConfigData.basemap.initExtent[2], |
| | | "ymax": ConfigData.basemap.initExtent[3], |
| | | return new Extent({ |
| | | "xmin": Number(ConfigData.basemap.initExtent[0]), |
| | | "ymin": Number(ConfigData.basemap.initExtent[1]), |
| | | "xmax": Number(ConfigData.basemap.initExtent[2]), |
| | | "ymax": Number(ConfigData.basemap.initExtent[3]), |
| | | "spatialReference": { |
| | | "wkid": ConfigData.basemap.wkid |
| | | "wkid": Number(ConfigData.basemap.wkid) |
| | | } |
| | | }); |
| | | }, |