Add area to selected-item-cropfield
This commit is contained in:
@@ -5,6 +5,7 @@ import * as mapReducers from '../../reducers/map.reducer';
|
||||
import { commonReducers,ItemTypeService,AppConfig } from '@farmmaps/common';
|
||||
import { AbstractFeatureListFeatureComponent } from '../feature-list-feature/feature-list-feature.component';
|
||||
import { ForItemType } from '../for-item/for-itemtype.decorator';
|
||||
import {getArea} from 'ol/sphere';
|
||||
|
||||
|
||||
@ForItemType("vnd.farmmaps.itemtype.cropfield")
|
||||
@@ -25,6 +26,6 @@ export class FeatureListFeatureCropfieldComponent extends AbstractFeatureListFea
|
||||
// get area from faeture if 0 calculate from polygon
|
||||
let a = feature.get('area');
|
||||
if(a) return a;
|
||||
return (feature.getGeometry().getArea() / 10000);
|
||||
return getArea(feature.getGeometry(),{projectio:"EPSG:3857"}) / 10000;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user