Commit 7e7d1b8d authored by Pierre Marchand's avatar Pierre Marchand

[client/view] remove bookmarks legend item from print

parent 59198bf0
......@@ -24,6 +24,7 @@ import { Box, makeText, Layout } from 'sdi/print/context';
import legendItem from './legend-item';
import { Spec, TemplateName, applySpec } from '../template';
import { withoutBookmarks } from 'view/src/queries/bookmark';
const logger = debug('sdi:print/legend');
......@@ -35,7 +36,7 @@ interface Group {
const groupItems =
(layers: ILayerInfo[]) =>
layers.slice().reverse().reduce<Group[]>((acc, info) => {
withoutBookmarks(layers).slice().reverse().reduce<Group[]>((acc, info) => {
const ln = acc.length;
if (ln === 0) {
return [{
......@@ -170,7 +171,6 @@ const renderGroups =
export const renderLegend =
(tn: TemplateName, mapInfo: IMapInfo) => {
const withSpec = applySpec(tn);
// f('legend', spec => renderGroups(spec, groupItems(mapInfo.layers))))
return scopeOption()
.let('legend', withSpec('legend', s => s))
.let('legendItem', withSpec('legendItem', s => s))
......
......@@ -14,10 +14,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import * as debug from 'debug';
import { query } from 'sdi/shape';
import { bookmarkLayerID, defaultBookmarks } from '../components/bookmark';
import { ILayerInfo } from 'sdi/source';
const logger = debug('sdi:query/bookmark');
export const getBookmarks =
() => {
const layers = query('data/layers');
......@@ -28,4 +32,9 @@ export const getBookmarks =
};
export const withoutBookmarks =
(ls: ILayerInfo[]) => ls.filter(l => l.id !== bookmarkLayerID)
(ls: ILayerInfo[]) =>
ls.filter(l => l.id !== bookmarkLayerID);
logger('loaded');
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