egovamap 0.35.5 → 0.35.6
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.
- package/egovamap/egovamapMEx.js +2 -1
- package/egovamap/egovamobile.js +386 -265
- package/package.json +1 -1
package/egovamap/egovamapMEx.js
CHANGED
|
@@ -107,7 +107,8 @@ var egovamapMEx = function (gisMobileMap) {
|
|
|
107
107
|
'showTraceHisGradientLayer',
|
|
108
108
|
'setTraceHisGradientStatus',
|
|
109
109
|
'countLength',
|
|
110
|
-
'xkRealTimeTrace'
|
|
110
|
+
'xkRealTimeTrace',
|
|
111
|
+
'closexkRealTimeTrace'
|
|
111
112
|
];
|
|
112
113
|
methodEx = methodEx.concat(methodBusEx);
|
|
113
114
|
for (let index = 0; index < methodEx.length; index++) {
|
package/egovamap/egovamobile.js
CHANGED
|
@@ -1,317 +1,438 @@
|
|
|
1
|
-
import MapUtils from
|
|
1
|
+
import MapUtils from "./mapUtils";
|
|
2
2
|
|
|
3
3
|
var scene = null;
|
|
4
4
|
var _egovagismobileUrl = "";
|
|
5
5
|
function getCookie(name) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
6
|
+
var strCookie = window.document.cookie;
|
|
7
|
+
var arrCookie = strCookie.split("; ");
|
|
8
|
+
for (var i = 0; i < arrCookie.length; i++) {
|
|
9
|
+
var arr = arrCookie[i].split("=");
|
|
10
|
+
if (arr[0] == name) return arr[1];
|
|
11
|
+
}
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
15
14
|
function setCookie(name, value) {
|
|
16
|
-
|
|
15
|
+
window.document.cookie = name + "=" + value;
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
function checkGisServerURL(url, callback) {
|
|
20
|
-
|
|
19
|
+
if (!url) return;
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
callback(url);
|
|
30
|
-
return;
|
|
21
|
+
var cookieUrl = getCookie("gisUrl");
|
|
22
|
+
var gisProxyList = url.split(";");
|
|
23
|
+
cookieUrl && gisProxyList.push(cookieUrl);
|
|
24
|
+
if (gisProxyList.length <= 1) {
|
|
25
|
+
if (url.indexOf("http") != 0) {
|
|
26
|
+
url = window.location.origin + url;
|
|
31
27
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
callback(url);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
var params = {
|
|
32
|
+
isLoad: false,
|
|
33
|
+
};
|
|
34
|
+
for (var i in gisProxyList) {
|
|
35
|
+
if (gisProxyList.hasOwnProperty(i)) {
|
|
36
|
+
if (gisProxyList[i].indexOf("http") != 0) {
|
|
37
|
+
gisProxyList[i] = window.location.origin + url;
|
|
38
|
+
}
|
|
39
|
+
checkGISProxy(gisProxyList[i], params, callback);
|
|
42
40
|
}
|
|
41
|
+
}
|
|
43
42
|
}
|
|
44
43
|
|
|
45
44
|
function trimEnd(str, c) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
var rg = new RegExp(c);
|
|
46
|
+
var i = str.length;
|
|
47
|
+
while (rg.test(str.charAt(--i)));
|
|
48
|
+
return str.slice(0, i + 1);
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
function checkGISProxy(proxyUrl, params, callback) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
var img = new Image();
|
|
53
|
+
if (proxyUrl.indexOf("http") != 0) {
|
|
54
|
+
proxyUrl = window.location.origin + "/" + proxyUrl;
|
|
55
|
+
}
|
|
56
|
+
img.src = trimEnd(proxyUrl, "/") + "/symbol/default.png";
|
|
57
|
+
img.onload = function (e1) {
|
|
58
|
+
if (!params.isLoad) {
|
|
59
|
+
params.isLoad = true;
|
|
60
|
+
setCookie("gisUrl", proxyUrl);
|
|
61
|
+
callback(proxyUrl);
|
|
56
62
|
}
|
|
57
|
-
img
|
|
58
|
-
|
|
59
|
-
if (!params.isLoad) {
|
|
60
|
-
params.isLoad = true;
|
|
61
|
-
setCookie("gisUrl", proxyUrl);
|
|
62
|
-
callback(proxyUrl);
|
|
63
|
-
}
|
|
64
|
-
img = null;
|
|
65
|
-
};
|
|
63
|
+
img = null;
|
|
64
|
+
};
|
|
66
65
|
}
|
|
67
66
|
|
|
68
67
|
function getLocalStorageItem(name) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
if (localStorage) {
|
|
69
|
+
return localStorage.getItem(name);
|
|
70
|
+
} else {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
74
73
|
}
|
|
75
74
|
|
|
76
|
-
var EGovaMobileMap = function (
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
75
|
+
var EGovaMobileMap = function (
|
|
76
|
+
$container,
|
|
77
|
+
pScene,
|
|
78
|
+
prefix,
|
|
79
|
+
gisParams,
|
|
80
|
+
mapConfig,
|
|
81
|
+
context,
|
|
82
|
+
callback
|
|
83
|
+
) {
|
|
84
|
+
var that = this;
|
|
85
|
+
scene = pScene;
|
|
86
|
+
var parentScene = pScene.pageId || "parentScene";
|
|
87
|
+
var msgPrefix = prefix || "mobilemappage";
|
|
88
|
+
that.gisVisible = false;
|
|
89
|
+
that.gisLoaded = false;
|
|
90
|
+
that.isLoading = false;
|
|
84
91
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
+
//that.$gisMapFrame = null;
|
|
93
|
+
that.gisMapContainer = null;
|
|
94
|
+
that.globeMapContainer = null;
|
|
95
|
+
that.useMask = false;
|
|
96
|
+
// if (context.mapCenterFlag == '2' && context.humanLayerUsageID && context.regionCode) {
|
|
97
|
+
// that.useMask = true;
|
|
98
|
+
// }
|
|
92
99
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
100
|
+
that.id = msgPrefix ? msgPrefix + "_emap" : "emap";
|
|
101
|
+
that.gisDebug = getLocalStorageItem("gisDebug") == "true";
|
|
102
|
+
that.gisMapContainer = document.getElementById(that.id);
|
|
103
|
+
if (!that.gisMapContainer) {
|
|
104
|
+
var emapContainer = $container.getElementsByClassName("emap-container")[0];
|
|
105
|
+
emapContainer && (emapContainer.style.display = "none");
|
|
99
106
|
|
|
100
|
-
|
|
101
|
-
|
|
107
|
+
var emapIframe = $container.getElementsByClassName("emap-iframe")[0];
|
|
108
|
+
emapIframe && (emapIframe.style.display = "none");
|
|
102
109
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
110
|
+
var element = document.createElement("div");
|
|
111
|
+
element.classList.add(that.id);
|
|
112
|
+
element.id = that.id;
|
|
113
|
+
$container.append(element);
|
|
114
|
+
that.gisMapContainer = element;
|
|
115
|
+
}
|
|
109
116
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
} else if (context.mapCenterFlag == '2') {
|
|
119
|
-
//H5端遮罩未实现
|
|
120
|
-
} else if (context.mapCenterFlag == '3') {
|
|
121
|
-
//H5端遮罩未实现
|
|
122
|
-
}
|
|
117
|
+
that.onMapLoaded = function () {
|
|
118
|
+
that.isLoading = false;
|
|
119
|
+
that.gisLoaded = true;
|
|
120
|
+
if (context.mapCenterFlag) {
|
|
121
|
+
if (context.mapCenterFlag == "1") {
|
|
122
|
+
if (context.coordinateX && context.coordinateY) {
|
|
123
|
+
that.zoomToCenter(context.coordinateX, context.coordinateY, 4);
|
|
123
124
|
}
|
|
124
|
-
|
|
125
|
+
} else if (context.mapCenterFlag == "2") {
|
|
126
|
+
//H5端遮罩未实现
|
|
127
|
+
} else if (context.mapCenterFlag == "3") {
|
|
128
|
+
//H5端遮罩未实现
|
|
129
|
+
}
|
|
125
130
|
}
|
|
131
|
+
callback && callback();
|
|
132
|
+
};
|
|
126
133
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
134
|
+
that.init = function () {
|
|
135
|
+
if (!that.gisLoaded && !that.isLoading) {
|
|
136
|
+
that.isLoading = true;
|
|
137
|
+
checkGisServerURL(context.gisServerURL, function (gisurl) {
|
|
138
|
+
var gisServerURL = (context.gisServerURL = gisurl);
|
|
139
|
+
that.loadGISLibrary(gisServerURL);
|
|
140
|
+
});
|
|
135
141
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* 地图显示
|
|
145
|
+
*
|
|
146
|
+
* @param res
|
|
147
|
+
*/
|
|
148
|
+
that.openMap = function (evt) {
|
|
149
|
+
if (!that.gisVisible) {
|
|
150
|
+
// 初次定位时调整布局
|
|
151
|
+
if (!that.gisLoaded && !that.isLoading) {
|
|
152
|
+
that.isLoading = true;
|
|
153
|
+
}
|
|
154
|
+
if (that.gisMapContainer) {
|
|
155
|
+
that.gisMapContainer.style.display = "block";
|
|
156
|
+
that.gisMapContainer.style.height = "100%";
|
|
157
|
+
}
|
|
158
|
+
that.gisVisible = true;
|
|
152
159
|
}
|
|
160
|
+
};
|
|
153
161
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
that.gisVisible = false;
|
|
162
|
+
/**
|
|
163
|
+
* 二维地图关闭
|
|
164
|
+
*/
|
|
165
|
+
that.closeMap = function (evt) {
|
|
166
|
+
if (that.gisMapContainer) {
|
|
167
|
+
that.gisMapContainer.style.display = "none";
|
|
162
168
|
}
|
|
169
|
+
that.gisVisible = false;
|
|
170
|
+
};
|
|
163
171
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
};
|
|
179
|
-
_egovagismobileUrl = gisServerURL;
|
|
180
|
-
// 如果是ie,加上polyfill
|
|
181
|
-
if (document.documentMode) {
|
|
182
|
-
var polyfill = document.createElement("script");
|
|
183
|
-
polyfill.setAttribute("type", "text/javascript");
|
|
184
|
-
polyfill.setAttribute("src", root + '/library/egovagismobile/build/dist/polyfill.js');
|
|
185
|
-
document.body.appendChild(polyfill);
|
|
186
|
-
}
|
|
187
|
-
var mainScript = document.createElement('script');
|
|
188
|
-
mainScript.setAttribute('type', 'text/javascript');
|
|
189
|
-
var distOrSource = that.gisDebug ? 'source' : 'dist';
|
|
190
|
-
var url = gisServerURL + '/library/egovagismobile/build/' + distOrSource + '/egovagis.js?t=' + t;
|
|
191
|
-
var t = (new Date()).getTime();
|
|
192
|
-
var mainScript = document.createElement('script');
|
|
193
|
-
mainScript.setAttribute('egovagismobile', gisServerURL);
|
|
194
|
-
mainScript.setAttribute('type', 'text/javascript');
|
|
195
|
-
mainScript.setAttribute('src', url);
|
|
196
|
-
mainScript.onload = that.createMap.bind(that);
|
|
197
|
-
document.getElementsByTagName('head').item(0).appendChild(mainScript);
|
|
172
|
+
that.loadGISLibrary = function (gisServerURL) {
|
|
173
|
+
var t = new Date().getTime();
|
|
174
|
+
if (gisServerURL !== _egovagismobileUrl && _egovagismobileUrl) {
|
|
175
|
+
//如果第二次的GIS地址与上次不一致则删除上一次的,不考虑同一页面多个地图,地图GIS地址不一致的情况。(页面中始终只存在一个引用egovagis.js)
|
|
176
|
+
var curScript = document.querySelector(
|
|
177
|
+
'script[egovagismobile="' + _egovagismobileUrl + '"]'
|
|
178
|
+
);
|
|
179
|
+
var curLink = document.querySelector(
|
|
180
|
+
'link[egovagismobile="' + _egovagismobileUrl + '"]'
|
|
181
|
+
);
|
|
182
|
+
if (curScript && curLink) {
|
|
183
|
+
curScript.remove();
|
|
184
|
+
curLink.remove();
|
|
185
|
+
}
|
|
198
186
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
187
|
+
if (gisServerURL === _egovagismobileUrl) {
|
|
188
|
+
that.createMap();
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
_egovagismobileUrl = gisServerURL;
|
|
192
|
+
// 如果是ie,加上polyfill
|
|
193
|
+
if (document.documentMode) {
|
|
194
|
+
var polyfill = document.createElement("script");
|
|
195
|
+
polyfill.setAttribute("type", "text/javascript");
|
|
196
|
+
polyfill.setAttribute(
|
|
197
|
+
"src",
|
|
198
|
+
root + "/library/egovagismobile/build/dist/polyfill.js"
|
|
199
|
+
);
|
|
200
|
+
document.body.appendChild(polyfill);
|
|
201
|
+
}
|
|
202
|
+
var mainScript = document.createElement("script");
|
|
203
|
+
mainScript.setAttribute("type", "text/javascript");
|
|
204
|
+
var distOrSource = that.gisDebug ? "source" : "dist";
|
|
205
|
+
var url =
|
|
206
|
+
gisServerURL +
|
|
207
|
+
"/library/egovagismobile/build/" +
|
|
208
|
+
distOrSource +
|
|
209
|
+
"/egovagis.js?t=" +
|
|
210
|
+
t;
|
|
211
|
+
var t = new Date().getTime();
|
|
212
|
+
var mainScript = document.createElement("script");
|
|
213
|
+
mainScript.setAttribute("egovagismobile", gisServerURL);
|
|
214
|
+
mainScript.setAttribute("type", "text/javascript");
|
|
215
|
+
mainScript.setAttribute("src", url);
|
|
216
|
+
mainScript.onload = that.createMap.bind(that);
|
|
217
|
+
document.getElementsByTagName("head").item(0).appendChild(mainScript);
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* enableScaleline、debugTile、useCache、humanID、useMask、token、closeDefaultTool(关闭自带工具)
|
|
221
|
+
*/
|
|
222
|
+
that.createMap = function () {
|
|
223
|
+
var params = {
|
|
224
|
+
...context,
|
|
225
|
+
contain: that.id,
|
|
226
|
+
serverURL: context.gisServerURL,
|
|
227
|
+
configName: mapConfig.config,
|
|
228
|
+
};
|
|
229
|
+
var contextOptions = context.options;
|
|
230
|
+
if (contextOptions && typeof contextOptions === "object") {
|
|
231
|
+
for (var key in contextOptions) {
|
|
232
|
+
params[key] = contextOptions[key];
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
if (!window.eMapList) {
|
|
236
|
+
window.eMapList = {};
|
|
227
237
|
}
|
|
228
238
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
var funcName = arguments[0],
|
|
233
|
-
eMap = window.eMapList[that.id];
|
|
234
|
-
if (eMap && eMap[funcName]) {
|
|
235
|
-
var args = [];
|
|
236
|
-
var curArgs = arguments[1];
|
|
237
|
-
for (var i = 0, ilen = curArgs.length; i < ilen; i++) {
|
|
238
|
-
if (context[curArgs[i]]) {
|
|
239
|
-
args.push(proxy(context[curArgs[i]], context));
|
|
240
|
-
} else if (typeof curArgs[i] == 'string') {
|
|
241
|
-
args.push(convertJSON(curArgs[i]))
|
|
242
|
-
} else {
|
|
243
|
-
args.push(curArgs[i]);
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
that.gisDebug && console.log(funcName);
|
|
247
|
-
return eMap[funcName].apply(eMap, args);
|
|
248
|
-
}
|
|
239
|
+
if (typeof eMap === "undefined") {
|
|
240
|
+
console.error("eMap未初始化");
|
|
241
|
+
return;
|
|
249
242
|
}
|
|
250
243
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
try {
|
|
254
|
-
var obj = JSON.parse(str);
|
|
255
|
-
if (typeof obj == 'object' && obj) {
|
|
256
|
-
if (Object.prototype.toString.call(obj) === '[object Object]')
|
|
257
|
-
obj = convertStyle(obj);
|
|
258
|
-
return obj;
|
|
259
|
-
} else {
|
|
260
|
-
return str;
|
|
261
|
-
}
|
|
244
|
+
window.eMapList[that.id] = new eMap(params, that.onMapLoaded.bind(that));
|
|
245
|
+
};
|
|
262
246
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
247
|
+
that.callMap = function () {
|
|
248
|
+
if (!window.eMapList) return;
|
|
249
|
+
|
|
250
|
+
var funcName = arguments[0],
|
|
251
|
+
eMap = window.eMapList[that.id];
|
|
252
|
+
if (eMap && eMap[funcName]) {
|
|
253
|
+
var args = [];
|
|
254
|
+
var curArgs = arguments[1];
|
|
255
|
+
for (var i = 0, ilen = curArgs.length; i < ilen; i++) {
|
|
256
|
+
if (context[curArgs[i]]) {
|
|
257
|
+
args.push(proxy(context[curArgs[i]], context));
|
|
258
|
+
} else if (typeof curArgs[i] == "string") {
|
|
259
|
+
args.push(convertJSON(curArgs[i]));
|
|
260
|
+
} else {
|
|
261
|
+
args.push(curArgs[i]);
|
|
266
262
|
}
|
|
263
|
+
}
|
|
264
|
+
that.gisDebug && console.log(funcName);
|
|
265
|
+
return eMap[funcName].apply(eMap, args);
|
|
267
266
|
}
|
|
267
|
+
};
|
|
268
268
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
var retVal = func.apply(context, args);
|
|
282
|
-
if (typeof retVal == 'string') {
|
|
283
|
-
retVal = convertJSON(retVal);
|
|
284
|
-
}
|
|
285
|
-
return retVal;
|
|
269
|
+
function convertJSON(str) {
|
|
270
|
+
if (typeof str == "string") {
|
|
271
|
+
try {
|
|
272
|
+
var obj = JSON.parse(str);
|
|
273
|
+
if (typeof obj == "object" && obj) {
|
|
274
|
+
if (Object.prototype.toString.call(obj) === "[object Object]")
|
|
275
|
+
obj = convertStyle(obj);
|
|
276
|
+
return obj;
|
|
277
|
+
} else {
|
|
278
|
+
return str;
|
|
286
279
|
}
|
|
280
|
+
} catch (e) {
|
|
281
|
+
return str;
|
|
282
|
+
}
|
|
287
283
|
}
|
|
284
|
+
}
|
|
288
285
|
|
|
286
|
+
function proxy(func, context) {
|
|
287
|
+
return function () {
|
|
288
|
+
var args = [];
|
|
289
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
290
|
+
var arg = arguments[i];
|
|
291
|
+
var type = Array.isArray(arg) ? "array" : typeof arg;
|
|
292
|
+
if (arg && (type == "object" || type == "array")) {
|
|
293
|
+
args.push(JSON.stringify(arg));
|
|
294
|
+
} else {
|
|
295
|
+
args.push(arg);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
var retVal = func.apply(context, args);
|
|
299
|
+
if (typeof retVal == "string") {
|
|
300
|
+
retVal = convertJSON(retVal);
|
|
301
|
+
}
|
|
302
|
+
return retVal;
|
|
303
|
+
};
|
|
304
|
+
}
|
|
289
305
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
306
|
+
//方法挂载
|
|
307
|
+
//地图接口
|
|
308
|
+
var methodEx = [
|
|
309
|
+
"animateMap",
|
|
310
|
+
"locateFeatureByCoords",
|
|
311
|
+
"clearGraphic",
|
|
312
|
+
"setGraphicStyle",
|
|
313
|
+
"removeMapLayer",
|
|
314
|
+
"drawGeometry",
|
|
315
|
+
"showRoute",
|
|
316
|
+
"clearSelectFeature",
|
|
317
|
+
"showWFSLayer",
|
|
318
|
+
"showWMSLayer",
|
|
319
|
+
"showWMSLayerV22",
|
|
320
|
+
"showGridVectorLayer",
|
|
321
|
+
"switchBaseLayer",
|
|
322
|
+
"clearControl",
|
|
323
|
+
"pointSelect",
|
|
324
|
+
"queryFeature",
|
|
325
|
+
"addPopup",
|
|
326
|
+
"setOverlaysVisible",
|
|
327
|
+
"removePopup",
|
|
328
|
+
"getMapCenter",
|
|
329
|
+
"getMapExtent",
|
|
330
|
+
"getFullExtent",
|
|
331
|
+
"measureArea",
|
|
332
|
+
"measureLength",
|
|
333
|
+
"clearMap",
|
|
334
|
+
"zoomIn",
|
|
335
|
+
"zoomOut",
|
|
336
|
+
"zoomToExtent",
|
|
337
|
+
"zoomToCenter",
|
|
338
|
+
"fullExtent",
|
|
339
|
+
"getUsageKeyField",
|
|
340
|
+
"getPartKeyField",
|
|
341
|
+
"buffer",
|
|
342
|
+
"setControlOption",
|
|
343
|
+
"getAddressList",
|
|
344
|
+
"getAddressByXY",
|
|
345
|
+
"convertCoords",
|
|
346
|
+
"getCenterPoints",
|
|
347
|
+
"registerGlobleEvent",
|
|
348
|
+
"removeGlobleEvent",
|
|
349
|
+
"getExtentByGeoms",
|
|
350
|
+
"addMaskLayer",
|
|
351
|
+
"getLayerGroupConfig",
|
|
352
|
+
"initVectorTile",
|
|
353
|
+
"mapDraw",
|
|
354
|
+
"setMapDrag",
|
|
355
|
+
"setLayerProperty",
|
|
356
|
+
"rotateRrecovery",
|
|
357
|
+
"rotationChangeBack",
|
|
358
|
+
"agsToWKT",
|
|
359
|
+
"getZoomInfo",
|
|
360
|
+
"bindMapEvent",
|
|
361
|
+
"removeMapEvent",
|
|
362
|
+
"getArea",
|
|
363
|
+
"getLength",
|
|
364
|
+
"getAllRegionByXY",
|
|
365
|
+
"pointInPolygon",
|
|
366
|
+
"addWMSLayer",
|
|
367
|
+
];
|
|
368
|
+
//业务接口
|
|
369
|
+
var methodBusEx = [
|
|
370
|
+
"markMap",
|
|
371
|
+
"getCellFieldByXY",
|
|
372
|
+
"getPhyFieldByXY",
|
|
373
|
+
"showMultiObjectCurrentPosition",
|
|
374
|
+
"highLightMultiObjectCurrentPosition",
|
|
375
|
+
"changeMultiObjectCurrentPositionAngle",
|
|
376
|
+
"showMultiObjectCurrentPositionCluster",
|
|
377
|
+
"highLightMultiObjectCurrentPositionCluster",
|
|
378
|
+
"addHeatMap",
|
|
379
|
+
"showGeoLocation",
|
|
380
|
+
"showTraceHisLayer",
|
|
381
|
+
"clearTraceHisLayer",
|
|
382
|
+
"showTraceMultiHisLayer",
|
|
383
|
+
"setTraceMultiState",
|
|
384
|
+
"getTraceMultiState",
|
|
385
|
+
"traceMultiSelectbyID",
|
|
386
|
+
"multiPointsSelectbyID",
|
|
387
|
+
"setTraceMultiOptions",
|
|
388
|
+
"updateTraceMultiPosition",
|
|
389
|
+
"showTraceHisData",
|
|
390
|
+
"setTraceState",
|
|
391
|
+
"getTraceState",
|
|
392
|
+
"setTraceOptions",
|
|
393
|
+
"updateTracePosition",
|
|
394
|
+
"showTraceSingleLayer",
|
|
395
|
+
"traceSingleAppendData",
|
|
396
|
+
"hideTraceSingle",
|
|
397
|
+
"setMultiPatrolDynamicPositionOption",
|
|
398
|
+
"showMultiPatrolDynamicPosition",
|
|
399
|
+
"startRealtimeTrace",
|
|
400
|
+
"stopRealtimeTrace",
|
|
401
|
+
"realtimeRrace",
|
|
402
|
+
"stopRealtime",
|
|
403
|
+
"removeRealtimeLayer",
|
|
404
|
+
"getTraceDataInteval",
|
|
405
|
+
"queryObjectInfo",
|
|
406
|
+
"queryPhylayerFields",
|
|
407
|
+
"addControl",
|
|
408
|
+
"addMapvLayer",
|
|
409
|
+
"removeMapvLayer",
|
|
410
|
+
"showTraceHisGradientLayer",
|
|
411
|
+
"setTraceHisGradientStatus",
|
|
412
|
+
"countLength",
|
|
413
|
+
"xkRealTimeTrace",
|
|
414
|
+
"closexkRealTimeTrace",
|
|
415
|
+
];
|
|
416
|
+
methodEx = methodEx.concat(methodBusEx);
|
|
417
|
+
for (let index = 0; index < methodEx.length; index++) {
|
|
418
|
+
var funcName = methodEx[index];
|
|
419
|
+
that[funcName] = (function (method) {
|
|
420
|
+
return function () {
|
|
421
|
+
return that.callMap(method, arguments);
|
|
422
|
+
};
|
|
423
|
+
})(funcName);
|
|
424
|
+
}
|
|
304
425
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
426
|
+
/**
|
|
427
|
+
* 获取移动端原始地图对象(主要为了调用原始ol方法)
|
|
428
|
+
* @returns
|
|
429
|
+
*/
|
|
430
|
+
that.getOriginalMap = function () {
|
|
431
|
+
if (!window.eMapList) return;
|
|
432
|
+
return window.eMapList[that.id];
|
|
433
|
+
};
|
|
313
434
|
|
|
314
|
-
|
|
315
|
-
}
|
|
435
|
+
that.init();
|
|
436
|
+
};
|
|
316
437
|
|
|
317
|
-
export default EGovaMobileMap;
|
|
438
|
+
export default EGovaMobileMap;
|