Skip to content

Commit e76323b

Browse files
2 parents 6e21cdb + 238b2b8 commit e76323b

File tree

10 files changed

+213
-114
lines changed

10 files changed

+213
-114
lines changed

dist/iclient9-leaflet.js

Lines changed: 64 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@
7474
/***/ function(module, exports, __webpack_require__) {
7575

7676
/**
77-
* Class: TileLayer
77+
* Class: TiledMapLayer
7878
* SuperMap iServer 的 REST 地图服务的图层(SuperMap iServer Java 6R 及以上分块动态 REST 图层)
7979
* 用法:
80-
* L.superMap.TileLayer(url,{CRS:L.CRS.EPSG4326}).addTo(map);
80+
* L.superMap.tiledMapLayer(url,{CRS:L.CRS.EPSG4326}).addTo(map);
8181
*/
8282
__webpack_require__(2);
8383
__webpack_require__(4);
@@ -86,12 +86,12 @@
8686

8787
options: {
8888
url: null,
89+
token: null,
8990
transparent: null,
9091
cacheEnabled: null,
9192
layersID: null, //如果有layersID,则是在使用专题图
9293
crs: null,
93-
attribution:' with <a href="http://icltest.supermapol.com/">SuperMap iClient</a>'
94-
94+
attribution: ' with <a href="http://icltest.supermapol.com/">SuperMap iClient</a>'
9595
},
9696

9797
initialize: function (url, options) {
@@ -132,8 +132,8 @@
132132
var layerUrl = options.url + "/image.png?redirect=false";
133133

134134
//为url添加安全认证信息片段
135-
if (SuperMap.Credential && SuperMap.Credential.CREDENTIAL) {
136-
layerUrl += "&" + SuperMap.Credential.CREDENTIAL.getUrlParameters();
135+
if (options.token) {
136+
layerUrl += "&token=" + options.token;
137137
}
138138

139139
if (options.layersID) {
@@ -776,13 +776,16 @@
776776
* {Object} 一个表示点的对象。
777777
*/
778778
'feature': function (feature) {
779-
var geom = this.extract.geometry.apply(this, [feature.geometry]);
779+
var geo = feature.geometry ? this.toGeometry(feature.geometry) : undefined;
780+
var geom = geo ? this.extract.geometry.apply(this, [geo]) : null;
780781
var json = {
781782
"type": "Feature",
782-
// "properties": feature.attributes,
783783
"properties": this.createAttributes(feature),
784784
"geometry": geom
785785
};
786+
if (geo.type === 'TEXT') {
787+
json.properties.texts = feature.geometry.texts;
788+
}
786789
if (feature.fid != null) {
787790
json.id = feature.fid;
788791
}
@@ -799,13 +802,10 @@
799802
* Returns:
800803
* {Object} 一个表示几何体的对象。
801804
*/
802-
'geometry': function (geometry) {
803-
if (geometry == null) {
804-
return null;
805-
}
806-
var geo = this.toGeometry(geometry);
805+
'geometry': function (geo) {
807806
var geometryType = geo.type;
808807
var data = this.extract[geometryType.toLowerCase()].apply(this, [geo]);
808+
geometryType = geometryType === 'TEXT' ? 'Point' : geometryType;
809809
var json;
810810
if (geometryType === "Collection") {
811811
json = {
@@ -818,7 +818,6 @@
818818
"coordinates": data
819819
};
820820
}
821-
822821
return json;
823822
},
824823

@@ -837,6 +836,20 @@
837836
return [point.x, point.y];
838837
},
839838

839+
/**
840+
* Method: extract.text
841+
* 从一个文本对象中返回一个坐标组。
842+
*
843+
* Parameters:
844+
* geo 一个文本对象。
845+
*
846+
* Returns:
847+
* {Array} 一个表示一个点的坐标组。
848+
*/
849+
'text': function (geo) {
850+
return [geo.points[0].x, geo.points[0].y];
851+
},
852+
840853
/**
841854
* Method: extract.multipoint
842855
* 从一个多点对象中返一个坐标组数组。
@@ -3128,19 +3141,20 @@
31283141
me.totalTimes = 1;
31293142
me.url = url;
31303143
}
3131-
if (options.token) {
3132-
me.token = options.token;
3133-
}
3144+
31343145
if (SuperMap.Util.isArray(url) && !me.isServiceSupportPolling()) {
31353146
me.url = url[0];
31363147
me.totalTimes = 1;
31373148
}
3138-
me.isInTheSameDomain = SuperMap.Util.isInTheSameDomain(me.url);
3149+
31393150
options = options || {};
3151+
31403152
if (options) {
31413153
SuperMap.Util.extend(this, options);
31423154
}
31433155

3156+
me.isInTheSameDomain = SuperMap.Util.isInTheSameDomain(me.url);
3157+
31443158
me.events = new SuperMap.Events(me, null, me.EVENT_TYPES, true);
31453159
if (me.eventListeners instanceof Object) {
31463160
me.events.on(me.eventListeners);
@@ -23255,6 +23269,7 @@
2325523269
transferSolutionService.processAsync(param);
2325623270
return me;
2325723271
},
23272+
2325823273
_processParams: function (params) {
2325923274
if (!params) {
2326023275
return {};
@@ -24143,37 +24158,37 @@
2414324158
/* 202 */
2414424159
/***/ function(module, exports, __webpack_require__) {
2414524160

24146-
__webpack_require__(2);
24147-
24148-
L.supermap.Graphic = L.Class.extend({
24149-
24150-
initialize: function (options) {
24151-
options = options || {};
24152-
this._latlng = L.latLng(options._latlng.lat, options._latlng.lng);
24153-
this._canvas = options._canvas;
24154-
},
24155-
24156-
setLatlng: function (latlng) {
24157-
this._latlng = latlng;
24158-
},
24159-
24160-
setCanvas: function (canvas) {
24161-
this._canvas = canvas;
24162-
},
24163-
24164-
getLatLng: function () {
24165-
return this._latlng;
24166-
},
24167-
24168-
getCanvas: function () {
24169-
return this._canvas;
24170-
}
24171-
24172-
});
24173-
24174-
L.supermap.graphic = function (options) {
24175-
return new L.supermap.Graphic(options);
24176-
};
24161+
__webpack_require__(2);
24162+
24163+
L.supermap.Graphic = L.Class.extend({
24164+
24165+
initialize: function (options) {
24166+
options = options || {};
24167+
this._latlng = L.latLng(options._latlng.lat, options._latlng.lng);
24168+
this._canvas = options._canvas;
24169+
},
24170+
24171+
setLatlng: function (latlng) {
24172+
this._latlng = latlng;
24173+
},
24174+
24175+
setCanvas: function (canvas) {
24176+
this._canvas = canvas;
24177+
},
24178+
24179+
getLatLng: function () {
24180+
return this._latlng;
24181+
},
24182+
24183+
getCanvas: function () {
24184+
return this._canvas;
24185+
}
24186+
24187+
});
24188+
24189+
L.supermap.graphic = function (options) {
24190+
return new L.supermap.Graphic(options);
24191+
};
2417724192

2417824193

2417924194
/***/ },

dist/iclient9-openlayers.js

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -818,13 +818,16 @@
818818
* {Object} 一个表示点的对象。
819819
*/
820820
'feature': function (feature) {
821-
var geom = this.extract.geometry.apply(this, [feature.geometry]);
821+
var geo = feature.geometry ? this.toGeometry(feature.geometry) : undefined;
822+
var geom = geo ? this.extract.geometry.apply(this, [geo]) : null;
822823
var json = {
823824
"type": "Feature",
824-
// "properties": feature.attributes,
825825
"properties": this.createAttributes(feature),
826826
"geometry": geom
827827
};
828+
if (geo.type === 'TEXT') {
829+
json.properties.texts = feature.geometry.texts;
830+
}
828831
if (feature.fid != null) {
829832
json.id = feature.fid;
830833
}
@@ -841,13 +844,10 @@
841844
* Returns:
842845
* {Object} 一个表示几何体的对象。
843846
*/
844-
'geometry': function (geometry) {
845-
if (geometry == null) {
846-
return null;
847-
}
848-
var geo = this.toGeometry(geometry);
847+
'geometry': function (geo) {
849848
var geometryType = geo.type;
850849
var data = this.extract[geometryType.toLowerCase()].apply(this, [geo]);
850+
geometryType = geometryType === 'TEXT' ? 'Point' : geometryType;
851851
var json;
852852
if (geometryType === "Collection") {
853853
json = {
@@ -860,7 +860,6 @@
860860
"coordinates": data
861861
};
862862
}
863-
864863
return json;
865864
},
866865

@@ -879,6 +878,20 @@
879878
return [point.x, point.y];
880879
},
881880

881+
/**
882+
* Method: extract.text
883+
* 从一个文本对象中返回一个坐标组。
884+
*
885+
* Parameters:
886+
* geo 一个文本对象。
887+
*
888+
* Returns:
889+
* {Array} 一个表示一个点的坐标组。
890+
*/
891+
'text': function (geo) {
892+
return [geo.points[0].x, geo.points[0].y];
893+
},
894+
882895
/**
883896
* Method: extract.multipoint
884897
* 从一个多点对象中返一个坐标组数组。
@@ -3074,19 +3087,20 @@
30743087
me.totalTimes = 1;
30753088
me.url = url;
30763089
}
3077-
if (options.token) {
3078-
me.token = options.token;
3079-
}
3090+
30803091
if (SuperMap.Util.isArray(url) && !me.isServiceSupportPolling()) {
30813092
me.url = url[0];
30823093
me.totalTimes = 1;
30833094
}
3084-
me.isInTheSameDomain = SuperMap.Util.isInTheSameDomain(me.url);
3095+
30853096
options = options || {};
3097+
30863098
if (options) {
30873099
SuperMap.Util.extend(this, options);
30883100
}
30893101

3102+
me.isInTheSameDomain = SuperMap.Util.isInTheSameDomain(me.url);
3103+
30903104
me.events = new SuperMap.Events(me, null, me.EVENT_TYPES, true);
30913105
if (me.eventListeners instanceof Object) {
30923106
me.events.on(me.eventListeners);

src/Core/format/GeoJSON.js

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -488,13 +488,16 @@ SuperMap.Format.GeoJSON = SuperMap.Class(SuperMap.Format.JSON, {
488488
* {Object} 一个表示点的对象。
489489
*/
490490
'feature': function (feature) {
491-
var geom = this.extract.geometry.apply(this, [feature.geometry]);
491+
var geo = feature.geometry ? this.toGeometry(feature.geometry) : undefined;
492+
var geom = geo ? this.extract.geometry.apply(this, [geo]) : null;
492493
var json = {
493494
"type": "Feature",
494-
// "properties": feature.attributes,
495495
"properties": this.createAttributes(feature),
496496
"geometry": geom
497497
};
498+
if (geo.type === 'TEXT') {
499+
json.properties.texts = feature.geometry.texts;
500+
}
498501
if (feature.fid != null) {
499502
json.id = feature.fid;
500503
}
@@ -511,13 +514,10 @@ SuperMap.Format.GeoJSON = SuperMap.Class(SuperMap.Format.JSON, {
511514
* Returns:
512515
* {Object} 一个表示几何体的对象。
513516
*/
514-
'geometry': function (geometry) {
515-
if (geometry == null) {
516-
return null;
517-
}
518-
var geo = this.toGeometry(geometry);
517+
'geometry': function (geo) {
519518
var geometryType = geo.type;
520519
var data = this.extract[geometryType.toLowerCase()].apply(this, [geo]);
520+
geometryType = geometryType === 'TEXT' ? 'Point' : geometryType;
521521
var json;
522522
if (geometryType === "Collection") {
523523
json = {
@@ -530,7 +530,6 @@ SuperMap.Format.GeoJSON = SuperMap.Class(SuperMap.Format.JSON, {
530530
"coordinates": data
531531
};
532532
}
533-
534533
return json;
535534
},
536535

@@ -549,6 +548,20 @@ SuperMap.Format.GeoJSON = SuperMap.Class(SuperMap.Format.JSON, {
549548
return [point.x, point.y];
550549
},
551550

551+
/**
552+
* Method: extract.text
553+
* 从一个文本对象中返回一个坐标组。
554+
*
555+
* Parameters:
556+
* geo 一个文本对象。
557+
*
558+
* Returns:
559+
* {Array} 一个表示一个点的坐标组。
560+
*/
561+
'text': function (geo) {
562+
return [geo.points[0].x, geo.points[0].y];
563+
},
564+
552565
/**
553566
* Method: extract.multipoint
554567
* 从一个多点对象中返一个坐标组数组。

src/Core/iServer/ServiceBase.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,20 @@ SuperMap.ServiceBase = SuperMap.Class({
127127
me.totalTimes = 1;
128128
me.url = url;
129129
}
130-
if (options.token) {
131-
me.token = options.token;
132-
}
130+
133131
if (SuperMap.Util.isArray(url) && !me.isServiceSupportPolling()) {
134132
me.url = url[0];
135133
me.totalTimes = 1;
136134
}
137-
me.isInTheSameDomain = SuperMap.Util.isInTheSameDomain(me.url);
135+
138136
options = options || {};
137+
139138
if (options) {
140139
SuperMap.Util.extend(this, options);
141140
}
142141

142+
me.isInTheSameDomain = SuperMap.Util.isInTheSameDomain(me.url);
143+
143144
me.events = new SuperMap.Events(me, null, me.EVENT_TYPES, true);
144145
if (me.eventListeners instanceof Object) {
145146
me.events.on(me.eventListeners);

0 commit comments

Comments
 (0)