南昌市物联网技防平台-前端
jxdnsong
2021-02-03 1569427ffc8e888b2f189e4ce73611586f99a8ca
地图初始化范围
6 files modified
93 ■■■■ changed files
public/map/config.json 16 ●●●● patch | view | raw | blame | history
public/map/controls/toolbar/tools/LocationTool.js 28 ●●●● patch | view | raw | blame | history
public/map/index.html 8 ●●●●● patch | view | raw | blame | history
public/map/widgets/map/MapWidget.js 29 ●●●●● patch | view | raw | blame | history
src/views/home/home.vue 10 ●●●●● patch | view | raw | blame | history
src/views/realTimePolice/real.vue 2 ●●● patch | view | raw | blame | history
public/map/config.json
@@ -1,16 +1,16 @@
{
    "basemap": {
        "initExtent": [
        115.62627608398445,
        28.628863800659224,
        116.20493819335945,
        28.71788357604985
        12881727,
        3326410,
        12918360,
        3344162
      ],
      "fullExtent": [
        115.60864000000008,
        28.447970000000055,
        116.33494000000007,
        28.965810000000033
        12881727,
        3326410,
        12918360,
        3344162
      ],
        "maplogo": false,
        "wkid": 102100,
public/map/controls/toolbar/tools/LocationTool.js
@@ -3,8 +3,8 @@
 * @Version: 1.0
 * @Author: yangsx
 * @Date: 2019-12-09 19:01:40
 * @LastEditors: yangsx
 * @LastEditTime: 2019-12-14 10:47:05
 * @LastEditors: song
 * @LastEditTime: 2021-02-03 17:11:24
 */
/**
 * 位置查询工具
@@ -30,12 +30,12 @@
    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 }
      });
        "xmin": 12881727,
        "ymin": 3326410,
        "xmax": 12918360,
        "ymax": 3344162,
        "spatialReference": { "wkid": 102100 }
    });
      console.log(1234,extent);
      
      this._map.setExtent(extent);
@@ -46,12 +46,12 @@
    deactivate: function() {
      this.inherited(arguments);
      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 }
    });
      console.log(1234,extent);
      this._map.setExtent(extent);
    }
public/map/index.html
@@ -1,11 +1,3 @@
<!--
 * @Description: 地图
 * @Version: 1.0
 * @Author: yangsx
 * @Date: 2019-11-28 09:50:16
 * @LastEditors: song
 * @LastEditTime: 2021-02-03 16:35:18
 -->
<!DOCTYPE html>
<html lang="zh">
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"
@@ -153,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);
            }));
@@ -376,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)
                }
            });
        },
src/views/home/home.vue
@@ -1,6 +1,14 @@
<!--
 * @Descripttion:
 * @version:
 * @Author: song
 * @Date: 2021-01-26 08:56:33
 * @LastEditors: song
 * @LastEditTime: 2021-02-03 16:46:44
-->
<template>
  <iframe v-show="iframeState" id="show-iframe" frameborder=0 name="showHere" scrolling=auto
          src="https://s16s652780.51mypc.cn/bigScreen/view/1349193280059879426"></iframe>
          src="http://s16s652780.51mypc.cn/bigScreen/view/1349193280059879426"></iframe>
</template>
<script>
src/views/realTimePolice/real.vue
@@ -282,7 +282,7 @@
      <iframe
        id="mapDiv"
        ref="mapDiv"
        src="/map/index.html"
        src="http://s16s652780.51mypc.cn/jfpt/map/index.html"
        frameborder="0"
        width="100%"
        height="100%"