南昌市物联网技防平台-前端
shuishen
2021-02-04 a7a86324ae4e519b8ee0a3fa3038f3afa2e14dec
public/map/widgets/map/MapWidget.js
@@ -1,8 +1,3 @@
/**
 * 富地图widget
 * @author Liuyl
 * @date 2015/10/20
 */
define([
    "dojo/_base/declare",
    "dojo/_base/lang",
@@ -100,7 +95,7 @@
            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"
@@ -124,10 +119,6 @@
            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;
@@ -157,11 +148,11 @@
            }, 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);
            }));
@@ -245,7 +236,7 @@
                    }
                }
            }))
            AppEvent.dispatchAppEvent("mapLoad", this.map);
            return this.map
        },
        appendToolHandler: function (data) {
@@ -312,7 +303,7 @@
                });
                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);
                // //添加多时相图层
@@ -380,13 +371,13 @@
        },
        _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)
                }
            });
        },