egovamap 0.15.2 → 0.15.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 +39 -25
- package/package.json +1 -1
package/egovamap/egovaBI.js
CHANGED
|
@@ -386,6 +386,7 @@ var egovaBI = function(globeMap, gisMap, mapType){
|
|
|
386
386
|
showParts(data);
|
|
387
387
|
} else {
|
|
388
388
|
const layerID = queryParam.phyLayerIDs;
|
|
389
|
+
const layerName = queryParam.layerName;
|
|
389
390
|
const keyField = null;
|
|
390
391
|
const keyValue = null;
|
|
391
392
|
const clearMap = queryParam.clearMap || true;
|
|
@@ -402,13 +403,17 @@ var egovaBI = function(globeMap, gisMap, mapType){
|
|
|
402
403
|
type: "simple-line", // autocasts as new SimpleLineSymbol()
|
|
403
404
|
color: inStyle.color || "lightblue",
|
|
404
405
|
width: inStyle.width || "2px",
|
|
405
|
-
style: inStyle.style || "solid"
|
|
406
|
+
style: inStyle.style || "solid",
|
|
407
|
+
cap: inStyle.cap || "round",
|
|
408
|
+
join: inStyle.join || "round",
|
|
406
409
|
};
|
|
407
410
|
hStyle = {
|
|
408
411
|
type: "simple-line", // autocasts as new SimpleLineSymbol()
|
|
409
412
|
color: inHStyle.color || "lightblue",
|
|
410
|
-
width: inHStyle.width || "2px",
|
|
411
|
-
style: inHStyle.style || "solid"
|
|
413
|
+
width: inHStyle.width || inStyle.width || "2px",
|
|
414
|
+
style: inHStyle.style || inStyle.style || "solid",
|
|
415
|
+
cap: inHStyle.cap || inStyle.cap || "round",
|
|
416
|
+
join: inHStyle.join || inStyle.join || "round",
|
|
412
417
|
};
|
|
413
418
|
} else if (geomType == 3) {
|
|
414
419
|
style = {
|
|
@@ -416,17 +421,23 @@ var egovaBI = function(globeMap, gisMap, mapType){
|
|
|
416
421
|
color: inStyle.color || [51, 51, 204, 0.9],
|
|
417
422
|
style: inStyle.style || "solid",
|
|
418
423
|
outline: { // autocasts as new SimpleLineSymbol()
|
|
419
|
-
color: inStyle.outlineColor || "
|
|
420
|
-
width: inStyle.outlineWidth || "1px"
|
|
424
|
+
color: inStyle.outlineColor || "lightblue",
|
|
425
|
+
width: inStyle.outlineWidth || "1px",
|
|
426
|
+
style: inStyle.outStyle || "solid",
|
|
427
|
+
cap: inStyle.outlineCap || "round",
|
|
428
|
+
join: inStyle.outlineJoin || "round",
|
|
421
429
|
}
|
|
422
430
|
};
|
|
423
431
|
hStyle = {
|
|
424
432
|
type: "simple-fill", // autocasts as new SimpleFillSymbol()
|
|
425
433
|
color: inHStyle.color || [51, 51, 204, 0.9],
|
|
426
|
-
style: inHStyle.style || "solid",
|
|
434
|
+
style: inHStyle.style || inStyle.style || "solid",
|
|
427
435
|
outline: { // autocasts as new SimpleLineSymbol()
|
|
428
|
-
color: inHStyle.outlineColor || "
|
|
429
|
-
width: inHStyle.outlineWidth || "1px"
|
|
436
|
+
color: inHStyle.outlineColor || "lightblue",
|
|
437
|
+
width: inHStyle.outlineWidth || inStyle.outlineWidth || "1px",
|
|
438
|
+
style: inHStyle.outlineStyle || inStyle.outlineStyle || "solid",
|
|
439
|
+
cap: inHStyle.outlineCap || inStyle.outlineCap || "round",
|
|
440
|
+
join: inHStyle.outlineJoin || inStyle.outlineJoin || "round",
|
|
430
441
|
}
|
|
431
442
|
};
|
|
432
443
|
}
|
|
@@ -436,8 +447,11 @@ var egovaBI = function(globeMap, gisMap, mapType){
|
|
|
436
447
|
const labelstyle = null;
|
|
437
448
|
const geometry = null;
|
|
438
449
|
const where = queryParam.where || "1=1";
|
|
450
|
+
const opts = {
|
|
451
|
+
layerId: layerName
|
|
452
|
+
};
|
|
439
453
|
|
|
440
|
-
let param = [layerID, keyField, keyValue, clearMap, style, hStyle, bZoom, randomColor, labelField, labelstyle, geometry, where];
|
|
454
|
+
let param = [layerID, keyField, keyValue, clearMap, style, hStyle, bZoom, randomColor, labelField, labelstyle, geometry, where, null, null, opts];
|
|
441
455
|
if (globeMap) {
|
|
442
456
|
gisMap.locateFeatureByIDs(...param);
|
|
443
457
|
} else if (gisMap) {
|
|
@@ -483,10 +497,10 @@ var egovaBI = function(globeMap, gisMap, mapType){
|
|
|
483
497
|
}
|
|
484
498
|
}
|
|
485
499
|
|
|
486
|
-
if(data) {
|
|
500
|
+
if (data) {
|
|
487
501
|
execOperation(data);
|
|
488
502
|
} else {
|
|
489
|
-
if(!options.idbSetting.usageID){return}
|
|
503
|
+
if (!options.idbSetting.usageID) { return }
|
|
490
504
|
|
|
491
505
|
let storeName = !!globeMap ? "usageID" : "usage2D" + "_" + options.idbSetting.usageID;
|
|
492
506
|
let queryFromGIS = () => {
|
|
@@ -496,33 +510,33 @@ var egovaBI = function(globeMap, gisMap, mapType){
|
|
|
496
510
|
where: filterString,
|
|
497
511
|
geometry: '',
|
|
498
512
|
outGeometry: true,
|
|
499
|
-
options:{
|
|
500
|
-
originalData:true
|
|
513
|
+
options: {
|
|
514
|
+
originalData: true
|
|
501
515
|
}
|
|
502
516
|
}
|
|
503
517
|
let queryCallback = function (featureInfos) {
|
|
504
518
|
execOperation(featureInfos);
|
|
505
519
|
}
|
|
506
|
-
if(gisMap) {
|
|
507
|
-
gisMap.queryFeature(queryParam, queryCallback)
|
|
520
|
+
if (gisMap) {
|
|
521
|
+
gisMap.queryFeature(queryParam, queryCallback)
|
|
508
522
|
}
|
|
509
523
|
}
|
|
510
524
|
|
|
511
|
-
if(!options.idbSetting.enabled) {
|
|
525
|
+
if (!options.idbSetting.enabled) {
|
|
512
526
|
// 直接查询
|
|
513
527
|
queryFromGIS()
|
|
514
528
|
} else {
|
|
515
529
|
// 查询是否存在表
|
|
516
530
|
checkObjectStore(storeName)
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
531
|
+
.then(function (hasObjStore) {
|
|
532
|
+
if (hasObjStore) {
|
|
533
|
+
// 如果有,读取本地
|
|
534
|
+
execOperation();
|
|
535
|
+
} else {
|
|
536
|
+
// 如果没有,查询queryFeature
|
|
537
|
+
queryFromGIS()
|
|
538
|
+
}
|
|
539
|
+
})
|
|
526
540
|
}
|
|
527
541
|
}
|
|
528
542
|
}
|