egovamap 0.35.20 → 0.35.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,165 +1,165 @@
1
- import "./mapswich.css";
2
-
3
- var scene = null;
4
- var defaultSettings = {
5
- right: 0,
6
- bottom: 0,
7
- left: null,
8
- top: null,
9
- };
10
-
11
- var MapSwich = function ($container, settings, pScene, prefix, context) {
12
- var that = this;
13
- scene = pScene;
14
- var parentScene = pScene.pageId || "parentScene";
15
- var msgPrefix = prefix;
16
- that.$mapSwichContainer = null;
17
- that.settings = {};
18
- if (settings && (settings["right"] || settings["left"])) {
19
- delete defaultSettings["right"];
20
- delete defaultSettings["left"];
21
- }
22
- if (settings && (settings["bottom"] || settings["top"])) {
23
- delete defaultSettings["bottom"];
24
- delete defaultSettings["top"];
25
- }
26
- for (var i in defaultSettings) {
27
- that.settings[i] = defaultSettings[i];
28
- }
29
- for (var i in settings) {
30
- that.settings[i] = settings[i];
31
- }
32
-
33
- that.init = function () {
34
- that.$mapSwichContainer =
35
- $container.getElementsByClassName("mapType-wrapper")[0];
36
- if (!that.$mapSwichContainer) {
37
- that.$mapSwichContainer = document.createElement("div");
38
- that.$mapSwichContainer.id = "mapType-wrapper";
39
- that.$mapSwichContainer.classList.add("mapType-wrapper");
40
- var mapSwichHTML =
41
- '<div class="mapTypeNoMms">' +
42
- '<div class="mapTypeCard gis"><span>二维</span></div>' +
43
- '<div class="mapTypeCard globe"><span>三维</span></div>' +
44
- "</div>";
45
- that.$mapSwichContainer.innerHTML = mapSwichHTML;
46
- $container.appendChild(that.$mapSwichContainer);
47
- }
48
- that.$mapType =
49
- that.$mapSwichContainer.getElementsByClassName("mapTypeNoMms")[0];
50
- var $bntgis = that.$mapSwichContainer.getElementsByClassName("gis")[0];
51
- var $bntglobe =
52
- that.$mapSwichContainer.getElementsByClassName("globe")[0];
53
- that.$mapSwichContainer.onmouseover = function () {
54
- that.$mapSwichContainer.classList.add("expand");
55
- };
56
-
57
- that.$mapSwichContainer.onmouseleave = function () {
58
- that.$mapSwichContainer.classList.remove("expand");
59
- };
60
- updateMaptype();
61
-
62
- function updateMaptype() {
63
- if (context.currentMapType == "map") {
64
- $bntgis.classList.add("active");
65
- $bntglobe.classList.remove("active");
66
- that.$mapType.removeChild($bntgis);
67
- that.$mapType.appendChild($bntgis);
68
- /*that.updatePosition({
69
- bottom: 0
70
- });*/
71
- } else if (context.currentMapType == "globe") {
72
- $bntgis.classList.remove("active");
73
- $bntglobe.classList.add("active");
74
- that.$mapType.removeChild($bntglobe);
75
- that.$mapType.appendChild($bntglobe);
76
- /*that.updatePosition({
77
- bottom: 30
78
- });*/
79
- } else {
80
- $bntgis.classList.remove("active");
81
- $bntglobe.classList.remove("active");
82
- /*that.updatePosition({
83
- bottom: 0
84
- });*/
85
- }
86
- that.updatePosition(that.settings);
87
- bindClickFn();
88
- }
89
-
90
- function bindClickFn() {
91
- $bntgis.onclick = null;
92
- $bntglobe.onclick = null;
93
- $bntgis.onclick = function () {
94
- context.currentMapType = "map";
95
- updateMaptype();
96
- scene.fire(
97
- msgPrefix + ":openGisMap",
98
- {
99
- args: [],
100
- },
101
- parentScene,
102
- false
103
- );
104
- };
105
-
106
- $bntglobe.onclick = function (e) {
107
- var ctl = e.ctrlKey;
108
- context.currentMapType = "globe";
109
- updateMaptype();
110
- scene.fire(
111
- msgPrefix + ":openGlobeMap",
112
- {
113
- args: [ctl],
114
- },
115
- parentScene,
116
- false
117
- );
118
- };
119
- }
120
- };
121
-
122
- that.updatePosition = function (params) {
123
- that.settings = {};
124
- for (var i in defaultSettings) {
125
- that.settings[i] = defaultSettings[i];
126
- }
127
- for (var i in params) {
128
- that.settings[i] = params[i];
129
- }
130
- var style = {};
131
- for (var key in that.settings) {
132
- if (that.settings[key] != null) {
133
- style[key] = that.settings[key];
134
- }
135
- }
136
- if (context.currentMapType == "globe") {
137
- if (style.bottom == 0) {
138
- style.bottom = 30;
139
- }
140
- if (style.top != null && style.top < 56) {
141
- style.top = 56;
142
- }
143
- }
144
- for (var i in style) {
145
- if (i == "left")
146
- that.$mapSwichContainer.style.left = style[i] + "px";
147
- if (i == "top") that.$mapSwichContainer.style.top = style[i] + "px";
148
- if (i == "right")
149
- that.$mapSwichContainer.style.right = style[i] + "px";
150
- if (i == "bottom")
151
- that.$mapSwichContainer.style.bottom = style[i] + "px";
152
- }
153
- };
154
- that.hide = function () {
155
- if ($(that.$mapSwichContainer))
156
- that.$mapSwichContainer.style.display = "none";
157
- };
158
- that.show = function () {
159
- if ($(that.$mapSwichContainer))
160
- that.$mapSwichContainer.style.display = "block";
161
- };
162
-
163
- that.init();
164
- };
165
- export default MapSwich;
1
+ import "./mapswich.css";
2
+
3
+ var scene = null;
4
+ var defaultSettings = {
5
+ right: 0,
6
+ bottom: 0,
7
+ left: null,
8
+ top: null,
9
+ };
10
+
11
+ var MapSwich = function ($container, settings, pScene, prefix, context) {
12
+ var that = this;
13
+ scene = pScene;
14
+ var parentScene = pScene.pageId || "parentScene";
15
+ var msgPrefix = prefix;
16
+ that.$mapSwichContainer = null;
17
+ that.settings = {};
18
+ if (settings && (settings["right"] || settings["left"])) {
19
+ delete defaultSettings["right"];
20
+ delete defaultSettings["left"];
21
+ }
22
+ if (settings && (settings["bottom"] || settings["top"])) {
23
+ delete defaultSettings["bottom"];
24
+ delete defaultSettings["top"];
25
+ }
26
+ for (var i in defaultSettings) {
27
+ that.settings[i] = defaultSettings[i];
28
+ }
29
+ for (var i in settings) {
30
+ that.settings[i] = settings[i];
31
+ }
32
+
33
+ that.init = function () {
34
+ that.$mapSwichContainer =
35
+ $container.getElementsByClassName("mapType-wrapper")[0];
36
+ if (!that.$mapSwichContainer) {
37
+ that.$mapSwichContainer = document.createElement("div");
38
+ that.$mapSwichContainer.id = "mapType-wrapper";
39
+ that.$mapSwichContainer.classList.add("mapType-wrapper");
40
+ var mapSwichHTML =
41
+ '<div class="mapTypeNoMms">' +
42
+ '<div class="mapTypeCard gis"><span>二维</span></div>' +
43
+ '<div class="mapTypeCard globe"><span>三维</span></div>' +
44
+ "</div>";
45
+ that.$mapSwichContainer.innerHTML = mapSwichHTML;
46
+ $container.appendChild(that.$mapSwichContainer);
47
+ }
48
+ that.$mapType =
49
+ that.$mapSwichContainer.getElementsByClassName("mapTypeNoMms")[0];
50
+ var $bntgis = that.$mapSwichContainer.getElementsByClassName("gis")[0];
51
+ var $bntglobe =
52
+ that.$mapSwichContainer.getElementsByClassName("globe")[0];
53
+ that.$mapSwichContainer.onmouseover = function () {
54
+ that.$mapSwichContainer.classList.add("expand");
55
+ };
56
+
57
+ that.$mapSwichContainer.onmouseleave = function () {
58
+ that.$mapSwichContainer.classList.remove("expand");
59
+ };
60
+ updateMaptype();
61
+
62
+ function updateMaptype() {
63
+ if (context.currentMapType == "map") {
64
+ $bntgis.classList.add("active");
65
+ $bntglobe.classList.remove("active");
66
+ that.$mapType.removeChild($bntgis);
67
+ that.$mapType.appendChild($bntgis);
68
+ /*that.updatePosition({
69
+ bottom: 0
70
+ });*/
71
+ } else if (context.currentMapType == "globe") {
72
+ $bntgis.classList.remove("active");
73
+ $bntglobe.classList.add("active");
74
+ that.$mapType.removeChild($bntglobe);
75
+ that.$mapType.appendChild($bntglobe);
76
+ /*that.updatePosition({
77
+ bottom: 30
78
+ });*/
79
+ } else {
80
+ $bntgis.classList.remove("active");
81
+ $bntglobe.classList.remove("active");
82
+ /*that.updatePosition({
83
+ bottom: 0
84
+ });*/
85
+ }
86
+ that.updatePosition(that.settings);
87
+ bindClickFn();
88
+ }
89
+
90
+ function bindClickFn() {
91
+ $bntgis.onclick = null;
92
+ $bntglobe.onclick = null;
93
+ $bntgis.onclick = function () {
94
+ context.currentMapType = "map";
95
+ updateMaptype();
96
+ scene.fire(
97
+ msgPrefix + ":openGisMap",
98
+ {
99
+ args: [],
100
+ },
101
+ parentScene,
102
+ false
103
+ );
104
+ };
105
+
106
+ $bntglobe.onclick = function (e) {
107
+ var ctl = e.ctrlKey;
108
+ context.currentMapType = "globe";
109
+ updateMaptype();
110
+ scene.fire(
111
+ msgPrefix + ":openGlobeMap",
112
+ {
113
+ args: [ctl],
114
+ },
115
+ parentScene,
116
+ false
117
+ );
118
+ };
119
+ }
120
+ };
121
+
122
+ that.updatePosition = function (params) {
123
+ that.settings = {};
124
+ for (var i in defaultSettings) {
125
+ that.settings[i] = defaultSettings[i];
126
+ }
127
+ for (var i in params) {
128
+ that.settings[i] = params[i];
129
+ }
130
+ var style = {};
131
+ for (var key in that.settings) {
132
+ if (that.settings[key] != null) {
133
+ style[key] = that.settings[key];
134
+ }
135
+ }
136
+ if (context.currentMapType == "globe") {
137
+ if (style.bottom == 0) {
138
+ style.bottom = 30;
139
+ }
140
+ if (style.top != null && style.top < 56) {
141
+ style.top = 56;
142
+ }
143
+ }
144
+ for (var i in style) {
145
+ if (i == "left")
146
+ that.$mapSwichContainer.style.left = style[i] + "px";
147
+ if (i == "top") that.$mapSwichContainer.style.top = style[i] + "px";
148
+ if (i == "right")
149
+ that.$mapSwichContainer.style.right = style[i] + "px";
150
+ if (i == "bottom")
151
+ that.$mapSwichContainer.style.bottom = style[i] + "px";
152
+ }
153
+ };
154
+ that.hide = function () {
155
+ if ($(that.$mapSwichContainer))
156
+ that.$mapSwichContainer.style.display = "none";
157
+ };
158
+ that.show = function () {
159
+ if ($(that.$mapSwichContainer))
160
+ that.$mapSwichContainer.style.display = "block";
161
+ };
162
+
163
+ that.init();
164
+ };
165
+ export default MapSwich;
package/egovamap/mms.jsp CHANGED
@@ -1,71 +1,71 @@
1
- <%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%> <%@
2
- include file="/view/include/common/taglibs.jsp"%>
3
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
- <html style="height: 100%; width: 100%">
5
- <head lang="en">
6
- <meta charset="UTF-8" />
7
- <title>eGovaMMS实景</title>
8
- <script
9
- type="text/javascript"
10
- src="<c:url value='${param.mmsServerUrl}/library/mms/api/MMSAPI.js?clientType=js'/>"
11
- ></script>
12
- <script>
13
- function GetRequest() {
14
- var url = location.search; //获取url中"?"符后的字串
15
- var theRequest = new Object();
16
- if (url.indexOf("?") != -1) {
17
- var str = url.substr(1);
18
- strs = str.split("&");
19
- for (var i = 0; i < strs.length; i++) {
20
- theRequest[strs[i].split("=")[0]] =
21
- strs[i].split("=")[1];
22
- }
23
- }
24
- return theRequest;
25
- }
26
-
27
- var Request = GetRequest();
28
-
29
- var simpleMode;
30
- if (Request["simpleMode"]) {
31
- simpleMode = true;
32
- }
33
- window.msgPrefix = Request["msgPrefix"];
34
- window.parentScene = Request["parentScene"];
35
- window.proxyURL = Request["proxyUrl"];
36
- var mmsConfig = {
37
- panoID: "eGovaMMS",
38
- msgPrefix: "${param.msgPrefix}",
39
- mmsWsdlUrl: "${param.mmsWsdlUrl}",
40
- mmsPicUrl: "${param.mmsPicUrl}",
41
- mmsSymbolUrl: "${param.mmsSymbolUrl}",
42
- mediaRootUrl: "${param.mediaRootUrl}",
43
- mmsServerUrl: "${param.mmsServerUrl}",
44
- proxyUrl: "${param.proxyUrl}",
45
- };
46
- window.mmsConfig = mmsConfig;
47
-
48
- function init() {
49
- //初始化实景API
50
- if (typeof initEgovaMMSAPI != "undefined") {
51
- console.info("----------initEgovaMMSAPI");
52
- initEgovaMMSAPI();
53
- } else {
54
- console.error(
55
- "----------initEgovaMMSAPI:failed!check mmsServerUrl."
56
- );
57
- }
58
- }
59
- </script>
60
- </head>
61
- <body
62
- onload="init();"
63
- style="height: 100%; width: 100%; overflow: hidden; margin: 0"
64
- >
65
- <div
66
- id="eGovaMMS"
67
- name="eGovaMMS"
68
- style="width: 100%; height: 100%; border: none"
69
- ></div>
70
- </body>
71
- </html>
1
+ <%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%> <%@
2
+ include file="/view/include/common/taglibs.jsp"%>
3
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
+ <html style="height: 100%; width: 100%">
5
+ <head lang="en">
6
+ <meta charset="UTF-8" />
7
+ <title>eGovaMMS实景</title>
8
+ <script
9
+ type="text/javascript"
10
+ src="<c:url value='${param.mmsServerUrl}/library/mms/api/MMSAPI.js?clientType=js'/>"
11
+ ></script>
12
+ <script>
13
+ function GetRequest() {
14
+ var url = location.search; //获取url中"?"符后的字串
15
+ var theRequest = new Object();
16
+ if (url.indexOf("?") != -1) {
17
+ var str = url.substr(1);
18
+ strs = str.split("&");
19
+ for (var i = 0; i < strs.length; i++) {
20
+ theRequest[strs[i].split("=")[0]] =
21
+ strs[i].split("=")[1];
22
+ }
23
+ }
24
+ return theRequest;
25
+ }
26
+
27
+ var Request = GetRequest();
28
+
29
+ var simpleMode;
30
+ if (Request["simpleMode"]) {
31
+ simpleMode = true;
32
+ }
33
+ window.msgPrefix = Request["msgPrefix"];
34
+ window.parentScene = Request["parentScene"];
35
+ window.proxyURL = Request["proxyUrl"];
36
+ var mmsConfig = {
37
+ panoID: "eGovaMMS",
38
+ msgPrefix: "${param.msgPrefix}",
39
+ mmsWsdlUrl: "${param.mmsWsdlUrl}",
40
+ mmsPicUrl: "${param.mmsPicUrl}",
41
+ mmsSymbolUrl: "${param.mmsSymbolUrl}",
42
+ mediaRootUrl: "${param.mediaRootUrl}",
43
+ mmsServerUrl: "${param.mmsServerUrl}",
44
+ proxyUrl: "${param.proxyUrl}",
45
+ };
46
+ window.mmsConfig = mmsConfig;
47
+
48
+ function init() {
49
+ //初始化实景API
50
+ if (typeof initEgovaMMSAPI != "undefined") {
51
+ console.info("----------initEgovaMMSAPI");
52
+ initEgovaMMSAPI();
53
+ } else {
54
+ console.error(
55
+ "----------initEgovaMMSAPI:failed!check mmsServerUrl."
56
+ );
57
+ }
58
+ }
59
+ </script>
60
+ </head>
61
+ <body
62
+ onload="init();"
63
+ style="height: 100%; width: 100%; overflow: hidden; margin: 0"
64
+ >
65
+ <div
66
+ id="eGovaMMS"
67
+ name="eGovaMMS"
68
+ style="width: 100%; height: 100%; border: none"
69
+ ></div>
70
+ </body>
71
+ </html>
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
- var EGovaMap = require("./egovamap/egovamap").default;
2
- module.exports = EGovaMap;
1
+ var EGovaMap = require("./egovamap/egovamap").default;
2
+ module.exports = EGovaMap;
package/map.html CHANGED
@@ -1,72 +1,72 @@
1
- <html>
2
- <head></head>
3
- <style>
4
- .map {
5
- width: 100%;
6
- height: 100%;
7
- }
8
- </style>
9
- <body>
10
- <div id="map"></div>
11
- <script src="./build/source/egovamap.js"></script>
12
- <script>
13
- var mapConfig = {
14
- params: {
15
- navi: "{visible:true,left:20,top:90}",
16
- toolbar:
17
- "{items:'zoomin,zoomout,pan,fullextent,measurelength,measurearea,refresh,layertree,identify,snap,locatexy',visible:true,left:20,top:60}",
18
- geocode: "{visible:true,right:20,top:60}",
19
- trace: "{right:5,bottom:185}",
20
- switchbar: "{right:20,top:102}",
21
- layertree: "{top:160}",
22
- },
23
- mapconfig3D: { toolbar: "{ visible:true,left:20,top:60}" },
24
- maskPos: { top: 95 },
25
- };
26
- var context = {
27
- rootPath: "http://localhost:8081/eUrbanGIS/",
28
- humanID: "",
29
- gisServerURL: "http://localhost:8081/eUrbanGIS/",
30
- originPath: "",
31
- mapCenterFlag: "",
32
- coordinateX: "",
33
- coordinateY: "",
34
- humanLayerUsageID: "",
35
- regionCode: "",
36
- humanLayerKeyFieldName: "",
37
- mapZoomRange: "",
38
- mmsEnabled: "",
39
- mmsParams: "",
40
- globeParams: "",
41
- globeEnabled: true,
42
- globeServerURL: "http://localhost:8081/eUrbanGIS/",
43
- globeCallBack: "",
44
- gisEnabled: true,
45
- currentMapType: "",
46
- mmsServerURL: "",
47
- assetsPath: "",
48
- };
49
-
50
- var context = {
51
- /*rootPath:"http://localhost:8081/eUrbanGIS/",*/
52
- gisServerURL: "http://localhost:8081/eUrbanGIS/",
53
- gisEnabled: true,
54
- mapType: "emap",
55
- assetsPath: "",
56
- };
57
-
58
- var emap = egovamap.getInstance(
59
- document.getElementById("map"),
60
- function (e) {
61
- setTimeout(function () {
62
- emap.centerAndZoom(null, null, -1);
63
- }, 5000);
64
- },
65
- mapConfig,
66
- null,
67
- null,
68
- context
69
- );
70
- </script>
71
- </body>
72
- </html>
1
+ <html>
2
+ <head></head>
3
+ <style>
4
+ .map {
5
+ width: 100%;
6
+ height: 100%;
7
+ }
8
+ </style>
9
+ <body>
10
+ <div id="map"></div>
11
+ <script src="./build/source/egovamap.js"></script>
12
+ <script>
13
+ var mapConfig = {
14
+ params: {
15
+ navi: "{visible:true,left:20,top:90}",
16
+ toolbar:
17
+ "{items:'zoomin,zoomout,pan,fullextent,measurelength,measurearea,refresh,layertree,identify,snap,locatexy',visible:true,left:20,top:60}",
18
+ geocode: "{visible:true,right:20,top:60}",
19
+ trace: "{right:5,bottom:185}",
20
+ switchbar: "{right:20,top:102}",
21
+ layertree: "{top:160}",
22
+ },
23
+ mapconfig3D: { toolbar: "{ visible:true,left:20,top:60}" },
24
+ maskPos: { top: 95 },
25
+ };
26
+ var context = {
27
+ rootPath: "http://localhost:8081/eUrbanGIS/",
28
+ humanID: "",
29
+ gisServerURL: "http://localhost:8081/eUrbanGIS/",
30
+ originPath: "",
31
+ mapCenterFlag: "",
32
+ coordinateX: "",
33
+ coordinateY: "",
34
+ humanLayerUsageID: "",
35
+ regionCode: "",
36
+ humanLayerKeyFieldName: "",
37
+ mapZoomRange: "",
38
+ mmsEnabled: "",
39
+ mmsParams: "",
40
+ globeParams: "",
41
+ globeEnabled: true,
42
+ globeServerURL: "http://localhost:8081/eUrbanGIS/",
43
+ globeCallBack: "",
44
+ gisEnabled: true,
45
+ currentMapType: "",
46
+ mmsServerURL: "",
47
+ assetsPath: "",
48
+ };
49
+
50
+ var context = {
51
+ /*rootPath:"http://localhost:8081/eUrbanGIS/",*/
52
+ gisServerURL: "http://localhost:8081/eUrbanGIS/",
53
+ gisEnabled: true,
54
+ mapType: "emap",
55
+ assetsPath: "",
56
+ };
57
+
58
+ var emap = egovamap.getInstance(
59
+ document.getElementById("map"),
60
+ function (e) {
61
+ setTimeout(function () {
62
+ emap.centerAndZoom(null, null, -1);
63
+ }, 5000);
64
+ },
65
+ mapConfig,
66
+ null,
67
+ null,
68
+ context
69
+ );
70
+ </script>
71
+ </body>
72
+ </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "egovamap",
3
- "version": "0.35.20",
3
+ "version": "0.35.21",
4
4
  "description": "eUrbanGIS SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {