Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9e99e9e

Browse files
Merge branch 'master' of github.com:SuperMap/iClient-JavaScript
2 parents446a948 +f5d2b8b commit9e99e9e

File tree

9 files changed

+604
-134
lines changed

9 files changed

+604
-134
lines changed

‎examples/classic/config.js‎

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -870,71 +870,6 @@ var exampleConfig = {
870870
fileName:"vizLayer_animatorMigrate"
871871
}]
872872
},
873-
"vectorBlock":{
874-
name:"矢量分块",
875-
name_en:"Carto CSS",
876-
content:[{
877-
name:"矢量分块图",
878-
name_en:"carto CSS vector tile layer",
879-
thumbnail:"vizLayer_tiledVectorLayer.png",
880-
fileName:"vizLayer_tiledVectorLayer"
881-
},{
882-
name:"点符号",
883-
name_en:"carto CSS - point",
884-
thumbnail:"vizLayer_cartoCSS_point.png",
885-
fileName:"vizLayer_cartoCSS_point"
886-
},{
887-
name:"线符号",
888-
name_en:"carto CSS - line",
889-
thumbnail:"vizLayer_cartoCSS_line.png",
890-
fileName:"vizLayer_cartoCSS_line"
891-
},{
892-
name:"面符号",
893-
name_en:"carto CSS - polygon",
894-
thumbnail:"vizLayer_cartoCSS_polygon.png",
895-
fileName:"vizLayer_cartoCSS_polygon"
896-
},{
897-
name:"文本符号",
898-
name_en:"carto CSS - text",
899-
thumbnail:"vizLayer_cartoCSS_text.png",
900-
fileName:"vizLayer_cartoCSS_text"
901-
},{
902-
name:"高亮显示",
903-
name_en:"carto CSS - hightlight",
904-
thumbnail:"vizLayer_cartoCSS_hightlight.png",
905-
fileName:"vizLayer_cartoCSS_hightlight"
906-
},{
907-
name:"CartoCSS编辑",
908-
name_en:"carto CSS - edit",
909-
thumbnail:"vizLayer_cartoCSS_edit.png",
910-
fileName:"vizLayer_cartoCSS_edit"
911-
},{
912-
name:"强边界风格",
913-
name_en:"carto CSS - boundry style",
914-
thumbnail:"vizLayer_cartoCSS_boundryStyle.png",
915-
fileName:"vizLayer_cartoCSS_boundryStyle"
916-
},{
917-
name:"深夜蓝黑风格",
918-
name_en:"carto CSS - dark-blue style",
919-
thumbnail:"vizLayer_cartoCSS_darkblueStyle.png",
920-
fileName:"vizLayer_cartoCSS_darkblueStyle"
921-
},{
922-
name:"淡雅绿风格",
923-
name_en:"carto CSS - natural style",
924-
thumbnail:"vizLayer_cartoCSS_naturalStyle.png",
925-
fileName:"vizLayer_cartoCSS_naturalStyle"
926-
},{
927-
name:"月夜风格",
928-
name_en:"carto CSS - night style",
929-
thumbnail:"vizLayer_cartoCSS_nightStyle.png",
930-
fileName:"vizLayer_cartoCSS_nightStyle"
931-
},{
932-
name:"Hellokitty风格",
933-
name_en:"carto CSS - hellokitty style",
934-
thumbnail:"vizLayer_cartoCSS_helloKitty.png",
935-
fileName:"vizLayer_cartoCSS_helloKitty"
936-
}]
937-
},
938873
"MapV":{
939874
name:"MapV",
940875
name_en:"MapV",

‎examples/leaflet/config.js‎

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,36 +1105,6 @@ var exampleConfig = {
11051105
name_en:"Vector tile layer",
11061106
content:[
11071107
{
1108-
name:"默认风格",
1109-
name_en:"normal style",
1110-
thumbnail:"l_tileVectorLayer_normal.png",
1111-
fileName:"vectorTileLayerNormal"
1112-
},{
1113-
name:"月夜风格",
1114-
name_en:"night style",
1115-
thumbnail:"l_tileVectorLayer_night.png",
1116-
fileName:"vectorTileLayerNight"
1117-
},{
1118-
name:"强边界风格",
1119-
name_en:"boundray style",
1120-
thumbnail:"l_tileVectorLayer_boundray.png",
1121-
fileName:"vectorTileLayerBoundary"
1122-
},{
1123-
name:"深夜蓝黑风格",
1124-
name_en:"dark-blue style",
1125-
thumbnail:"l_tileVectorLayer_darkBlue.png",
1126-
fileName:"vectorTileLayerDarkBlue"
1127-
},{
1128-
name:"HelloKitty风格",
1129-
name_en:"hellokitty style",
1130-
thumbnail:"l_tileVectorLayer_helloKitty.png",
1131-
fileName:"vectorTileLayerHelloKitty"
1132-
},{
1133-
name:"淡雅绿风格",
1134-
name_en:"natural style",
1135-
thumbnail:"l_tileVectorLayer_natural.png",
1136-
fileName:"vectorTileLayerNatural"
1137-
},{
11381108
name:"MVT (叠加 MapboxGL)",
11391109
name_en:"MVT (via MapboxGL)",
11401110
version:'10.1.1',

‎src/common/commontypes/geometry/Point.js‎

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,31 +23,58 @@ import {Util} from '../Util';
2323
exportclassPointextendsGeometry{
2424

2525

26-
constructor(x,y,type,tag){
27-
super(x,y,type,tag);
26+
constructor(xOrCoordinates,yOrType,type,tag){
27+
super();
2828
/**
2929
*@member {number} GeometryPoint.prototype.x
3030
*@description 横坐标。
3131
*/
32-
this.x=parseFloat(x);
32+
this.x;
3333

3434
/**
3535
*@member {number} GeometryPoint.prototype.y
3636
*@description 纵坐标。
3737
*/
38-
this.y=parseFloat(y);
38+
this.y;
3939

4040
/**
41-
*@member {string} GeometryPoint.prototype.tag
42-
*@description 用来存储额外的属性,比如插值分析中的 Z 值。
41+
*@member {number} GeometryPoint.prototype.z
42+
*@description Z 值。
43+
*/
44+
this.z;
45+
46+
/**
47+
*@member {number} GeometryPoint.prototype.m
48+
*@description M 值。
4349
*/
44-
this.tag=(tag||tag==0) ?parseFloat(tag) :null;
50+
this.m;
4551

4652
/**
4753
*@member {string} GeometryPoint.prototype.type
4854
*@description 用来存储点的类型。
4955
*/
50-
this.type=type||"Point";
56+
this.type;
57+
if(Array.isArray(xOrCoordinates)){
58+
const[x,y,z,m]=xOrCoordinates;
59+
this.x=parseFloat(x);
60+
this.y=parseFloat(y);
61+
this.z=(z||z==0) ?parseFloat(z) :null;
62+
this.m=(m||m==0) ?parseFloat(m) :null;
63+
this.type=yOrType||"Point";
64+
}else{
65+
this.x=parseFloat(xOrCoordinates);
66+
this.y=parseFloat(yOrType);
67+
this.z=(tag||tag==0) ?parseFloat(tag) :null;
68+
this.m=null;
69+
this.type=type||"Point";
70+
}
71+
/**
72+
*@member {string} GeometryPoint.prototype.tag
73+
*@deprecated
74+
*@description 用来存储额外的属性,比如插值分析中的 Z 值。
75+
*/
76+
this.tag=this.z;
77+
5178
this.CLASS_NAME="SuperMap.Geometry.Point";
5279
this.geometryType="Point";
5380
}
@@ -59,7 +86,7 @@ export class Point extends Geometry {
5986
*/
6087
clone(obj){
6188
if(obj==null){
62-
obj=newPoint(this.x,this.y);
89+
obj=newPoint([this.x,this.y,this.z,this.m]);
6390
}
6491

6592
// catch any randomly tagged-on properties
@@ -90,7 +117,7 @@ export class Point extends Geometry {
90117
equals(geom){
91118
varequals=false;
92119
if(geom!=null){
93-
equals=((this.x===geom.x&&this.y===geom.y)||
120+
equals=((this.x===geom.x&&this.y===geom.y&&this.z===geom.z&&this.m===geom.m)||
94121
(isNaN(this.x)&&isNaN(this.y)&&isNaN(geom.x)&&isNaN(geom.y)));
95122
}
96123
returnequals;
@@ -115,7 +142,14 @@ export class Point extends Geometry {
115142
*@returns {string} 字符串代表点对象。(ex. <i>"5, 42"</i>)
116143
*/
117144
toShortString(){
118-
return(this.x+", "+this.y);
145+
constarr=[this.x,this.y];
146+
if(this.z||this.z==0){
147+
arr.push(this.z);
148+
}
149+
if(this.m||this.m==0){
150+
arr.push(this.m);
151+
}
152+
returnarr.join(", ");
119153
}
120154

121155
/**
@@ -126,6 +160,8 @@ export class Point extends Geometry {
126160
this.x=null;
127161
this.y=null;
128162
this.tag=null;
163+
this.z=null;
164+
this.m=null;
129165
super.destroy();
130166
}
131167

@@ -136,7 +172,5 @@ export class Point extends Geometry {
136172
*/
137173
getVertices(){
138174
return[this];
139-
}
140-
141-
175+
}
142176
}

‎src/common/format/GeoJSON.js‎

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export class GeoJSON extends JSONFormat {
6767
*@member {boolean} [GeoJSONFormat.prototype.ignoreExtraDims=true]
6868
*@description 忽略维度超过 2 的几何要素。
6969
*/
70-
this.ignoreExtraDims=true;
70+
this.ignoreExtraDims=false;
7171

7272
this.CLASS_NAME="SuperMap.Format.GeoJSON";
7373
/**
@@ -83,11 +83,10 @@ export class GeoJSON extends JSONFormat {
8383
*@returns {Geometry} 一个几何对象。
8484
*/
8585
"point":function(array){
86-
if(this.ignoreExtraDims===false&&
87-
array.length!=2){
88-
throw"Only 2D points are supported: "+array;
86+
if(this.ignoreExtraDims){
87+
returnnewPoint(array[0],array[1]);
8988
}
90-
returnnewPoint(array[0],array[1]);
89+
returnnewPoint(array);
9190
},
9291

9392
/**
@@ -296,8 +295,17 @@ export class GeoJSON extends JSONFormat {
296295
*/
297296
'point':function(point){
298297
varp=[point.x,point.y];
298+
if(point.z!=null){
299+
p.push(point.z);
300+
}
301+
if(point.m!=null){
302+
if(p.length===2){
303+
p.push(null);
304+
}
305+
p.push(point.m);
306+
}
299307
for(varnameinpoint){
300-
if(name!=="x"&&name!=="y"&&point[name]!==null&&!isNaN(point[name])){
308+
if(['x','y','z','m'].indexOf(name)<0&&point[name]!==null&&!isNaN(point[name])){
301309
p.push(point[name]);
302310
}
303311
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp