Commit 9229119e authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Muestra más info de capas, expone atribución

parent 08aa5803
Loading
Loading
Loading
Loading
+25 −3
Original line number Diff line number Diff line
@@ -3,12 +3,14 @@ define([
	, "app/redmicConfig"
	, "dojo/_base/declare"
	, "dojo/_base/lang"
	, 'redmic/modules/layout/templateDisplayer/TemplateDisplayer'
	, 'redmic/modules/map/_AtlasLayersManagement'
	, "redmic/modules/map/LeafletImpl"
	, "redmic/modules/map/layer/WmsLayerImpl"
	, "RWidgets/RedmicUtilities"
	, "templates/ServiceOGCTitle"
	, "templates/ServiceOGCInfo"
	, "templates/ServiceOGCSourceInfo"
//	, "templates/ServiceOGCImage"
	, "./_DetailsBase"
], function(
@@ -16,12 +18,14 @@ define([
	, redmicConfig
	, declare
	, lang
	, TemplateDisplayer
	, _AtlasLayersManagement
	, LeafletImpl
	, WmsLayerImpl
	, RedmicUtilities
	, TemplateTitle
	, TemplateInfo
	, TemplateSourceInfo
//	, TemplateImage
	, _DetailsBase
) {
@@ -39,6 +43,7 @@ define([

			this.activityLocalTarget = "activitiesLayer";
			this.infoLayerTarget = 'infoLayerTarget';
			this.sourceInfoLayerTarget = 'sourceInfoLayerTarget';

			this.config = {
				templateTitle: TemplateTitle,
@@ -54,14 +59,27 @@ define([

			this.target.push(this.activityTarget);

			this.widgetConfigs = this._merge([
				this.widgetConfigs || {},
				{
			this.widgetConfigs = this._merge([this.widgetConfigs || {}, {
				info: {
					height: 3,
					props: {
						target: this.infoLayerTarget
					}
				},
				sourceInfo: {
					width: 3,
					height: 6,
					type: TemplateDisplayer,
					props: {
						title: this.i18n.sourceInfo,
						template: TemplateSourceInfo,
						target: this.sourceInfoLayerTarget,
						"class": "containerDetails",
						classEmptyTemplate: "contentListNoData",
						associatedIds: [this.ownChannel],
						shownOption: this.shownOptionInfo
					}
				},
				activityList: {
					height: 3,
					props: {
@@ -146,6 +164,10 @@ define([
				data: data,
				target: this.infoLayerTarget
			});
			this._emitEvt('INJECT_ITEM', {
				data: data,
				target: this.sourceInfoLayerTarget
			});

			this._publishMapBox('CLEAR');
			this._createMapBoundingLayer(data);
+6 −2
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ define({
	, "service-ogc": "Servicios OGC"
	, "srs": "SRS"
	, "abstractLayer": "Descripción"
	, "styleLayer": "Estilo capa"
	, "styleLayer": "Estilos disponibles"
	, "style": "Estilo"
	, "addLayers" : "Añadir capas"
	, "backToMap" : "Volver al mapa"
@@ -789,7 +789,7 @@ define({
	, "enable": "Activar"
	, "disable": "Desactivar"
	, "enabled": "Activo"
	, "disabled": "Desactivo"
	, "disabled": "Desactivado"
	, "role": "Rol"
	, "password": "Contraseña"
	, "confirmPassword": "Confirmar contraseña"
@@ -1294,6 +1294,10 @@ define({

	, "layerRefreshInterval": "Intervalo de auto-actualización de capa"
	, "layerName": "Nombre de capa"
	, "queryable": "Consultable"
	, "sourceInfo": "Información desde la fuente"
	, "attribution": "Atribución"
	, "shownInAtlas": "Mostrado en Atlas"


	// Para capas que no se pueden cambiar las keys
+5 −1
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ define({
		, "service-ogc": "OGC services"
		, "srs": "SRS"
		, "abstractLayer": "Description"
		, "styleLayer": "Style layer"
		, "styleLayer": "Available styles"
		, "style": "Style"
		, "addLayers": "Add layers"
		, "backToMap": "Go back to map"
@@ -1298,6 +1298,10 @@ define({

		, "layerRefreshInterval": "Layer auto-refresh interval"
		, "layerName": "Layer name"
		, "queryable": "Queryable"
		, "sourceInfo": "Information from source"
		, "attribution": "Attribution"
		, "shownInAtlas": "Shown in Atlas"


		//Para capas que no se pueden cambiar las keys
+23 −1
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@ define([
			return {
				format: this._getFormatParamValue(atlasLayer, protocol),
				transparent: true,
				attribution: atlasLayer.attribution
				attribution: this._getLayerAttributionValue(atlasLayer)
			};
		},

@@ -211,6 +211,28 @@ define([
			return 'image/jpeg';
		},

		_getLayerAttributionValue: function(atlasLayer) {

			var attribution = atlasLayer.attribution;

			if (typeof attribution === 'string') {
				return attribution;
			} else if (attribution && typeof attribution === 'object') {
				var href = attribution.onlineResource,
					text = attribution.title;

				if (!text) {
					return;
				}

				if (!href) {
					return text;
				}

				return '<a href="' + href + '" target="_blank" title="' + href + '">' + text + '</a>';
			}
		},

		_getAtlasLayerDefinition: function() {

			return declare([WmsLayerImpl, _PublishInfo]);
Compare 72c8137e to 3af99f74
Original line number Diff line number Diff line
Subproject commit 72c8137e74283e9c8cfe946dc5d0bd60e607e59d
Subproject commit 3af99f7471d9f12daa0befbb3d41f8ed5249dd1c