Commit 00f21447 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Merge branch 'feature-AtlasServiceUpgrade' into 'dev'

Feature atlas service upgrade

See merge request redmic-project/client/templates!9
parents e681dd5b 4e1bc2c3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ module.exports = function(grunt) {
						bold: true,
						IterateJSON: true,
						ProtocolsServiceOGC: true,
						DownloadServiceOGC: true,
						breaklines: true,
						textOrSpace: true,
						PrintProperty: true,
+10 −0
Original line number Diff line number Diff line
@@ -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
+0 −3
Original line number Diff line number Diff line
{{#if data.urlSource}}
	{{ImageDetailsPublic data.image "imageLayerList"}}
{{/if}}
<span class='spanTemplate'>
	<span class='title'>
		{{#if data.alias}}
+41 −0
Original line number Diff line number Diff line
@@ -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) {