Commit d93ceb26 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Adapta browser para manejo de datos de acoustic

Añade identificadores autoincrementales a los items del listado si no
tienen definido el campo designado por idProperty.

Acepta la llegada de features GeoJSON con valor del campo properties a
null.

Incorpora nueva posibilidad para mostrar el total de elementos.
parent 5089447a
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -453,7 +453,13 @@ define([

			const data = this._parserIndexData(response);

			data?.forEach(dataItem => this._addItem(dataItem));
			data?.forEach((dataItem, index) => {

				if (!dataItem[this.idProperty]) {
					dataItem[this.idProperty] = index + 1;
				}
				this._addItem(dataItem);
			});
		}
	});
});
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ define([

			const coordinates = this._getCoordinates(item.geometry);

			item = this._merge([item, item.properties, {coordinates}]);
			item = this._merge([item, item.properties ?? {}, {coordinates}]);

			delete item.geometry;
			delete item.properties;
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ define([
			let total = resPage?.totalElements ?? resData?.total ?? response.total;

			if (total === undefined || total === null) {
				total = resData?.content?.length ?? resData?.data?.total ?? resData.length;
				total = resData?.content?.length ?? resData?.data?.total ?? resData?.data?.length ?? resData.length;
			}

			return total;