Skip to content

Commit dc0a626

Browse files
committed
Adding WPS-based feature info.
1 parent 12b6e12 commit dc0a626

File tree

3 files changed

+25
-13
lines changed

3 files changed

+25
-13
lines changed

app/scripts/views/LayerInfoView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120

121121
var frame = $('#layer-info-frame') ;
122122

123-
if ( response && response.protocol == 'WMS' && response.request.type == 'GET' ) {
123+
if (response && response.request.type == 'GET' && (response.protocol == 'WMS' || response.protocol == 'WPS')) {
124124
frame.css('display','block');
125125
frame.attr('srcdoc',response.data); // HTML5 feature - overides 'src' attribute when supported by the browser
126126
frame.attr('src',response.request.url);

app/scripts/views/MapView.js

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,22 @@ define(['backbone',
375375
}
376376
}
377377

378+
// prepare getFeatureInfo request
379+
function getCoverageInfoWPS10(info, prm){
380+
381+
var request = info.url +
382+
"?SERVICE=WPS&VERSION=1.0.0&REQUEST=Execute&IDENTIFIER=getCoverageInfo" +
383+
"&RawDataOutput=info&DATAINPUTS=collection%3D" + info.id +
384+
"%3Bbegin_time%3D" + getISODateTimeString(prm.time.start) +
385+
"%3Bend_time%3D" + getISODateTimeString(prm.time.end) +
386+
"%3Blongitude%3D" + prm.lonlat.lon + "%3Blatitude%3D" + prm.lonlat.lat
387+
388+
return {
389+
type: 'GET',
390+
url: request
391+
}
392+
}
393+
378394
// get active data-layers
379395
var layers = globals.products.filter(function(model) { return model.get('visible'); });
380396

@@ -413,22 +429,20 @@ define(['backbone',
413429

414430
var layer = layers[i]
415431
var info = layers[i].get('info') ;
432+
var request = null;
416433

417434
switch ( info.protocol ) {
418-
419435
case 'WMS': // WMS protocol - getFeatureInfo
420-
var request = getFetureInfoWMS13(info,prm) ;
421-
break ;
436+
request = getFetureInfoWMS13(info,prm);
437+
break;
422438

423-
/* TODO WPS
424439
case 'WPS': // WPS protocol - EOxServer specific
425-
request = getWPS(info,prm) ;
426-
break ;
427-
*/
440+
request = getCoverageInfoWPS10(info, prm);
441+
break;
428442

429443
default:
430444
console.error('Unsupported info protocol "'+info.protocol+'" ! LAYER="'+layer.get('view').id+'"');
431-
continue ;
445+
continue;
432446
}
433447

434448
// get the response

app/templates/LayerInfo.hbs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@
1616
</tr>
1717
</table>
1818
<div class="layer-info-group">
19-
<span class="layer-info-label">Feature info:</span>
20-
<iframe id="layer-info-frame"></iframe>
2119
</div>
22-
2320
</div>
24-
21+
<div class="layer-info-group"><span class="layer-info-label">&nbsp;&nbsp;&nbsp;&nbsp;Feature info:</span></div>
22+
<iframe id="layer-info-frame"></iframe>
2523
<div class="panel-footer">
2624
<span id="layer-info-location-lat">n/a</span>&nbsp;&nbsp;&nbsp;&nbsp;<span id="layer-info-location-lon">n/a</span>
2725
</div>

0 commit comments

Comments
 (0)