File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,23 @@ $(function() {
35
35
var format = "pdf" ;
36
36
var layout = 0 ;
37
37
38
+ var paramObj = { } ;
39
+ $ . each ( $ ( '#issue-form' ) . serializeArray ( ) , function ( _ , kv ) {
40
+ paramObj [ kv . name ] = kv . value ;
41
+ } ) ;
42
+
43
+ // Apply geo data if exists
44
+ if ( requestData . attributes . map . layers [ 0 ] . geoJson && paramObj [ "issue[geojson]" ] ) {
45
+ var feature = ( new ol . format . GeoJSON ( ) ) . readFeature (
46
+ JSON . parse ( paramObj [ "issue[geojson]" ] )
47
+ ) ;
48
+ feature . set ( 'subject' , paramObj [ "issue[subject]" ] ) ;
49
+ feature . getGeometry ( ) . transform ( 'EPSG:4326' , 'EPSG:3857' ) ;
50
+
51
+ requestData . attributes . map . layers [ 0 ] . geoJson = JSON . parse ( ( new ol . format . GeoJSON ( ) ) . writeFeatures ( [ feature ] ) ) ;
52
+ requestData . attributes . map . center = ol . extent . getCenter ( feature . getGeometry ( ) . getExtent ( ) ) ;
53
+ }
54
+
38
55
console . log ( requestData ) ;
39
56
var startTime = new Date ( ) . getTime ( ) ;
40
57
You can’t perform that action at this time.
0 commit comments