Commit 57ba69a6 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Corrige detalles de ServiceOGC, revisa Map

Limpia módulos de vistas detalle al ocultarla (al igual que al mostrarla
de nuevo).

Revisa vista detalle de servicios OGC, para evitar acumulación de capas,
desubicación y otros problemas. Permite desactivar/activar las capas
encontradas en el servicio.

Implementa acción 'clear' para el módulo Map, que permite dejarlo como
si se acabara de instanciar (eliminar capas adicionales, reposicionar,
etc).

Retoca gestión de identificadores de capa por parte del mapa, empleando
búsqueda recursiva y controlando casos de error en los que no se
encontraban las capas.
parent 4c94554c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -97,6 +97,7 @@ define([
		_setControllerOwnCallbacksForEvents: function() {

			this._onEvt('ME_OR_ANCESTOR_SHOWN', lang.hitch(this, this._onControllerMeOrAncestorShown));
			this._onEvt('ME_OR_ANCESTOR_HIDDEN', lang.hitch(this, this._onControllerMeOrAncestorHidden));
			this._onEvt('RESIZE', lang.hitch(this, this._onControllerResize));
			this._onEvt('LAYOUT_COMPLETE', lang.hitch(this, this._onLayoutComplete));
			this._onEvt('BUTTON_EVENT', lang.hitch(this, this._onButtonEvent)); // TODO esto es específico, reubicar
@@ -197,6 +198,11 @@ define([
			this._refreshModules();
		},

		_onControllerMeOrAncestorHidden: function(res) {

			this._clearModules();
		},

		/*_getModuleRootNode: function() {

			return this.containerNode;
+9 −15
Original line number Diff line number Diff line
@@ -108,20 +108,12 @@ define([

			this.inherited(arguments);

			this._publish(this._getWidgetInstance('activityList').getChannel("CLEAR"));
			this._publish(this._getWidgetInstance('activityList').getChannel('CLEAR'));

			if (this.layerPolygon) {
				this._publishMapBox("REMOVE_LAYER", {
					layer: this.layerPolygon
				});
			}
			this._publishMapBox('CLEAR');

			if (this.layer) {
				this._publishMapBox("REMOVE_LAYER", {
					layer: this.layer
				});

				this._publish(this.layer.getChannel("DESTROY"));
				this._publish(this.layer.getChannel('DESTROY'));
			}
		},

@@ -176,9 +168,9 @@ define([
				}
			});

			this._publishMapBox("ADD_LAYER", {
			this._publishMapBox('ADD_LAYER', {
				layer: this.layerPolygon,
				layerId: "boundingBox",
				layerId: 'boundingBox',
				layerLabel: this.i18n.boundingBox,
				optional: true
			});
@@ -219,8 +211,10 @@ define([
				layerDefinition: layerDefinition
			});

			this._publishMapBox("ADD_LAYER", {
				layer: this.layer
			this._publishMapBox('ADD_LAYER', {
				layer: this.layer,
				layerLabel: data.alias || data.name,
				optional: true
			});
		},

+18 −7
Original line number Diff line number Diff line
@@ -85,7 +85,8 @@ define([
					LAYER_REMOVED_CONFIRMED: "layerRemovedConfirmed",
					SET_QUERYABLE_CURSOR: "setQueryableCursor",
					MAP_SHOWN: "mapShown",
					MAP_HIDDEN: "mapHidden"
					MAP_HIDDEN: "mapHidden",
					CLEAR: 'clear'
				},

				ownChannel: "map",
@@ -162,6 +163,9 @@ define([
			},{
				channel : this.getChannel("SET_QUERYABLE_CURSOR"),
				callback: "_subSetQueryableCursor"
			},{
				channel : this.getChannel('CLEAR'),
				callback: '_subClear'
			});
		},

@@ -299,7 +303,7 @@ define([

			var optional = obj.optional,
				order = obj.order ? obj.order + 1 : null,
				layerId = this._getLayerId(obj),
				layerId = this._getLayerId(obj) || uuid.v4(),
				layerLabel = obj.layerLabel || layerId;

			// Si la capa es un módulo
@@ -350,9 +354,11 @@ define([
				return layerObj.layerId;
			}

			var layer = layerObj.layer || layerObj;
			if (layerObj.layer) {
				return this._getLayerId(layerObj.layer) || layerObj.id;
			}

			return (layer.options && layer.options.id) || layer.id || uuid.v4();
			return layerObj._leaflet_id || (layerObj.options && layerObj.options.id);
		},

		_subRemoveLayer: function(obj) {
@@ -361,13 +367,13 @@ define([
				keepInstance = obj.keepInstance,
				layerId;

			if (typeof layer === "object") {
				layerId = this._getLayerId(obj);

			if (typeof layer === 'object') {
				if (layer.isInstanceOf && layer.isInstanceOf(_Module)) {
					layer = layer.layer;
				}

				layerId = this._getLayerId(obj);

				// Si no contiene una capa de tipo leaflet (D3, por ejemplo)
				if (!layer) {
					this._emitEvt('LAYER_REMOVE', {
@@ -580,6 +586,11 @@ define([
			}
		},

		_subClear: function() {

			this.clear();
		},

		_pubLayerRemoveFailed: function(channel, layer) {

			this._publish(channel, {