@@ -26,6 +26,14 @@ async function initMap() {
26
26
} ) ;
27
27
}
28
28
29
+ function getGeophiresWebInterfaceDeeplinkUrl ( params ) {
30
+ let hashParams = new URLSearchParams ( )
31
+ hashParams . set ( 'geophires_input_parameters' , JSON . stringify ( params ) )
32
+ let url = new URL ( `${ location . origin } /geothermal/geophires` )
33
+ url . hash = btoa ( hashParams . toString ( ) )
34
+ return url
35
+ }
36
+
29
37
initMap ( ) . then ( async ( ) => {
30
38
31
39
const {
@@ -149,22 +157,20 @@ initMap().then(async () => {
149
157
$ ( summaryTable ) . append ( $ ( `<thead><tr><th colspan='2'>PRE-CACLULATED FACILITY RESULTS: ${ facilityName } </th></tr></thead>` ) )
150
158
$ ( summaryTable ) . append ( getTbody ( facilityData . geophires_summary ) )
151
159
152
-
153
- // WIP...
154
- /*
155
- 'End-Use Option': EndUseOption.DIRECT_USE_HEAT.value,
156
- 'Reservoir Model': 1,
157
- 'Time steps per year': 6,
158
- 'Reservoir Depth': 3,
159
- 'Gradient 1': temp_gradient,
160
- */
161
- // let geophiresDeeplinkHash = 'abc'
162
- // let geophiresDeeplink = `/geothermal/geophires#${geophiresDeeplinkHash}`
163
-
160
+ let geophiresParams = {
161
+ 'End-Use Option' : 2 ,
162
+ 'Reservoir Depth' : 3 ,
163
+ 'Gradient 1' : facilityData [ 'gradient_degC_per_km' ] ,
164
+ 'Reservoir Model' : 1 ,
165
+ 'Time steps per year' : 6 ,
166
+ }
164
167
$ ( '#results' ) . empty ( )
165
168
. append ( summaryTable )
166
169
//.append(infoTable.clone())
167
- //.append($(`<a href='${geophiresDeeplink}'>geophires</a>`))
170
+ . append (
171
+ $ ( `<a href='${ getGeophiresWebInterfaceDeeplinkUrl ( geophiresParams ) } ' target="_blank">
172
+ Click here to start your own GEOPHIRES analysis with the estimated gradient at this facility location</a>` )
173
+ )
168
174
169
175
resetGenerationProfileGraphs ( )
170
176
} ) ;
0 commit comments