egovamap 0.14.0 → 0.14.4
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 +168 -12
- package/egovamap/egovagis.js +7 -7
- package/egovamap/egovagisviewer.js +24 -3
- package/egovamap/egovamap.js +41 -4
- package/package.json +1 -1
package/egovamap/egovaBI.js
CHANGED
|
@@ -289,18 +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
|
-
|
|
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
|
+
function showParts(data) {
|
|
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];
|
|
334
|
+
if (globeMap) {
|
|
335
|
+
globeMap.showMultiObjectCurrentPosition(...param);
|
|
336
|
+
} else if (gisMap) {
|
|
337
|
+
gisMap.showMultiObjectCurrentPosition(...param);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
if (data) {
|
|
342
|
+
showParts(data);
|
|
343
|
+
} else {
|
|
344
|
+
let queryFromGIS = () => {
|
|
345
|
+
let queryParam = options.queryParam;
|
|
346
|
+
var subTypeName = options.subTypeName;
|
|
347
|
+
var subUniqueCode = options.subUniqueCode;
|
|
348
|
+
let queryCallback = function (featureInfos) {
|
|
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
|
+
}));
|
|
366
|
+
showParts(dataList);
|
|
367
|
+
};
|
|
368
|
+
if (gisMap) {
|
|
369
|
+
gisMap.queryPhylayerFeatures(queryParam, queryCallback);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
queryFromGIS();
|
|
373
|
+
}
|
|
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
|
+
*/
|
|
304
460
|
this.traceOperation = function (posArr, options) {
|
|
305
461
|
globeMap.traceOperation(posArr, options);
|
|
306
462
|
}
|
package/egovamap/egovagis.js
CHANGED
|
@@ -510,12 +510,12 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
|
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
512
|
/* 显示多个自定义图标 */
|
|
513
|
-
that.showMultiObjectCurrentPosition = function (jsonInfo, zoom, bClear, hStyleID, infoStyle, bCanvas, tagName, clusterOption, hasHover, layerID,
|
|
513
|
+
that.showMultiObjectCurrentPosition = function (jsonInfo, zoom, bClear, hStyleID, infoStyle, bCanvas, tagName, clickCallback, mouseOverCallBack, clusterOption, hasHover, layerID, mouseOutCallback, options) {
|
|
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
|
}
|
|
@@ -928,7 +928,7 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
|
|
|
928
928
|
scene.fire(msgPrefix + ":addChart", {args: [option, zoom,id,minZoom,maxZoom]}, parentScene);
|
|
929
929
|
}
|
|
930
930
|
|
|
931
|
-
that.drawGeometry = function(type, style, clear, callback) {
|
|
931
|
+
that.drawGeometry = function(type, style, clear, callback, option) {
|
|
932
932
|
type = type || "point";
|
|
933
933
|
style = style || {"type":"esriSLS","style":"esriSLSSolid","color":[255,0,0,255],"width":2};
|
|
934
934
|
//移除监听
|
|
@@ -939,7 +939,7 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
|
|
|
939
939
|
});
|
|
940
940
|
}
|
|
941
941
|
|
|
942
|
-
scene.fire(msgPrefix + ":drawGeometry", {args: [type, style, clear]}, parentScene);
|
|
942
|
+
scene.fire(msgPrefix + ":drawGeometry", {args: [type, style, clear, callback, option]}, parentScene);
|
|
943
943
|
}
|
|
944
944
|
|
|
945
945
|
/* 热力图*/
|
|
@@ -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) {
|
|
@@ -857,7 +857,7 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig, co
|
|
|
857
857
|
}
|
|
858
858
|
|
|
859
859
|
/* 显示多个自定义图标 */
|
|
860
|
-
that.showMultiObjectCurrentPosition = function (jsonInfo, zoom, bClear, hStyleID, infoStyle, bCanvas, clickCallback,
|
|
860
|
+
that.showMultiObjectCurrentPosition = function (jsonInfo, zoom, bClear, hStyleID, infoStyle, bCanvas, tagName, clickCallback, mouseOverCallback, clusterOption, hasHover, layerName, mouseOutCallback, options) {
|
|
861
861
|
if (scene == null)
|
|
862
862
|
return;
|
|
863
863
|
|
|
@@ -1799,7 +1799,28 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig, co
|
|
|
1799
1799
|
|
|
1800
1800
|
that.callMap('removeWMSLayer', layerName);
|
|
1801
1801
|
}
|
|
1802
|
+
|
|
1803
|
+
that.getMainSubTypeTree = function (params, callback) {
|
|
1804
|
+
if (scene == null)
|
|
1805
|
+
return;
|
|
1806
|
+
var cb = function (type, data) {
|
|
1807
|
+
if (callback && type == 'getMainSubTypeTreeCallback') {
|
|
1808
|
+
callback(data);
|
|
1809
|
+
}
|
|
1810
|
+
};
|
|
1811
|
+
that.callMap('getMainSubTypeTree', params, cb);
|
|
1812
|
+
}
|
|
1802
1813
|
|
|
1814
|
+
that.getRegion = function (params, callback) {
|
|
1815
|
+
if (scene == null)
|
|
1816
|
+
return;
|
|
1817
|
+
var cb = function (type, data) {
|
|
1818
|
+
if (callback && type == 'getRegionCallback') {
|
|
1819
|
+
callback(data);
|
|
1820
|
+
}
|
|
1821
|
+
};
|
|
1822
|
+
that.callMap('getRegion', params, cb);
|
|
1823
|
+
}
|
|
1803
1824
|
that.init();
|
|
1804
1825
|
}
|
|
1805
1826
|
|
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显示
|
|
@@ -1664,7 +1664,7 @@ var EGovaMap = function (containerID, callback, mapConfig, mapType, mapParam, co
|
|
|
1664
1664
|
};
|
|
1665
1665
|
|
|
1666
1666
|
/* 显示多个自定义图标 */
|
|
1667
|
-
that.showMultiObjectCurrentPosition = function (jsonInfo, zoom, bClear, hStyleID, infoStyle, bCanvas, tagName, clickCallback, mouseOverCallBack, clusterOption, hasHover, layerID) {
|
|
1667
|
+
that.showMultiObjectCurrentPosition = function (jsonInfo, zoom, bClear, hStyleID, infoStyle, bCanvas, tagName, clickCallback, mouseOverCallBack, clusterOption, hasHover, layerID, mouseOutCallback, options) {
|
|
1668
1668
|
if (scene == null)
|
|
1669
1669
|
return;
|
|
1670
1670
|
if (gisMap != null && that.synchroSetting === true) {
|
|
@@ -3596,6 +3596,43 @@ var EGovaMap = function (containerID, callback, mapConfig, mapType, mapParam, co
|
|
|
3596
3596
|
gisMap.removeWMSLayer(layerName);
|
|
3597
3597
|
}
|
|
3598
3598
|
}
|
|
3599
|
+
|
|
3600
|
+
/**
|
|
3601
|
+
* 获取大小类树
|
|
3602
|
+
* @param {String} params:{
|
|
3603
|
+
* usageid: 3002, //区域图层用途
|
|
3604
|
+
* regioncode: 420115001, //区域编码
|
|
3605
|
+
* where: 'MAIN_UNIQUE_CODE > 0',
|
|
3606
|
+
* orderfield: 'SUB_UNIQUE_CODE',
|
|
3607
|
+
* returntree: true
|
|
3608
|
+
* };
|
|
3609
|
+
* @callback 回调函数
|
|
3610
|
+
* @returns {void}
|
|
3611
|
+
*/
|
|
3612
|
+
that.getMainSubTypeTree = function (params, callback) {
|
|
3613
|
+
if (scene == null)
|
|
3614
|
+
return;
|
|
3615
|
+
if (gisMap != null) {
|
|
3616
|
+
gisMap.getMainSubTypeTree(params, callback);
|
|
3617
|
+
}
|
|
3618
|
+
}
|
|
3619
|
+
|
|
3620
|
+
/**
|
|
3621
|
+
* 获取区域信息
|
|
3622
|
+
* @param {String} params: {
|
|
3623
|
+
* regionType: 1, // 区域类型:1:市 | 2:区 | 3:街道 | 4:社区
|
|
3624
|
+
* seniorId: -1
|
|
3625
|
+
* }
|
|
3626
|
+
* @callback 回调函数
|
|
3627
|
+
* @returns {void}
|
|
3628
|
+
*/
|
|
3629
|
+
that.getRegion = function (params, callback) {
|
|
3630
|
+
if (scene == null)
|
|
3631
|
+
return;
|
|
3632
|
+
if (gisMap != null) {
|
|
3633
|
+
gisMap.getRegion(params, callback);
|
|
3634
|
+
}
|
|
3635
|
+
}
|
|
3599
3636
|
|
|
3600
3637
|
/**
|
|
3601
3638
|
* 二维展示案件荧光点位接口
|
|
@@ -3653,7 +3690,7 @@ var EGovaMap = function (containerID, callback, mapConfig, mapType, mapParam, co
|
|
|
3653
3690
|
if (gisMap != null) {
|
|
3654
3691
|
gisMap.traceMultiSelectbyID.apply(this, arguments);
|
|
3655
3692
|
}
|
|
3656
|
-
}
|
|
3693
|
+
}
|
|
3657
3694
|
|
|
3658
3695
|
|
|
3659
3696
|
that.initMap(containerID, callback, mapType, mapConfig);
|