Commit 1ce135aa authored by Pierre Marchand's avatar Pierre Marchand

[client/compose] removed commented blocks

parent 33105fba
......@@ -94,42 +94,7 @@ const inspireS: Setoid<Inspire> = {
const uniqInspire = uniq(inspireS);
// observe('data/maps', () => {
// const info = getMapInfo();
// if (info) {
// info.layers.forEach((l) => {
// getDatasetMetadata(l.metadataId)
// .foldL(
// () =>
// fetchDatasetMetadata(getApiUrl(`metadatas/${l.metadataId}`))
// .then((md) => {
// loadLayerDataAccordingToZoom(l, md);
// })
// .catch(err => logger(`observe(data/maps) ${err}`)),
// md => Promise.resolve(loadLayerDataAccordingToZoom(l, md)));
// });
// }
// });
// observe('app/current-map', () => {
// const info = getMapInfo();
// if (info) {
// removeLayerAll(mapName);
// info.layers.forEach((l) => {
// fetchDatasetMetadata(getApiUrl(`metadatas/${l.metadataId}`))
// .then((md) => {
// loadLayerDataAccordingToZoom(l, md);
// addLayer(mapName,
// () => getSynteticLayerInfoOption(l.id),
// () => getLayerData(md.uniqueResourceIdentifier),
// );
// })
// .catch(err => logger(`observe(app/current-map) ${err}`));
// });
// }
// });
// << STREAMING WIP
observe('port/map/view',
view =>
......@@ -238,12 +203,6 @@ const loadLayerData = (url: string) => {
};
// STREMAING WIP >>
// const isZoomVisible = (zoom: number, minZoom: number, maxZoom: number): boolean => {
// return ((zoom > minZoom) && (zoom < maxZoom));
// };
const makeMap =
(): Partial<IMapInfo> => {
return {
......@@ -260,49 +219,8 @@ const makeMap =
};
// const loadLayerData = (md: Inspire, bbox: number[] | null) => {
// loadLayer(md.uniqueResourceIdentifier,
// md.uniqueResourceIdentifier, bbox);
// };
// const loadExistingLayerData = (md: Inspire, bbox: number[] | null) => {
// loadExistingLayer(md.uniqueResourceIdentifier,
// md.uniqueResourceIdentifier, bbox);
// };
// const loadLayerDataAccordingToZoom = (
// info: ILayerInfo,
// metadata: Inspire,
// ) => {
// getLayerData(metadata.uniqueResourceIdentifier)
// .map((data) => {
// const zoom = mapQueries.getView().zoom;
// const minZoom = fromNullable(info.minZoom).getOrElse(0);
// const maxZoom = fromNullable(info.maxZoom).getOrElse(30);
// if (isZoomVisible(zoom, minZoom, maxZoom)) {
// let extent = null;
// if (metadata.dataStreamUrl) {
// extent = mapQueries.getView().extent;
// }
// if (data.isNone()) {
// loadLayerData(metadata, extent);
// addLayer(mapName,
// () => getSynteticLayerInfoOption(info.id),
// () => getLayerData(metadata.uniqueResourceIdentifier));
// }
// else if (extent) {
// loadExistingLayerData(metadata, extent);
// }
// }
// });
// };
export const loadUser = (url: string) => {
fetchUser(url)
.then((user) => {
......@@ -345,17 +263,6 @@ export const signalReadyMap = () => {
};
// export const loadMap = (url: string) =>
// fetchMap(url)
// .then((map) => {
// dispatch('data/maps', (state) => {
// return (
// state.filter(m => m.id !== map.id)
// .concat([map])
// );
// });
// });
// };
export const loadBaseLayer = (id: string, url: string) => {
fetchBaseLayer(url)
......@@ -365,47 +272,7 @@ export const loadBaseLayer = (id: string, url: string) => {
};
// const loadLayer = (
// id: string, url: string,
// bbox: number[] | null,
// ) => {
// const bboxParams = (bbox) ? `?bbox=${bbox[0]},${bbox[1]},${bbox[2]},${bbox[3]}` : '';
// getLayerData(id)
// .map(o =>
// o.foldL(
// () => fetchLayer(url + bboxParams)
// .then((layer) => {
// dispatch('data/layers', (state) => {
// if (id in state) {
// return state;
// }
// state[id] = layer;
// return state;
// });
// })
// .catch((err) => {
// logger(`Failed to load layer at ${url} due to ${err}`);
// dispatch('remote/errors', state => ({ ...state, [id]: `${err}` }));
// }),
// () => void 0));
// };
// export const loadExistingLayer = (id: string, url: string, bbox: number[] | null) => {
// const bboxParams = (bbox) ? `?bbox=${bbox[0]},${bbox[1]},${bbox[2]},${bbox[3]}` : '';
// fetchLayer(url + bboxParams)
// .then((layer) => {
// dispatch('data/layers', (state) => {
// state[id] = layer;
// return state;
// });
// })
// .catch((err) => {
// logger(`Failed to load layer at ${url} due to ${err}`);
// dispatch('remote/errors', state => ({ ...state, [id]: `${err}` }));
// });
// };
export const loadCategories = (url: string) => {
fetchCategories(url)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment