Skip to content

Commit 1f4d60b

Browse files
author
zhaokai
committed
动画模块
2 parents 67b665e + 3d08d8e commit 1f4d60b

File tree

6 files changed

+154
-121
lines changed

6 files changed

+154
-121
lines changed

src/mapboxgl/overlay/FabricLayer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export class FabricLayer {
2828
this.mapContainer.appendChild(this.canvas);
2929

3030
this.m_fabricCanvas = this._createFabricCanvas(this.canvas, fabricClass, m_fabricOptions);
31+
this.m_fabricCanvas.setMap(this.map)
3132
// this.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
3233

3334
this.bindEvent();

src/service/2DPlot/PlotLayer2D.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ class PlotLayer2D {
206206
* @return {*}
207207
*/
208208
removePlotByID(id) {
209-
const plotObject = this.getPlotObjectById(id);
210-
this.remove(plotObject);
209+
const plotObject = this.getPlotByID(id);
210+
this.removePlot(plotObject);
211211
}
212212
/**
213213
* @function: Module:PlotLayer2D.prototype.getPlotByID

src/service/2DPlot/PlotLayer2DGroup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @Author: zk
55
* @Date: 2022-05-13 11:01:10
66
* @LastEditors: zk
7-
* @LastEditTime: 2022-06-07 17:00:38
7+
* @LastEditTime: 2022-06-07 17:34:12
88
*/
99

1010
import { fabric } from 'fabric';

src/service/Igserver/MRCS/CatalogVectorLayer.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,13 @@ class VectorLayer extends GDBInfo {
620620
*/
621621
getLayerInfo(gdbpUrl, onSuccess, onError, encryptPassword) {
622622
var me = this;
623-
me.partUrl = 'layerinfo?gdbpUrl=' + gdbpUrl + '&f=json' + '&encryptPassword=' + encryptPassword + '&proj=' + this.proj;
623+
me.partUrl = 'layerinfo?gdbpUrl=' + gdbpUrl + '&f=json';
624+
if (encryptPassword) {
625+
me.partUrl += '&encryptPassword=' + encryptPassword;
626+
}
627+
if (this.proj) {
628+
me.partUrl += '&proj=' + this.proj;
629+
}
624630
var url = me.getFullUrl();
625631
var service = new IgsServiceBase(url, {
626632
eventListeners: {

src/service/Igserver/MRGS/ProjectRang.js

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
import {
2-
Zondy
3-
} from '../../common/Base';
4-
import {
5-
GeometryAnalysisBase
6-
} from "./GeometryAnalysisBase";
7-
import {
8-
IgsServiceBase
9-
} from "../../baseserver/IServiceBase";
1+
import { Zondy } from '../../common/Base';
2+
import { GeometryAnalysisBase } from './GeometryAnalysisBase';
3+
import { IgsServiceBase } from '../../baseserver/IServiceBase';
104

115
/**
126
* 对矩形范围坐标点进行投影转换
@@ -18,7 +12,9 @@ import {
1812
* @param {String} [option.gdbsvrName = "MapGISLocal"] 数据源名称
1913
* @param {String} [option.gdbName = null] 数据库名称
2014
* @param {Number} [option.srefID = 0] 源投影参考系ID
15+
* @param {Number} [option.srefName = null] 源投影参考系名
2116
* @param {Number} [option.desfID = 0] 目的投影参考系ID
17+
* @param {Number} [option.desfName = null] 目的投影参考系名
2218
* @param {String} [option.userName = null] 地理数据源/地理数据库账户名
2319
* @param {String} [option.password = null] 地理数据源/地理数据库密码
2420
* @example
@@ -30,10 +26,10 @@ import {
3026
gdbsvrName: "MapGISLocal",
3127
//数据库名称
3228
gdbName: "OpenLayerVecterMap",
33-
//源投影参考系ID
34-
srefID: 10,
35-
//目的投影参考系ID
36-
desfID: 601,
29+
//源投影参考系名
30+
srefName: "地理坐标系(北京)_度",
31+
//目的投影参考系名
32+
desfName: "地理坐标系(西安)_度",
3733
//服务器地址
3834
ip: "develop.smaryun.com",
3935
//服务器端口
@@ -57,7 +53,7 @@ class ProjectRang extends GeometryAnalysisBase {
5753
* @description 数据源名称
5854
* @default MapGISLocal
5955
*/
60-
this.gdbsvrName = options.gdbsvrName !== undefined ? options.gdbsvrName : "MapGISLocal";
56+
this.gdbsvrName = options.gdbsvrName !== undefined ? options.gdbsvrName : 'MapGISLocal';
6157

6258
/**
6359
* @private
@@ -77,6 +73,15 @@ class ProjectRang extends GeometryAnalysisBase {
7773
*/
7874
this.srefID = options.srefID !== undefined ? options.srefID : 0;
7975

76+
/**
77+
* @private
78+
* @member Zondy.Service.ProjectRang.prototype.srefName
79+
* @type {Number}
80+
* @description 源投影参考系名
81+
* @default null
82+
*/
83+
this.srefName = options.srefName !== undefined ? options.srefName : null;
84+
8085
/**
8186
* @private
8287
* @member Zondy.Service.ProjectRang.prototype.desfID
@@ -86,6 +91,15 @@ class ProjectRang extends GeometryAnalysisBase {
8691
*/
8792
this.desfID = options.desfID !== undefined ? options.desfID : 0;
8893

94+
/**
95+
* @private
96+
* @member Zondy.Service.ProjectRang.prototype.desfName
97+
* @type {Number}
98+
* @description 目的投影参考系名
99+
* @default null
100+
*/
101+
this.desfName = options.desfName !== undefined ? options.desfName : null;
102+
89103
/**
90104
* @private
91105
* @member Zondy.Service.ProjectRang.prototype.userName
@@ -113,14 +127,20 @@ class ProjectRang extends GeometryAnalysisBase {
113127
* @param {callback} onError 执行失败后的回调函数
114128
*/
115129
execute(rectangle, onSuccess, onError) {
116-
var rang = "";
130+
var rang = '';
117131
if (rectangle) {
118-
rang = rectangle.xmin + "$" + rectangle.ymin + "$" + rectangle.xmax + "$" + rectangle.ymax;
132+
rang = rectangle.xmin + '$' + rectangle.ymin + '$' + rectangle.xmax + '$' + rectangle.ymax;
133+
}
134+
this.partUrl = `geomservice/${this.gdbsvrName}/${this.gdbName}`;
135+
if (this.desfName && this.srefName) {
136+
this.partUrl += `?f=json&rang=${rang}`;
137+
this.partUrl += `&srefName=${this.srefName}&desfName=${this.desfName}`;
138+
} else if (this.desfID && this.srefID) {
139+
this.partUrl += `/${this.srefID}/${this.desfID}`;
140+
this.partUrl += `?f=json&rang=${rang}`;
119141
}
120-
if (this.userName === null || this.password === null) {
121-
this.partUrl = "geomservice/" + this.gdbsvrName + "/" + this.gdbName + "/" + this.srefID + "/" + this.desfID + "?f=json&rang=" + rang;
122-
} else {
123-
this.partUrl = "geomservice/" + this.gdbsvrName + "/" + this.gdbName + "/" + this.srefID + "/" + this.desfID + "?f=json&rang=" + rang + "&userName=" + this.userName + "&password=" + this.password;
142+
if (this.userName && this.password) {
143+
this.partUrl += `&userName=${this.userName}&password=${this.password}`;
124144
}
125145
var url = this.getFullUrl();
126146
var me = this;
@@ -133,9 +153,6 @@ class ProjectRang extends GeometryAnalysisBase {
133153
});
134154
service.processAsync();
135155
}
136-
137156
}
138-
export {
139-
ProjectRang
140-
};
141-
Zondy.Service.ProjectRang = ProjectRang;
157+
export { ProjectRang };
158+
Zondy.Service.ProjectRang = ProjectRang;
Lines changed: 101 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,106 @@
1-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
22
<html xmlns="http://www.w3.org/1999/xhtml">
3-
4-
<head>
5-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6-
<title></title>
7-
<!--当前示例页面样式表引用-->
8-
<link rel="stylesheet" href="./static/demo/openlayers/example/style.css" />
9-
<script include="jquery" src="./static/libs/include-lib-local.js"></script>
10-
<script src="./static/libs/include-openlayers-local.js"></script>
11-
<style>
12-
.tableTxt
13-
{
14-
width: 40%;
15-
float: left;
16-
font-size: small;
17-
}
18-
input{
19-
height: 12px;
20-
display: block;
21-
width: 50%;
22-
font-size: 10px;
23-
}
24-
br{
25-
display:inline;
26-
line-height:2px;
27-
}
28-
</style>
29-
<script type="text/javascript">
30-
31-
function RectProject()
32-
{
33-
34-
var srcPosStr = document.getElementById("srcPositions").value;
35-
var posArrStr = srcPosStr.split(',');
36-
37-
//需要投影转换的矩形
38-
var rectangle = new Zondy.Object.Rectangle(parseFloat(posArrStr[0]), parseFloat(posArrStr[1]), parseFloat(posArrStr[2]), parseFloat(posArrStr[3]));
39-
//对矩形范围坐标点进行投影转换
40-
var ProjectRang = new Zondy.Service.ProjectRang({
41-
//数据源名称,默认值为"MapGISLocal"
42-
gdbsvrName: document.getElementById("dataSourceName").value,
43-
//数据库名称
44-
gdbName: document.getElementById("dataBaseName").value,
45-
//源投影参考系ID
46-
srefID: parseInt(document.getElementById("srRefID").value),
47-
//目的投影参考系ID
48-
desfID: parseInt(document.getElementById("desRefID").value),
49-
//服务器地址
50-
ip: document.getElementById("IP").value,
51-
//服务器端口
52-
port: document.getElementById("Port").value //访问IGServer的端口号,.net版为6163,Java版为8089
53-
});
54-
//调用execute方法,执行矩形投影投影转换功能服务,并返回结果信息,onSuccess为回调函数
55-
ProjectRang.execute(rectangle, projSuccess);
56-
}
57-
//投影转换成功后的回调
58-
function projSuccess(data) {
59-
//显示结果
60-
if(data.DesDots.length>=2)
61-
{
62-
var resultStr = (data.DesDots)[0].x+","+(data.DesDots)[0].y+","+ (data.DesDots)[1].x+","+(data.DesDots)[1].y;
63-
document.getElementById("resultDiv").value = resultStr;
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5+
<title></title>
6+
<!--当前示例页面样式表引用-->
7+
<link rel="stylesheet" href="./static/demo/openlayers/example/style.css" />
8+
<script include="jquery" src="./static/libs/include-lib-local.js"></script>
9+
<script src="./static/libs/include-openlayers-local.js"></script>
10+
<style>
11+
.tableTxt {
12+
width: 40%;
13+
float: left;
14+
font-size: small;
15+
}
16+
input {
17+
height: 12px;
18+
display: block;
19+
width: 50%;
20+
font-size: 10px;
6421
}
65-
}
66-
</script>
67-
</head>
22+
br {
23+
display: inline;
24+
line-height: 2px;
25+
}
26+
</style>
27+
<script type="text/javascript">
28+
function RectProject() {
29+
var srcPosStr = document.getElementById('srcPositions').value;
30+
var posArrStr = srcPosStr.split(',');
6831

69-
<body>
70-
<form action="" style="width: 60%;height: 160px; position: absolute; left: 50%; transform: translateX(-50%)">
71-
<fieldset>
72-
<legend>投影参数信息:</legend>
73-
<div class="tableTxt">数据源名称:</div><input id="dataSourceName" type="text" value="MapGISLocal"><br>
74-
<div class="tableTxt">数据库名称: </div><input id="dataBaseName" type="text" value="OpenLayerVecterMap"><br>
75-
<div class="tableTxt">源投影参照系ID:</div> <input id="srRefID" type="text" value="10"><br>
76-
<div class="tableTxt">目的投影参照系ID:</div> <input id="desRefID" type="text" value="601"><br>
77-
<div class="tableTxt">服务器地址:</div> <input id="IP" type="text" value="develop.smaryun.com"><br>
78-
<div class="tableTxt">服务器端口: </div><input id="Port" type="text" value="6163"><br>
79-
</fieldset>
80-
</form>
32+
//需要投影转换的矩形
33+
var rectangle = new Zondy.Object.Rectangle(
34+
parseFloat(posArrStr[0]),
35+
parseFloat(posArrStr[1]),
36+
parseFloat(posArrStr[2]),
37+
parseFloat(posArrStr[3])
38+
);
39+
//对矩形范围坐标点进行投影转换
40+
var ProjectRang = new Zondy.Service.ProjectRang({
41+
//数据源名称,默认值为"MapGISLocal"
42+
gdbsvrName: document.getElementById('dataSourceName').value,
43+
//数据库名称
44+
gdbName: document.getElementById('dataBaseName').value,
45+
//源投影参考系名
46+
srefName: document.getElementById('srefName').value,
47+
//目的投影参考系名
48+
desfName: document.getElementById('desfName').value,
49+
//服务器地址
50+
ip: document.getElementById('IP').value,
51+
//服务器端口
52+
port: document.getElementById('Port').value //访问IGServer的端口号,.net版为6163,Java版为8089
53+
});
54+
//调用execute方法,执行矩形投影投影转换功能服务,并返回结果信息,onSuccess为回调函数
55+
ProjectRang.execute(rectangle, projSuccess);
56+
}
57+
//投影转换成功后的回调
58+
function projSuccess(data) {
59+
//显示结果
60+
if (data.DesDots.length >= 2) {
61+
var resultStr = data.DesDots[0].x + ',' + data.DesDots[0].y + ',' + data.DesDots[1].x + ',' + data.DesDots[1].y;
62+
document.getElementById('resultDiv').value = resultStr;
63+
}
64+
}
65+
</script>
66+
</head>
8167

82-
<form action="" style="width: 25%;height: 100px;position: absolute;top: 170px;left: 20%;float: left;">
83-
<fieldset>
84-
<legend>源矩形坐标:</legend>
85-
<textarea id="srcPositions" style="width: 98%;height: 80px;">2119075.5815982167,-8944857.387927618,-1350086.1660772718,3477202.6583427647</textarea>
86-
</fieldset>
87-
</form>
88-
<input type="button" value="投影=>" style="height: 20px;width: 8%;float: left;position: relative;top: 200px;left: 45%;margin: 6px 6px;" onclick="RectProject()">
89-
<form action="" style="width: 25%;height: 100px;position: absolute;top: 170px;left: 55%;float: left;">
90-
<fieldset>
91-
<legend>目的矩形坐标:</legend>
92-
<textarea id="resultDiv" style="width: 98%;height: 80px;"></textarea>
93-
</fieldset>
94-
</form>
95-
</body>
68+
<body>
69+
<form action="" style="width: 60%; height: 160px; position: absolute; left: 50%; transform: translateX(-50%)">
70+
<fieldset>
71+
<legend>投影参数信息:</legend>
72+
<div class="tableTxt">数据源名称:</div>
73+
<input id="dataSourceName" type="text" value="MapGISLocal" /><br />
74+
<div class="tableTxt">数据库名称:</div>
75+
<input id="dataBaseName" type="text" value="OpenLayerVecterMap" /><br />
76+
<div class="tableTxt">源投影参照系名:</div>
77+
<input id="srefName" type="text" value="地理坐标系(北京)_度" /><br />
78+
<div class="tableTxt">目的投影参照系名:</div>
79+
<input id="desfName" type="text" value="地理坐标系(西安)_度" /><br />
80+
<div class="tableTxt">服务器地址:</div>
81+
<input id="IP" type="text" value="develop.smaryun.com" /><br />
82+
<div class="tableTxt">服务器端口:</div>
83+
<input id="Port" type="text" value="6163" /><br />
84+
</fieldset>
85+
</form>
9686

97-
</html>
87+
<form action="" style="width: 25%; height: 100px; position: absolute; top: 170px; left: 20%; float: left">
88+
<fieldset>
89+
<legend>源矩形坐标:</legend>
90+
<textarea id="srcPositions" style="width: 98%; height: 80px">114.12,30.12,114.67,30.87</textarea>
91+
</fieldset>
92+
</form>
93+
<input
94+
type="button"
95+
value="投影=>"
96+
style="height: 20px; width: 8%; float: left; position: relative; top: 200px; left: 45%; margin: 6px 6px"
97+
onclick="RectProject()"
98+
/>
99+
<form action="" style="width: 25%; height: 100px; position: absolute; top: 170px; left: 55%; float: left">
100+
<fieldset>
101+
<legend>目的矩形坐标:</legend>
102+
<textarea id="resultDiv" style="width: 98%; height: 80px"></textarea>
103+
</fieldset>
104+
</form>
105+
</body>
106+
</html>

0 commit comments

Comments
 (0)