egovamap 0.14.2 → 0.14.3
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/egovaBI.js +152 -55
- package/egovamap/egovagis.js +4 -4
- package/egovamap/egovagisviewer.js +2 -2
- package/egovamap/egovamap.js +2 -2
- package/package.json +1 -1
package/egovamap/egovaBI.js
CHANGED
|
@@ -289,77 +289,174 @@ var egovaBI = function(globeMap, gisMap, mapType){
|
|
|
289
289
|
);
|
|
290
290
|
});
|
|
291
291
|
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
292
|
+
}
|
|
293
|
+
this.getLabel = function (attributes) {
|
|
294
|
+
if (!attributes) return;
|
|
295
|
+
var label = [], field = {};
|
|
296
|
+
for (var key in attributes) {
|
|
297
|
+
field = {};
|
|
298
|
+
field[key] = attributes[key];
|
|
299
|
+
label.push(field);
|
|
300
|
+
}
|
|
301
|
+
return label;
|
|
302
|
+
};
|
|
303
|
+
this.drawParts = function (options, data) {
|
|
304
|
+
var self = this;
|
|
305
305
|
function showParts(data) {
|
|
306
|
-
|
|
307
|
-
|
|
306
|
+
var drawParam = options.drawParam || {};
|
|
307
|
+
var ctrOption = drawParam.clusterOption;
|
|
308
|
+
var clusterOption = {
|
|
309
|
+
level: ctrOption.level || 0,
|
|
310
|
+
style: {
|
|
311
|
+
"type": "simple-marker",
|
|
312
|
+
"style": "circle",
|
|
313
|
+
"color": ctrOption.color || [255, 0, 0, 0.6],
|
|
314
|
+
"size": ctrOption.size || 20,
|
|
315
|
+
"outline": { //if outline has been specified
|
|
316
|
+
"color": ctrOption.outlineColor || [255, 168, 0, 1],
|
|
317
|
+
"width": ctrOption.outlineWidth || 2
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
labelStyle: {
|
|
321
|
+
"type": "text",
|
|
322
|
+
"color": ctrOption.labelColor || [255, 255, 255, 1],
|
|
323
|
+
"text": "",
|
|
324
|
+
"zlevel": ctrOption.labelZlevel || 1,
|
|
325
|
+
"font": ctrOption.labelFont || {
|
|
326
|
+
"family": "Arial",
|
|
327
|
+
"size": 10
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
distance: ctrOption.distance || 50
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
var param = [data, true, false, null, null, false, drawParam.tagName, clusterOption, false, drawParam.callback, drawParam.layerName, drawParam.drawOptions];
|
|
308
334
|
if (globeMap) {
|
|
309
|
-
globeMap.showMultiObjectCurrentPosition(...
|
|
335
|
+
globeMap.showMultiObjectCurrentPosition(...param);
|
|
310
336
|
} else if (gisMap) {
|
|
311
|
-
gisMap.showMultiObjectCurrentPosition(...
|
|
337
|
+
gisMap.showMultiObjectCurrentPosition(...param);
|
|
312
338
|
}
|
|
313
339
|
}
|
|
314
340
|
|
|
315
|
-
if(data) {
|
|
341
|
+
if (data) {
|
|
316
342
|
showParts(data);
|
|
317
343
|
} else {
|
|
318
344
|
let queryFromGIS = () => {
|
|
319
|
-
|
|
320
|
-
|
|
345
|
+
let queryParam = options.queryParam;
|
|
346
|
+
var subTypeName = options.subTypeName;
|
|
321
347
|
var subUniqueCode = options.subUniqueCode;
|
|
322
348
|
let queryCallback = function (featureInfos) {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
349
|
+
var features = featureInfos[queryParam.phyLayerIDs];
|
|
350
|
+
var symbolUrl = "";
|
|
351
|
+
if (subUniqueCode.indexOf("http") > -1) {
|
|
352
|
+
symbolUrl = subUniqueCode;
|
|
353
|
+
} else if (subUniqueCode.indexOf(".") > -1) {
|
|
354
|
+
symbolUrl = subUniqueCode;
|
|
355
|
+
} else {
|
|
356
|
+
symbolUrl = "".concat(subUniqueCode, ".png");
|
|
357
|
+
}
|
|
358
|
+
var dataList = features.map((function (feature) {
|
|
359
|
+
return Object.assign({}, { x: feature.geometry.x, y: feature.geometry.y }, {
|
|
360
|
+
attributes: feature.attributes,
|
|
361
|
+
//label:self.getLabel(feature.attributes),
|
|
362
|
+
symbolType: -1,
|
|
363
|
+
symbolUrl: symbolUrl,
|
|
364
|
+
});
|
|
365
|
+
}));
|
|
340
366
|
showParts(dataList);
|
|
341
367
|
};
|
|
342
|
-
if(gisMap) {
|
|
343
|
-
gisMap.queryPhylayerFeatures(queryParam, queryCallback);
|
|
368
|
+
if (gisMap) {
|
|
369
|
+
gisMap.queryPhylayerFeatures(queryParam, queryCallback);
|
|
344
370
|
}
|
|
345
371
|
}
|
|
346
|
-
|
|
372
|
+
queryFromGIS();
|
|
347
373
|
}
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
this.drawOtherParts = function (options, data) {
|
|
377
|
+
var self = this;
|
|
378
|
+
const geomType = options.geomType;
|
|
379
|
+
let queryParam = options.queryParam;
|
|
380
|
+
function showParts(data) {
|
|
381
|
+
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
if (data) {
|
|
385
|
+
showParts(data);
|
|
386
|
+
} else {
|
|
387
|
+
const layerID = queryParam.phyLayerIDs;
|
|
388
|
+
const keyField = null;
|
|
389
|
+
const keyValue = null;
|
|
390
|
+
const clearMap = queryParam.clearMap || true;
|
|
391
|
+
let inStyle = queryParam.style || {
|
|
392
|
+
color: "lightblue"
|
|
393
|
+
};
|
|
394
|
+
let inHStyle = queryParam.hStyle || {
|
|
395
|
+
color: "lightblue"
|
|
396
|
+
};
|
|
397
|
+
let style = null, hStyle = null;
|
|
398
|
+
if (geomType == 1) {
|
|
399
|
+
} else if (geomType == 2) {
|
|
400
|
+
style = {
|
|
401
|
+
type: "simple-line", // autocasts as new SimpleLineSymbol()
|
|
402
|
+
color: inStyle.color || "lightblue",
|
|
403
|
+
width: inStyle.width || "2px",
|
|
404
|
+
style: inStyle.style || "solid"
|
|
405
|
+
};
|
|
406
|
+
hStyle = {
|
|
407
|
+
type: "simple-line", // autocasts as new SimpleLineSymbol()
|
|
408
|
+
color: inHStyle.color || "lightblue",
|
|
409
|
+
width: inHStyle.width || "2px",
|
|
410
|
+
style: inHStyle.style || "solid"
|
|
411
|
+
};
|
|
412
|
+
} else if (geomType == 3) {
|
|
413
|
+
style = {
|
|
414
|
+
type: "simple-fill", // autocasts as new SimpleFillSymbol()
|
|
415
|
+
color: inStyle.color || [51, 51, 204, 0.9],
|
|
416
|
+
style: inStyle.style || "solid",
|
|
417
|
+
outline: { // autocasts as new SimpleLineSymbol()
|
|
418
|
+
color: inStyle.outlineColor || "white",
|
|
419
|
+
width: inStyle.outlineWidth || "1px"
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
hStyle = {
|
|
423
|
+
type: "simple-fill", // autocasts as new SimpleFillSymbol()
|
|
424
|
+
color: inHStyle.color || [51, 51, 204, 0.9],
|
|
425
|
+
style: inHStyle.style || "solid",
|
|
426
|
+
outline: { // autocasts as new SimpleLineSymbol()
|
|
427
|
+
color: inHStyle.outlineColor || "white",
|
|
428
|
+
width: inHStyle.outlineWidth || "1px"
|
|
429
|
+
}
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
const bZoom = queryParam.bZoom || true;
|
|
433
|
+
const randomColor = null;
|
|
434
|
+
const labelField = null;
|
|
435
|
+
const labelstyle = null;
|
|
436
|
+
const geometry = null;
|
|
437
|
+
const where = queryParam.where || "1=1";
|
|
438
|
+
|
|
439
|
+
let param = [layerID, keyField, keyValue, clearMap, style, hStyle, bZoom, randomColor, labelField, labelstyle, geometry, where];
|
|
440
|
+
if (globeMap) {
|
|
441
|
+
gisMap.locateFeatureByIDs(...param);
|
|
442
|
+
} else if (gisMap) {
|
|
443
|
+
gisMap.locateFeatureByIDs(...param);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
/*
|
|
450
|
+
* @description:新的轨迹线接口
|
|
451
|
+
* @method traceOperation
|
|
452
|
+
* @param {Array} posArr 位置数组
|
|
453
|
+
* @param {Object} options 配置项
|
|
454
|
+
*
|
|
455
|
+
* @return {Void} 无返回
|
|
456
|
+
*
|
|
457
|
+
* @author: Hetianhong
|
|
458
|
+
* @date: 2021-09-09 14:49:49
|
|
459
|
+
*/
|
|
363
460
|
this.traceOperation = function (posArr, options) {
|
|
364
461
|
globeMap.traceOperation(posArr, options);
|
|
365
462
|
}
|
package/egovamap/egovagis.js
CHANGED
|
@@ -514,8 +514,8 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
|
|
|
514
514
|
if (scene == null)
|
|
515
515
|
return;
|
|
516
516
|
// 移除监听
|
|
517
|
-
that.removeEventBind("showMultiObjectCurrentPositionClick");
|
|
518
|
-
that.removeEventBind("showMultiObjectCurrentPositionMouseover");
|
|
517
|
+
that.removeEventBind("showMultiObjectCurrentPositionClick"+tagName);
|
|
518
|
+
that.removeEventBind("showMultiObjectCurrentPositionMouseover"+tagName);
|
|
519
519
|
var args =[];
|
|
520
520
|
var FuncList = [];
|
|
521
521
|
for(var i = 0;i<arguments.length;i++){
|
|
@@ -526,12 +526,12 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
|
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
528
|
if (FuncList[0] instanceof Function) {
|
|
529
|
-
that.bindEvent("showMultiObjectCurrentPositionClick", function(evt) {
|
|
529
|
+
that.bindEvent("showMultiObjectCurrentPositionClick"+tagName, function(evt) {
|
|
530
530
|
FuncList[0](evt.args);
|
|
531
531
|
});
|
|
532
532
|
}
|
|
533
533
|
if (FuncList[1] instanceof Function) {
|
|
534
|
-
that.bindEvent("showMultiObjectCurrentPositionMouseover", function(evt) {
|
|
534
|
+
that.bindEvent("showMultiObjectCurrentPositionMouseover"+tagName, function(evt) {
|
|
535
535
|
FuncList[1](evt.args);
|
|
536
536
|
});
|
|
537
537
|
}
|
|
@@ -741,7 +741,7 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig, co
|
|
|
741
741
|
that.callMap('getCellNameByPosXY', x, y, gridType, keyField, queryID, cb);
|
|
742
742
|
}
|
|
743
743
|
/* 根据图层字段定位显示 */
|
|
744
|
-
that.locateFeatureByIDs = function (layerID, keyFiled, keyValue, clearMap, style, hStyle, bZoom, randomColor, labelfield, labelstyle, geometry, where, renderCanvas, singleSelected, options, extendProperty, layerTag, outFieldStr, animiteStep, callback, popupTemplate) {
|
|
744
|
+
that.locateFeatureByIDs = function (layerID, keyFiled, keyValue, clearMap, style, hStyle, bZoom, randomColor, labelfield, labelstyle, geometry, where, renderCanvas, singleSelected, options, extendProperty, layerTag, outFieldStr, animiteStep, index, clipGeom, callback, popupTemplate) {
|
|
745
745
|
if (scene == null)
|
|
746
746
|
return;
|
|
747
747
|
if (bZoom == undefined)
|
|
@@ -755,7 +755,7 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig, co
|
|
|
755
755
|
that.fireCallback(type, data);
|
|
756
756
|
}
|
|
757
757
|
};
|
|
758
|
-
that.callMap('locateFeatureByIDs', layerID, keyValue, keyFiled, clearMap, style, hStyle, bZoom, randomColor, labelfield, labelstyle, geometry, where, renderCanvas, singleSelected, options, extendProperty, layerTag, outFieldStr, animiteStep, cb, popupTemplate);
|
|
758
|
+
that.callMap('locateFeatureByIDs', layerID, keyValue, keyFiled, clearMap, style, hStyle, bZoom, randomColor, labelfield, labelstyle, geometry, where, renderCanvas, singleSelected, options, extendProperty, layerTag, outFieldStr, animiteStep, index, clipGeom, cb, popupTemplate);
|
|
759
759
|
}
|
|
760
760
|
/* 显示案件分布 */
|
|
761
761
|
that.showRecListDistribution = function (infoJson, zoom, clickCallback, labelInfo, isShowLegend, symbolUrl) {
|
package/egovamap/egovamap.js
CHANGED
|
@@ -930,7 +930,7 @@ var EGovaMap = function (containerID, callback, mapConfig, mapType, mapParam, co
|
|
|
930
930
|
};
|
|
931
931
|
|
|
932
932
|
/* 根据图层字段定位显示 */
|
|
933
|
-
that.locateFeatureByIDs = function (layerID, keyField, keyValue, clearMap, style, hStyle, bZoom, randomColor, labelfield, labelstyle, geometry, where, renderCanvas, singleSelected, options, extendProperty, layerTag, successFunc,outFieldStr,animiteStep,index,clipGeom) {
|
|
933
|
+
that.locateFeatureByIDs = function (layerID, keyField, keyValue, clearMap, style, hStyle, bZoom, randomColor, labelfield, labelstyle, geometry, where, renderCanvas, singleSelected, options, extendProperty, layerTag, successFunc, outFieldStr, animiteStep, index, clipGeom, callback, popupTemplate) {
|
|
934
934
|
if (scene == null)
|
|
935
935
|
return;
|
|
936
936
|
|
|
@@ -939,7 +939,7 @@ var EGovaMap = function (containerID, callback, mapConfig, mapType, mapParam, co
|
|
|
939
939
|
}
|
|
940
940
|
|
|
941
941
|
if (gisMap != null) {
|
|
942
|
-
gisMap.locateFeatureByIDs.apply(this, [layerID, keyField, keyValue, clearMap, style, hStyle, bZoom, randomColor, labelfield, labelstyle, geometry, where, renderCanvas, singleSelected, options, extendProperty, layerTag,outFieldStr,animiteStep,index,clipGeom]);
|
|
942
|
+
gisMap.locateFeatureByIDs.apply(this, [layerID, keyField, keyValue, clearMap, style, hStyle, bZoom, randomColor, labelfield, labelstyle, geometry, where, renderCanvas, singleSelected, options, extendProperty, layerTag, outFieldStr, animiteStep, index, clipGeom, callback, popupTemplate]);
|
|
943
943
|
}
|
|
944
944
|
if (globeMap != null && gisMap != null) {
|
|
945
945
|
//三维先调用queryFeature查询要素再用locateFeatureByCoords显示
|