File tree 1 file changed +19
-0
lines changed
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ require("./SynthPolygonWizard.js");
2
2
require ( "./SynthPolygonSettings.js" ) ;
3
3
const MathTools = require ( "../MathTools.js" ) ;
4
4
const proj4 = require ( "proj4" ) ;
5
+ const geojsonMerge = require ( "@mapbox/geojson-merge" ) ; // Using this since turfHelpers.featureCollection() discards previously defined properties.
5
6
6
7
/**
7
8
* Polygon layer
@@ -367,6 +368,24 @@ L.ALS.SynthPolygonLayer = L.ALS.SynthPolygonBaseLayer.extend(/** @lends L.ALS.Sy
367
368
return Math . sqrt ( point [ 0 ] ** 2 + point [ 1 ] ** 2 ) <= this . maxGnomonicPointDistance ;
368
369
} ,
369
370
371
+ toGeoJSON : function ( ) {
372
+ let jsons = this . baseFeaturesToGeoJSON ( ) ;
373
+
374
+ this . pointsGroup . eachLayer ( layer => {
375
+ let pointsJson = layer . toGeoJSON ( ) ;
376
+ pointsJson . name = "capturePoint" ;
377
+ jsons . push ( pointsJson ) ;
378
+ } ) ;
379
+
380
+ let props = { }
381
+ for ( let param of this . propertiesToExport )
382
+ props [ param ] = this [ param ] ;
383
+
384
+ jsons . push ( L . ALS . SynthBaseLayer . prototype . toGeoJSON . call ( this , props ) ) ;
385
+
386
+ return geojsonMerge . merge ( jsons ) ;
387
+ } ,
388
+
370
389
statics : {
371
390
wizard : L . ALS . SynthPolygonWizard ,
372
391
settings : new L . ALS . SynthPolygonSettings ( ) ,
You can’t perform that action at this time.
0 commit comments