Skip to content

Commit 8fd30cd

Browse files
author
潘卓然Y7000P
committed
【SDK】【修复】【修复Leaflet的专题图的POST传参问题】
1 parent 04acb0d commit 8fd30cd

8 files changed

Lines changed: 2263 additions & 2 deletions

File tree

src/cesiumjs/ui/draw/DrawBase.js

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
let ChangeablePrimitive = (function() {
2+
function _() {
3+
}
4+
5+
initialiseOptions = function(options) {
6+
7+
fillOptions(this, options);
8+
9+
this._ellipsoid = undefined;
10+
this._granularity = undefined;
11+
this._height = undefined;
12+
this._textureRotationAngle = undefined;
13+
this._id = undefined;
14+
15+
// set the flags to initiate a first drawing
16+
this._createPrimitive = true;
17+
this._primitive = undefined;
18+
this._outlinePolygon = undefined;
19+
20+
}
21+
22+
setAttribute = function(name, value) {
23+
this[name] = value;
24+
this._createPrimitive = true;
25+
};
26+
27+
getAttribute = function(name) {
28+
return this[name];
29+
};
30+
31+
/**
32+
* @private
33+
*/
34+
update = function(context, frameState, commandList) {
35+
36+
if (!Cesium.defined(this.ellipsoid)) {
37+
throw new Cesium.DeveloperError('this.ellipsoid must be defined.');
38+
}
39+
40+
if (!Cesium.defined(this.appearance)) {
41+
throw new Cesium.DeveloperError('this.material must be defined.');
42+
}
43+
44+
if (this.granularity < 0.0) {
45+
throw new Cesium.DeveloperError('this.granularity and scene2D/scene3D overrides must be greater than zero.');
46+
}
47+
48+
if (!this.show) {
49+
return;
50+
}
51+
52+
if (!this._createPrimitive && (!Cesium.defined(this._primitive))) {
53+
// No positions/hierarchy to draw
54+
return;
55+
}
56+
57+
if (this._createPrimitive ||
58+
(this._ellipsoid !== this.ellipsoid) ||
59+
(this._granularity !== this.granularity) ||
60+
(this._height !== this.height) ||
61+
(this._textureRotationAngle !== this.textureRotationAngle) ||
62+
(this._id !== this.id)) {
63+
64+
let geometry = this.getGeometry();
65+
if(!geometry) {
66+
return;
67+
}
68+
69+
this._createPrimitive = false;
70+
this._ellipsoid = this.ellipsoid;
71+
this._granularity = this.granularity;
72+
this._height = this.height;
73+
this._textureRotationAngle = this.textureRotationAngle;
74+
this._id = this.id;
75+
76+
this._primitive = this._primitive && this._primitive.destroy();
77+
78+
this._primitive = new Cesium.Primitive({
79+
geometryInstances : new Cesium.GeometryInstance({
80+
geometry : geometry,
81+
id : this.id,
82+
pickPrimitive : this
83+
}),
84+
appearance : this.appearance,
85+
asynchronous : this.asynchronous
86+
});
87+
88+
this._outlinePolygon = this._outlinePolygon && this._outlinePolygon.destroy();
89+
if(this.strokeColor && this.getOutlineGeometry) {
90+
// create the highlighting frame
91+
this._outlinePolygon = new Cesium.Primitive({
92+
geometryInstances : new Cesium.GeometryInstance({
93+
geometry : this.getOutlineGeometry(),
94+
attributes : {
95+
color : Cesium.ColorGeometryInstanceAttribute.fromColor(this.strokeColor)
96+
}
97+
}),
98+
appearance : new Cesium.PerInstanceColorAppearance({
99+
flat : true,
100+
renderState : {
101+
depthTest : {
102+
enabled : true
103+
},
104+
lineWidth : Math.min(this.strokeWidth || 4.0, context._aliasedLineWidthRange[1])
105+
}
106+
})
107+
});
108+
}
109+
}
110+
111+
let primitive = this._primitive;
112+
primitive.appearance.material = this.material;
113+
primitive.debugShowBoundingVolume = this.debugShowBoundingVolume;
114+
primitive.update(context, frameState, commandList);
115+
this._outlinePolygon && this._outlinePolygon.update(context, frameState, commandList);
116+
117+
};
118+
119+
isDestroyed = function() {
120+
return false;
121+
};
122+
123+
destroy = function() {
124+
this._primitive = this._primitive && this._primitive.destroy();
125+
return Cesium.destroyObject(this);
126+
};
127+
128+
setStrokeStyle = function(strokeColor, strokeWidth) {
129+
if(!this.strokeColor || !this.strokeColor.equals(strokeColor) || this.strokeWidth != strokeWidth) {
130+
this._createPrimitive = true;
131+
this.strokeColor = strokeColor;
132+
this.strokeWidth = strokeWidth;
133+
}
134+
}
135+
136+
return _;
137+
})();
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
/*
2+
initial twipsy code taken from bootstrap
3+
*/
4+
.twipsy {
5+
display: block;
6+
position: absolute;
7+
visibility: visible;
8+
max-width: 200px;
9+
min-width: 100px;
10+
padding: 5px;
11+
font-size: 11px;
12+
z-index: 1000;
13+
opacity: 0.8;
14+
-khtml-opacity: 0.8;
15+
-moz-opacity: 0.8;
16+
filter: alpha(opacity=80);
17+
}
18+
.twipsy.left .twipsy-arrow {
19+
top: 50%;
20+
right: 0;
21+
margin-top: -5px;
22+
border-top: 5px solid transparent;
23+
border-bottom: 5px solid transparent;
24+
border-left: 5px solid #000000;
25+
}
26+
.twipsy.right .twipsy-arrow {
27+
top: 50%;
28+
left: 0;
29+
margin-top: -5px;
30+
border-top: 5px solid transparent;
31+
border-bottom: 5px solid transparent;
32+
border-right: 5px solid #000000;
33+
}
34+
.twipsy-inner {
35+
padding: 3px 8px;
36+
background-color: #000000;
37+
color: white;
38+
text-align: center;
39+
max-width: 200px;
40+
text-decoration: none;
41+
-webkit-border-radius: 4px;
42+
-moz-border-radius: 4px;
43+
border-radius: 4px;
44+
}
45+
.twipsy-arrow {
46+
position: absolute;
47+
width: 0;
48+
height: 0;
49+
}
50+
51+
/*
52+
css rules for the draw helper components
53+
*/
54+
55+
.toolbar {
56+
margin: 0px;
57+
padding: 0px;
58+
background: white;
59+
}
60+
61+
.toolbar > .button {
62+
margin: 5px;
63+
padding: 5px;
64+
border: 1px solid #eee;
65+
cursor: pointer;
66+
}
67+
68+
.toolbar > .button:hover {
69+
background: #eee;
70+
}
71+
72+
/*
73+
css rules for the infowindow
74+
*/
75+
76+
.infoWindow {
77+
position: absolute;
78+
min-width: 100px;
79+
max-width: 300px;
80+
}
81+
.infoWindow #frame {
82+
padding: 10px;
83+
border: 1px solid black;
84+
background: white;
85+
}
86+
.infoWindow #close {
87+
float: right;
88+
margin: 5px 2px;
89+
font-size: small;
90+
color: gray;
91+
cursor: pointer;
92+
}
93+
.infoWindow #arrow {
94+
position: absolute;
95+
bottom: -8px;
96+
left: 50%;
97+
margin-left: -10px;
98+
border-right: 10px solid transparent;
99+
border-left: 10px solid transparent;
100+
border-top: 10px solid white;
101+
}
102+

0 commit comments

Comments
 (0)