From 1569427ffc8e888b2f189e4ce73611586f99a8ca Mon Sep 17 00:00:00 2001
From: jxdnsong <592566207@qq.com>
Date: Wed, 03 Feb 2021 17:25:53 +0800
Subject: [PATCH] 地图初始化范围
---
public/map/controls/toolbar/tools/LocationTool.js | 28 +++++++-------
src/views/realTimePolice/real.vue | 2
src/views/home/home.vue | 10 ++++
public/map/config.json | 16 ++++----
public/map/widgets/map/MapWidget.js | 29 ++++++--------
public/map/index.html | 8 ----
6 files changed, 44 insertions(+), 49 deletions(-)
diff --git a/public/map/config.json b/public/map/config.json
index 96bd0d8..57ec7df 100644
--- a/public/map/config.json
+++ b/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,
diff --git a/public/map/controls/toolbar/tools/LocationTool.js b/public/map/controls/toolbar/tools/LocationTool.js
index b8d4a01..01c3ce5 100644
--- a/public/map/controls/toolbar/tools/LocationTool.js
+++ b/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);
}
diff --git a/public/map/index.html b/public/map/index.html
index d81d150..1de1918 100644
--- a/public/map/index.html
+++ b/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">
diff --git a/public/map/widgets/map/MapWidget.js b/public/map/widgets/map/MapWidget.js
index 7de7685..a7e1d18 100644
--- a/public/map/widgets/map/MapWidget.js
+++ b/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)
}
});
},
diff --git a/src/views/home/home.vue b/src/views/home/home.vue
index c0286c8..c61ec8e 100644
--- a/src/views/home/home.vue
+++ b/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>
diff --git a/src/views/realTimePolice/real.vue b/src/views/realTimePolice/real.vue
index 36f57b6..186e280 100644
--- a/src/views/realTimePolice/real.vue
+++ b/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%"
--
Gitblit v1.9.3