Przeglądaj źródła

👽️ update due to get_zones/ API changes

jmacura 3 lat temu
rodzic
commit
9d4a5bcde4

+ 1 - 1
src/app/calculator/calculator.service.ts

@@ -93,7 +93,7 @@ export class CalculatorService {
             product,
             date: this.selectedDate,
             format: 'geojson',
-            geometry: this.fieldService.getSelectedFieldGeoJSON(),
+            geojson: this.fieldService.getSelectedFieldGeoJSON(),
           },
           {
             headers: {

+ 15 - 5
src/app/calculator/field.service.ts

@@ -121,11 +121,21 @@ export class FieldService {
 
   getSelectedFieldGeoJSON() {
     return {
-      type: 'Polygon',
-      coordinates: this.selectedField
-        .clone()
-        .transform('EPSG:5514', 'EPSG:4326')
-        .getCoordinates(),
+      type: 'FeatureCollection',
+      name: 'Selected field',
+      features: [
+        {
+          type: 'Feature',
+          properties: {},
+          geometry: {
+            type: 'Polygon',
+            coordinates: this.selectedField
+              .clone()
+              .transform('EPSG:5514', 'EPSG:4326')
+              .getCoordinates(),
+          },
+        },
+      ],
     };
   }