egovamap 0.14.5 → 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 +41 -26
- package/egovamap/egovagis.js +18 -4
- package/egovamap/egovagisviewer.js +5 -0
- package/egovamap/egovamap.js +29 -0
- package/package.json +6 -2
package/egovamap/egovaBI.js
CHANGED
|
@@ -322,6 +322,7 @@ var egovaBI = function(globeMap, gisMap, mapType){
|
|
|
322
322
|
"color": ctrOption.labelColor || [255, 255, 255, 1],
|
|
323
323
|
"text": "",
|
|
324
324
|
"zlevel": ctrOption.labelZlevel || 1,
|
|
325
|
+
"yoffset": -4,
|
|
325
326
|
"font": ctrOption.labelFont || {
|
|
326
327
|
"family": "Arial",
|
|
327
328
|
"size": 10
|
|
@@ -330,7 +331,7 @@ var egovaBI = function(globeMap, gisMap, mapType){
|
|
|
330
331
|
distance: ctrOption.distance || 50
|
|
331
332
|
};
|
|
332
333
|
|
|
333
|
-
var param = [data, true, false, null, null, false, drawParam.tagName, clusterOption, false, drawParam.
|
|
334
|
+
var param = [data, true, false, null, null, false, drawParam.tagName, drawParam.clickCallback, drawParam.mouseOverCallback, clusterOption, false, drawParam.layerName, drawParam.callback, drawParam.drawOptions];
|
|
334
335
|
if (globeMap) {
|
|
335
336
|
globeMap.showMultiObjectCurrentPosition(...param);
|
|
336
337
|
} else if (gisMap) {
|
|
@@ -385,6 +386,7 @@ var egovaBI = function(globeMap, gisMap, mapType){
|
|
|
385
386
|
showParts(data);
|
|
386
387
|
} else {
|
|
387
388
|
const layerID = queryParam.phyLayerIDs;
|
|
389
|
+
const layerName = queryParam.layerName;
|
|
388
390
|
const keyField = null;
|
|
389
391
|
const keyValue = null;
|
|
390
392
|
const clearMap = queryParam.clearMap || true;
|
|
@@ -401,13 +403,17 @@ var egovaBI = function(globeMap, gisMap, mapType){
|
|
|
401
403
|
type: "simple-line", // autocasts as new SimpleLineSymbol()
|
|
402
404
|
color: inStyle.color || "lightblue",
|
|
403
405
|
width: inStyle.width || "2px",
|
|
404
|
-
style: inStyle.style || "solid"
|
|
406
|
+
style: inStyle.style || "solid",
|
|
407
|
+
cap: inStyle.cap || "round",
|
|
408
|
+
join: inStyle.join || "round",
|
|
405
409
|
};
|
|
406
410
|
hStyle = {
|
|
407
411
|
type: "simple-line", // autocasts as new SimpleLineSymbol()
|
|
408
412
|
color: inHStyle.color || "lightblue",
|
|
409
|
-
width: inHStyle.width || "2px",
|
|
410
|
-
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",
|
|
411
417
|
};
|
|
412
418
|
} else if (geomType == 3) {
|
|
413
419
|
style = {
|
|
@@ -415,17 +421,23 @@ var egovaBI = function(globeMap, gisMap, mapType){
|
|
|
415
421
|
color: inStyle.color || [51, 51, 204, 0.9],
|
|
416
422
|
style: inStyle.style || "solid",
|
|
417
423
|
outline: { // autocasts as new SimpleLineSymbol()
|
|
418
|
-
color: inStyle.outlineColor || "
|
|
419
|
-
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",
|
|
420
429
|
}
|
|
421
430
|
};
|
|
422
431
|
hStyle = {
|
|
423
432
|
type: "simple-fill", // autocasts as new SimpleFillSymbol()
|
|
424
433
|
color: inHStyle.color || [51, 51, 204, 0.9],
|
|
425
|
-
style: inHStyle.style || "solid",
|
|
434
|
+
style: inHStyle.style || inStyle.style || "solid",
|
|
426
435
|
outline: { // autocasts as new SimpleLineSymbol()
|
|
427
|
-
color: inHStyle.outlineColor || "
|
|
428
|
-
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",
|
|
429
441
|
}
|
|
430
442
|
};
|
|
431
443
|
}
|
|
@@ -435,8 +447,11 @@ var egovaBI = function(globeMap, gisMap, mapType){
|
|
|
435
447
|
const labelstyle = null;
|
|
436
448
|
const geometry = null;
|
|
437
449
|
const where = queryParam.where || "1=1";
|
|
450
|
+
const opts = {
|
|
451
|
+
layerId: layerName
|
|
452
|
+
};
|
|
438
453
|
|
|
439
|
-
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];
|
|
440
455
|
if (globeMap) {
|
|
441
456
|
gisMap.locateFeatureByIDs(...param);
|
|
442
457
|
} else if (gisMap) {
|
|
@@ -482,10 +497,10 @@ var egovaBI = function(globeMap, gisMap, mapType){
|
|
|
482
497
|
}
|
|
483
498
|
}
|
|
484
499
|
|
|
485
|
-
if(data) {
|
|
500
|
+
if (data) {
|
|
486
501
|
execOperation(data);
|
|
487
502
|
} else {
|
|
488
|
-
if(!options.idbSetting.usageID){return}
|
|
503
|
+
if (!options.idbSetting.usageID) { return }
|
|
489
504
|
|
|
490
505
|
let storeName = !!globeMap ? "usageID" : "usage2D" + "_" + options.idbSetting.usageID;
|
|
491
506
|
let queryFromGIS = () => {
|
|
@@ -495,33 +510,33 @@ var egovaBI = function(globeMap, gisMap, mapType){
|
|
|
495
510
|
where: filterString,
|
|
496
511
|
geometry: '',
|
|
497
512
|
outGeometry: true,
|
|
498
|
-
options:{
|
|
499
|
-
originalData:true
|
|
513
|
+
options: {
|
|
514
|
+
originalData: true
|
|
500
515
|
}
|
|
501
516
|
}
|
|
502
517
|
let queryCallback = function (featureInfos) {
|
|
503
518
|
execOperation(featureInfos);
|
|
504
519
|
}
|
|
505
|
-
if(gisMap) {
|
|
506
|
-
gisMap.queryFeature(queryParam, queryCallback)
|
|
520
|
+
if (gisMap) {
|
|
521
|
+
gisMap.queryFeature(queryParam, queryCallback)
|
|
507
522
|
}
|
|
508
523
|
}
|
|
509
524
|
|
|
510
|
-
if(!options.idbSetting.enabled) {
|
|
525
|
+
if (!options.idbSetting.enabled) {
|
|
511
526
|
// 直接查询
|
|
512
527
|
queryFromGIS()
|
|
513
528
|
} else {
|
|
514
529
|
// 查询是否存在表
|
|
515
530
|
checkObjectStore(storeName)
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
531
|
+
.then(function (hasObjStore) {
|
|
532
|
+
if (hasObjStore) {
|
|
533
|
+
// 如果有,读取本地
|
|
534
|
+
execOperation();
|
|
535
|
+
} else {
|
|
536
|
+
// 如果没有,查询queryFeature
|
|
537
|
+
queryFromGIS()
|
|
538
|
+
}
|
|
539
|
+
})
|
|
525
540
|
}
|
|
526
541
|
}
|
|
527
542
|
}
|
package/egovamap/egovagis.js
CHANGED
|
@@ -514,8 +514,14 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
|
|
|
514
514
|
if (scene == null)
|
|
515
515
|
return;
|
|
516
516
|
// 移除监听
|
|
517
|
-
|
|
518
|
-
|
|
517
|
+
var clickBackName = "showMultiObjectCurrentPositionClick";
|
|
518
|
+
var mouseOverBackName = "showMultiObjectCurrentPositionMouseover";
|
|
519
|
+
if(tagName){
|
|
520
|
+
clickBackName += tagName;
|
|
521
|
+
mouseOverBackName += tagName;
|
|
522
|
+
}
|
|
523
|
+
that.removeEventBind(clickBackName);
|
|
524
|
+
that.removeEventBind(mouseOverBackName);
|
|
519
525
|
var args =[];
|
|
520
526
|
var FuncList = [];
|
|
521
527
|
for(var i = 0;i<arguments.length;i++){
|
|
@@ -526,12 +532,12 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
|
|
|
526
532
|
}
|
|
527
533
|
}
|
|
528
534
|
if (FuncList[0] instanceof Function) {
|
|
529
|
-
that.bindEvent(
|
|
535
|
+
that.bindEvent(clickBackName, function(evt) {
|
|
530
536
|
FuncList[0](evt.args);
|
|
531
537
|
});
|
|
532
538
|
}
|
|
533
539
|
if (FuncList[1] instanceof Function) {
|
|
534
|
-
that.bindEvent(
|
|
540
|
+
that.bindEvent(mouseOverBackName, function(evt) {
|
|
535
541
|
FuncList[1](evt.args);
|
|
536
542
|
});
|
|
537
543
|
}
|
|
@@ -1132,6 +1138,14 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
|
|
|
1132
1138
|
return scene.fire(msgPrefix + ":getPolygonArea", {args: [geometry]},parentScene);
|
|
1133
1139
|
}
|
|
1134
1140
|
|
|
1141
|
+
that.intersectGeometry = function (polygon1, polygon2) {
|
|
1142
|
+
return scene.fire(msgPrefix + ":intersectGeometry", {args: [polygon1, polygon2]}, parentScene);
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
that.getCenterPoint = function (polygon) {
|
|
1146
|
+
return scene.fire(msgPrefix + ":getCenterPoint", {args: [polygon]}, parentScene);
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1135
1149
|
/* 根据PointID定位空中全景 */
|
|
1136
1150
|
that.mmsAirPanoLocateByID = function(pointID) {
|
|
1137
1151
|
if(mmsMap && mmsMap.mmsLoaded) {
|
|
@@ -1821,6 +1821,11 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig, co
|
|
|
1821
1821
|
};
|
|
1822
1822
|
that.callMap('getRegion', params, cb);
|
|
1823
1823
|
}
|
|
1824
|
+
|
|
1825
|
+
that.getMapConfig = function(key, callback){
|
|
1826
|
+
that.callMap('getMapConfig', key, callback);
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1824
1829
|
that.init();
|
|
1825
1830
|
}
|
|
1826
1831
|
|
package/egovamap/egovamap.js
CHANGED
|
@@ -2587,6 +2587,26 @@ var EGovaMap = function (containerID, callback, mapConfig, mapType, mapParam, co
|
|
|
2587
2587
|
return gisMap.getPolygonArea.apply(this, arguments);
|
|
2588
2588
|
}
|
|
2589
2589
|
|
|
2590
|
+
/**
|
|
2591
|
+
* 计算面的相交部分
|
|
2592
|
+
*/
|
|
2593
|
+
that.intersectGeometry = function(polygon1, polygon2) {
|
|
2594
|
+
if (scene == null)
|
|
2595
|
+
return;
|
|
2596
|
+
if (gisMap != null)
|
|
2597
|
+
return gisMap.intersectGeometry.apply(this, arguments);
|
|
2598
|
+
}
|
|
2599
|
+
|
|
2600
|
+
/**
|
|
2601
|
+
* 获取面的中心点
|
|
2602
|
+
*/
|
|
2603
|
+
that.getCenterPoint = function(polygon) {
|
|
2604
|
+
if (scene == null)
|
|
2605
|
+
return;
|
|
2606
|
+
if (gisMap != null)
|
|
2607
|
+
return gisMap.getCenterPoint.apply(this, arguments);
|
|
2608
|
+
}
|
|
2609
|
+
|
|
2590
2610
|
/* 切换地图类型 */
|
|
2591
2611
|
that.changeControlParam = function (type, param) {
|
|
2592
2612
|
if (scene == null)
|
|
@@ -3692,6 +3712,15 @@ var EGovaMap = function (containerID, callback, mapConfig, mapType, mapParam, co
|
|
|
3692
3712
|
}
|
|
3693
3713
|
}
|
|
3694
3714
|
|
|
3715
|
+
//获取GIS配置
|
|
3716
|
+
that.getMapConfig = function(key, callback){
|
|
3717
|
+
if (scene == null)
|
|
3718
|
+
return;
|
|
3719
|
+
if (gisMap != null) {
|
|
3720
|
+
gisMap.getMapConfig.apply(this, arguments);
|
|
3721
|
+
}
|
|
3722
|
+
}
|
|
3723
|
+
|
|
3695
3724
|
|
|
3696
3725
|
that.initMap(containerID, callback, mapType, mapConfig);
|
|
3697
3726
|
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "egovamap",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.3",
|
|
4
4
|
"description": "eUrbanGIS SDK",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"version:minor": "npm version minor -m \"[A]发布 v%s\"",
|
|
8
8
|
"version:patch": "npm version patch -m \"[A]发布修复版本 v%s\"",
|
|
9
9
|
"pub": "npm publish --registry https://registry.npmjs.org/",
|
|
10
|
-
"postpublish": "git push && git push --tags"
|
|
10
|
+
"postpublish": "git push && git push --tags",
|
|
11
|
+
"start": "parcel test/test.html"
|
|
11
12
|
},
|
|
12
13
|
"author": "egova",
|
|
13
14
|
"license": "MIT",
|
|
@@ -16,5 +17,8 @@
|
|
|
16
17
|
},
|
|
17
18
|
"engines": {
|
|
18
19
|
"node": ">=12.13"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"parcel": "^2.3.1"
|
|
19
23
|
}
|
|
20
24
|
}
|