@@ -220,35 +220,39 @@ export class GeoJSON extends JSONFormat {
220220 /**
221221 * @function GeoJSONFormat.extract.feature
222222 * @description 返回一个表示单个要素对象的 GeoJSON 的一部分。
223- * @param {SuperMap.ServerFeature } feature - SuperMap iServer 要素对象。
223+ * @param {SuperMap.ServerFeature } fea - SuperMap iServer 要素对象。
224224 * @returns {Object } 一个表示点的对象。
225225 */
226- 'feature' : function ( feature , options ) {
226+ 'feature' : function ( fea , options ) {
227227 var { parseProperties, extraKeys } = options || { } ;
228- var geom = this . extract . geometry . apply ( this , [ feature . geometry ] ) ;
228+ var geom = this . extract . geometry . apply ( this , [ fea . geometry ] ) ;
229229 var json = {
230230 "type" : "Feature" ,
231- "properties" : this . createAttributes ( feature , parseProperties ) ,
231+ "properties" : this . createAttributes ( fea , parseProperties ) ,
232232 "geometry" : geom
233233 } ;
234234
235- if ( feature . geometry && feature . geometry . type === 'TEXT' ) {
236- json . properties . texts = feature . geometry . texts ;
237- json . properties . textStyle = feature . geometry . textStyle ;
235+ if ( fea . geometry && fea . geometry . type === 'TEXT' ) {
236+ json . properties . texts = fea . geometry . texts ;
237+ json . properties . textStyle = fea . geometry . textStyle ;
238238 }
239- if ( feature . fid ) {
240- json . id = feature . fid ;
239+ if ( fea . geometry && fea . geometry . type === 'LINEM' ) {
240+ json . length = fea . geometry . length ;
241+ json . maxM = fea . geometry . maxM ;
242+ json . minM = fea . geometry . minM ;
241243 }
242- if ( feature . ID ) {
243- json . id = feature . ID ;
244+ if ( fea . fid ) {
245+ json . id = fea . fid ;
246+ }
247+ if ( fea . ID ) {
248+ json . id = fea . ID ;
244249 }
245-
246250 var exceptKeys = [ "fieldNames" , "fieldValues" , "geometry" , "stringID" , "ID" ] ;
247- for ( var key in feature ) {
251+ for ( var key in fea ) {
248252 if ( exceptKeys . indexOf ( key ) > - 1 ) {
249253 continue ;
250254 }
251- var value = this . _transformValue ( feature [ key ] , parseProperties ) ;
255+ var value = this . _transformValue ( fea [ key ] , parseProperties ) ;
252256 if ( extraKeys ) {
253257 json [ key ] = value ;
254258 } else {
0 commit comments