egovamap 0.33.28 → 0.33.29
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/egovagisviewer.js +116 -108
- package/package.json +1 -1
|
@@ -134,124 +134,132 @@ var EGovaGISMap = function (
|
|
|
134
134
|
that.onMapLoaded = function () {
|
|
135
135
|
that.isLoading = false;
|
|
136
136
|
that.gisLoaded = true;
|
|
137
|
-
|
|
138
|
-
if (context.mapCenterFlag
|
|
139
|
-
if (context.
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
if (context.
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
color: [100, 100, 255, 0.5],
|
|
160
|
-
outline: {
|
|
161
|
-
type: "simple-line",
|
|
137
|
+
var cb = function() {
|
|
138
|
+
if (context.mapCenterFlag) {
|
|
139
|
+
if (context.mapCenterFlag == "1") {
|
|
140
|
+
if (context.coordinateX && context.coordinateY) {
|
|
141
|
+
that.centerAndZoom(
|
|
142
|
+
context.coordinateX,
|
|
143
|
+
context.coordinateY,
|
|
144
|
+
4
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
} else if (context.mapCenterFlag == "2") {
|
|
148
|
+
if (context.coordinateX && context.coordinateY) {
|
|
149
|
+
that.centerAndZoom(
|
|
150
|
+
context.coordinateX,
|
|
151
|
+
context.coordinateY,
|
|
152
|
+
1
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
if (context.humanLayerUsageID && context.regionCode) {
|
|
156
|
+
var zoom = gisParams && gisParams.maskZoom == true;
|
|
157
|
+
var style = {
|
|
158
|
+
type: "simple-fill",
|
|
162
159
|
style: "solid",
|
|
163
|
-
color: [
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
160
|
+
color: [100, 100, 255, 0.5],
|
|
161
|
+
outline: {
|
|
162
|
+
type: "simple-line",
|
|
163
|
+
style: "solid",
|
|
164
|
+
color: [255, 0, 0, 1],
|
|
165
|
+
width: 1,
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
var pos = {
|
|
169
|
+
visible: true,
|
|
170
|
+
top: 95,
|
|
171
|
+
right: 127,
|
|
172
|
+
};
|
|
173
|
+
if (mapConfig && mapConfig.maskPos) {
|
|
174
|
+
pos = MapUtils.deepClones(
|
|
175
|
+
true,
|
|
176
|
+
{},
|
|
177
|
+
pos,
|
|
178
|
+
mapConfig.maskPos
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
that.addMaskLayer(
|
|
182
|
+
context.humanLayerUsageID,
|
|
183
|
+
context.humanLayerKeyFieldName,
|
|
184
|
+
context.regionCode,
|
|
185
|
+
style,
|
|
186
|
+
zoom,
|
|
187
|
+
pos
|
|
178
188
|
);
|
|
179
189
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
context.coordinateX,
|
|
193
|
-
context.coordinateY,
|
|
194
|
-
1
|
|
195
|
-
);
|
|
196
|
-
}
|
|
197
|
-
if (context.humanLayerUsageID && context.regionCode) {
|
|
198
|
-
var zoom = gisParams && gisParams.maskZoom == false;
|
|
199
|
-
var style = {
|
|
200
|
-
type: "simple-fill",
|
|
201
|
-
style: "solid",
|
|
202
|
-
color: [100, 100, 255, 0],
|
|
203
|
-
outline: {
|
|
204
|
-
type: "simple-line",
|
|
190
|
+
} else if (context.mapCenterFlag == "3") {
|
|
191
|
+
if (context.coordinateX && context.coordinateY) {
|
|
192
|
+
that.centerAndZoom(
|
|
193
|
+
context.coordinateX,
|
|
194
|
+
context.coordinateY,
|
|
195
|
+
1
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
if (context.humanLayerUsageID && context.regionCode) {
|
|
199
|
+
var zoom = gisParams && gisParams.maskZoom == false;
|
|
200
|
+
var style = {
|
|
201
|
+
type: "simple-fill",
|
|
205
202
|
style: "solid",
|
|
206
|
-
color: [
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
203
|
+
color: [100, 100, 255, 0],
|
|
204
|
+
outline: {
|
|
205
|
+
type: "simple-line",
|
|
206
|
+
style: "solid",
|
|
207
|
+
color: [255, 0, 0, 1],
|
|
208
|
+
width: 3,
|
|
209
|
+
},
|
|
210
|
+
};
|
|
211
|
+
var pos = {
|
|
212
|
+
visible: true,
|
|
213
|
+
top: 95,
|
|
214
|
+
right: 127,
|
|
215
|
+
};
|
|
216
|
+
if (mapConfig && mapConfig.maskPos) {
|
|
217
|
+
pos = MapUtils.deepClones(
|
|
218
|
+
true,
|
|
219
|
+
{},
|
|
220
|
+
pos,
|
|
221
|
+
mapConfig.maskPos
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
that.addMaskLayer(
|
|
225
|
+
context.humanLayerUsageID,
|
|
226
|
+
context.humanLayerKeyFieldName,
|
|
227
|
+
context.regionCode,
|
|
228
|
+
style,
|
|
229
|
+
zoom,
|
|
230
|
+
pos
|
|
221
231
|
);
|
|
222
232
|
}
|
|
223
|
-
that.addMaskLayer(
|
|
224
|
-
context.humanLayerUsageID,
|
|
225
|
-
context.humanLayerKeyFieldName,
|
|
226
|
-
context.regionCode,
|
|
227
|
-
style,
|
|
228
|
-
zoom,
|
|
229
|
-
pos
|
|
230
|
-
);
|
|
231
233
|
}
|
|
232
234
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
235
|
+
try {
|
|
236
|
+
//如果启用了实景功能需要注册实景监听
|
|
237
|
+
if (context.mmsEnabled != undefined && that.gisMapContainer) {
|
|
238
|
+
var mmsEnabled = Number(context.mmsEnabled);
|
|
239
|
+
if (mmsEnabled > 0) {
|
|
240
|
+
var eMap = window.eMapList[that.id];
|
|
241
|
+
mmsMap = new EGovaMMSMap(
|
|
242
|
+
$container,
|
|
243
|
+
scene,
|
|
244
|
+
msgPrefix,
|
|
245
|
+
context.mmsParams,
|
|
246
|
+
mapConfig,
|
|
247
|
+
mmsEnabled,
|
|
248
|
+
eMap
|
|
249
|
+
);
|
|
250
|
+
}
|
|
249
251
|
}
|
|
252
|
+
} catch (e) {
|
|
253
|
+
console.error(e.message);
|
|
250
254
|
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
+
callback && callback();
|
|
256
|
+
};
|
|
257
|
+
var eMap = window.eMapList[that.id];
|
|
258
|
+
$.get(eMap.serverURL + '/home/gis/map/getsysconfig.htm?getConfigMode=onlyGetOtherConfig', {}, function (data) {
|
|
259
|
+
eMap.egovagis.sysConfig = $.extend({}, eMap.egovagis.sysConfig, data[0]);
|
|
260
|
+
cb(),
|
|
261
|
+
'jsonp';
|
|
262
|
+
})
|
|
255
263
|
};
|
|
256
264
|
|
|
257
265
|
that.init = function () {
|