@@ -17,7 +17,7 @@ const FEATURE_SERVICE_MAP = {
1717bounds :GetFeaturesByBoundsService ,
1818buffer :GetFeaturesByBufferService ,
1919geometry :GetFeaturesByGeometryService
20- }
20+ } ;
2121
2222/**
2323 *@class FeatureService
@@ -34,11 +34,11 @@ const FEATURE_SERVICE_MAP = {
3434 *@param {boolean } [options.withCredentials=false] - 请求是否携带 cookie。
3535 *@param {boolean } [options.crossOrigin] - 是否允许跨域请求。
3636 *@param {Object } [options.headers] - 请求头。
37+ *@param {boolean } [options.preferServer=false] - 当resultFormat=DataFormat.GEOJSON时,使用服务器直接返回geojson。
3738 *@extends {ServiceBase }
3839 *@usage
3940 */
4041export class FeatureService {
41-
4242constructor ( url , options ) {
4343this . url = url ;
4444this . options = options || { } ;
@@ -59,7 +59,8 @@ export class FeatureService {
5959withCredentials :me . options . withCredentials ,
6060crossOrigin :me . options . crossOrigin ,
6161headers :me . options . headers ,
62- format :resultFormat
62+ format :resultFormat ,
63+ preferServer :me . options . preferServer
6364} ) ;
6465return getFeaturesByIDsService . processAsync ( params , callback ) ;
6566}
@@ -79,7 +80,8 @@ export class FeatureService {
7980withCredentials :me . options . withCredentials ,
8081crossOrigin :me . options . crossOrigin ,
8182headers :me . options . headers ,
82- format :me . _processFormat ( resultFormat )
83+ format :me . _processFormat ( resultFormat ) ,
84+ preferServer :me . options . preferServer
8385} ) ;
8486return getFeaturesByBoundsService . processAsync ( params , callback ) ;
8587}
@@ -99,7 +101,8 @@ export class FeatureService {
99101withCredentials :me . options . withCredentials ,
100102crossOrigin :me . options . crossOrigin ,
101103headers :me . options . headers ,
102- format :me . _processFormat ( resultFormat )
104+ format :me . _processFormat ( resultFormat ) ,
105+ preferServer :me . options . preferServer
103106} ) ;
104107return getFeatureService . processAsync ( params , callback ) ;
105108}
@@ -119,7 +122,8 @@ export class FeatureService {
119122withCredentials :me . options . withCredentials ,
120123crossOrigin :me . options . crossOrigin ,
121124headers :me . options . headers ,
122- format :me . _processFormat ( resultFormat )
125+ format :me . _processFormat ( resultFormat ) ,
126+ preferServer :me . options . preferServer
123127} ) ;
124128return getFeatureBySQLService . processAsync ( params , callback ) ;
125129}
@@ -139,7 +143,8 @@ export class FeatureService {
139143withCredentials :me . options . withCredentials ,
140144crossOrigin :me . options . crossOrigin ,
141145headers :me . options . headers ,
142- format :me . _processFormat ( resultFormat )
146+ format :me . _processFormat ( resultFormat ) ,
147+ preferServer :me . options . preferServer
143148} ) ;
144149return getFeaturesByGeometryService . processAsync ( params , callback ) ;
145150}
@@ -159,7 +164,7 @@ export class FeatureService {
159164url = me . url ,
160165dataSourceName = params . dataSourceName ,
161166dataSetName = params . dataSetName ;
162- url = CommonUtil . urlPathAppend ( url , " datasources/" + dataSourceName + " /datasets/" + dataSetName ) ;
167+ url = CommonUtil . urlPathAppend ( url , ' datasources/' + dataSourceName + ' /datasets/' + dataSetName ) ;
163168
164169var editFeatureService = new EditFeaturesService ( url , {
165170proxy :me . options . proxy ,
@@ -182,7 +187,7 @@ export class FeatureService {
182187url = me . url ,
183188dataSourceName = params . dataSourceName ,
184189dataSetName = params . dataSetName ;
185- url = CommonUtil . urlPathAppend ( url , " datasources/" + dataSourceName + " /datasets/" + dataSetName ) ;
190+ url = CommonUtil . urlPathAppend ( url , ' datasources/' + dataSourceName + ' /datasets/' + dataSetName ) ;
186191var editFeatureService = new EditFeaturesService ( url , {
187192proxy :me . options . proxy ,
188193withCredentials :me . options . withCredentials ,
@@ -207,7 +212,7 @@ export class FeatureService {
207212url = me . url ,
208213dataSourceName = params . dataSourceName ,
209214dataSetName = params . dataSetName ;
210- url = CommonUtil . urlPathAppend ( url , " datasources/" + dataSourceName + " /datasets/" + dataSetName ) ;
215+ url = CommonUtil . urlPathAppend ( url , ' datasources/' + dataSourceName + ' /datasets/' + dataSetName ) ;
211216var featureAttachmentsService = new FeatureAttachmentsService ( url , {
212217proxy :me . options . proxy ,
213218withCredentials :me . options . withCredentials ,
@@ -233,7 +238,7 @@ export class FeatureService {
233238url = me . url ,
234239dataSourceName = params . dataSourceName ,
235240dataSetName = params . dataSetName ;
236- url = CommonUtil . urlPathAppend ( url , " datasources/" + dataSourceName + " /datasets/" + dataSetName ) ;
241+ url = CommonUtil . urlPathAppend ( url , ' datasources/' + dataSourceName + ' /datasets/' + dataSetName ) ;
237242var featureAttachmentsService = new FeatureAttachmentsService ( url , {
238243proxy :me . options . proxy ,
239244withCredentials :me . options . withCredentials ,