Loading grunt/config/handlebars.js +1 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ module.exports = function(grunt) { bold: true, IterateJSON: true, ProtocolsServiceOGC: true, DownloadServiceOGC: true, breaklines: true, textOrSpace: true, PrintProperty: true, Loading src/ServiceOGC/Info.hbs +10 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,16 @@ </div> </div> {{/if}} {{#if data.urlSource}} <div class="row"> <div class="rowLeft inlineRow {{RowColServiceOGCCatalog 'left'}}"> <span title="{{i18n.download}}">{{i18n.download}}</span> </div> <div class="{{RowColServiceOGCCatalog 'right'}} detailsRowFlex"> {{DownloadServiceOGC data.urlSource data.name}} </div> </div> {{/if}} </div> </div> </div> No newline at end of file src/helpers.js +41 −0 Original line number Diff line number Diff line Loading @@ -848,6 +848,47 @@ define([ return new handlebars.SafeString(content); }, 'DownloadServiceOGC': function(urlSource, name) { var urlSourceSplitted = urlSource.split('/'); urlSourceSplitted.pop(); var workspace = urlSourceSplitted[urlSourceSplitted.length - 1]; urlSourceSplitted.push('ows'); var urlCommonParams = 'service=WFS&version=1.0.0&request=GetFeature&typeName=' + workspace + ':' + name, urlCommonPrefix = urlSourceSplitted.join('/') + '?' + urlCommonParams, content = '', downloadFormats = [{ name: 'CSV', descriptor: 'csv' },{ name: 'Shapefile', descriptor: 'shape-zip' },{ name: 'GeoJSON', descriptor: 'application/json' },{ name: 'KML', descriptor: 'application/vnd.google-earth.kml%2Bxml' },{ name: 'GML 3.2', descriptor: 'application/gml%2Bxml; version=3.2' }]; for (var i = 0; i < downloadFormats.length; i++) { var format = downloadFormats[i], formatName = format.name, descriptor = format.descriptor, downloadUrl = '<span><a href="' + urlCommonPrefix + '&outputFormat=' + descriptor + '" target="_blank">' + formatName + '</a></span>'; content += downloadUrl; } return new handlebars.SafeString(content); }, 'breaklines': breaklines, 'textOrSpace': function(text) { Loading Loading
grunt/config/handlebars.js +1 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ module.exports = function(grunt) { bold: true, IterateJSON: true, ProtocolsServiceOGC: true, DownloadServiceOGC: true, breaklines: true, textOrSpace: true, PrintProperty: true, Loading
src/ServiceOGC/Info.hbs +10 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,16 @@ </div> </div> {{/if}} {{#if data.urlSource}} <div class="row"> <div class="rowLeft inlineRow {{RowColServiceOGCCatalog 'left'}}"> <span title="{{i18n.download}}">{{i18n.download}}</span> </div> <div class="{{RowColServiceOGCCatalog 'right'}} detailsRowFlex"> {{DownloadServiceOGC data.urlSource data.name}} </div> </div> {{/if}} </div> </div> </div> No newline at end of file
src/helpers.js +41 −0 Original line number Diff line number Diff line Loading @@ -848,6 +848,47 @@ define([ return new handlebars.SafeString(content); }, 'DownloadServiceOGC': function(urlSource, name) { var urlSourceSplitted = urlSource.split('/'); urlSourceSplitted.pop(); var workspace = urlSourceSplitted[urlSourceSplitted.length - 1]; urlSourceSplitted.push('ows'); var urlCommonParams = 'service=WFS&version=1.0.0&request=GetFeature&typeName=' + workspace + ':' + name, urlCommonPrefix = urlSourceSplitted.join('/') + '?' + urlCommonParams, content = '', downloadFormats = [{ name: 'CSV', descriptor: 'csv' },{ name: 'Shapefile', descriptor: 'shape-zip' },{ name: 'GeoJSON', descriptor: 'application/json' },{ name: 'KML', descriptor: 'application/vnd.google-earth.kml%2Bxml' },{ name: 'GML 3.2', descriptor: 'application/gml%2Bxml; version=3.2' }]; for (var i = 0; i < downloadFormats.length; i++) { var format = downloadFormats[i], formatName = format.name, descriptor = format.descriptor, downloadUrl = '<span><a href="' + urlCommonPrefix + '&outputFormat=' + descriptor + '" target="_blank">' + formatName + '</a></span>'; content += downloadUrl; } return new handlebars.SafeString(content); }, 'breaklines': breaklines, 'textOrSpace': function(text) { Loading