From 94edbd67ef58b1e6499e46af3b40f5d9d219e29c Mon Sep 17 00:00:00 2001 From: Matteo Velludini Date: Thu, 14 Feb 2019 18:32:15 +0100 Subject: [PATCH] Fix #3525 add possiblity to save and load map info configuration --- web/client/actions/__tests__/mapInfo-test.js | 5 + web/client/actions/mapInfo.js | 4 + .../data/identify/DefaultViewer.jsx | 8 +- .../data/identify/IdentifyContainer.jsx | 4 +- web/client/epics/mapexport.js | 3 +- web/client/plugins/Identify.jsx | 11 +- web/client/plugins/Save.jsx | 13 +- web/client/plugins/SaveAs.jsx | 12 +- web/client/reducers/__tests__/mapInfo-test.js | 31 +++- web/client/reducers/mapInfo.js | 33 ++++- .../selectors/__tests__/mapinfo-test.js | 34 ++++- web/client/selectors/mapinfo.js | 7 +- web/client/utils/MapUtils.js | 4 +- web/client/utils/__tests__/MapUtils-test.js | 137 +++++++++++++++++- 14 files changed, 277 insertions(+), 29 deletions(-) diff --git a/web/client/actions/__tests__/mapInfo-test.js b/web/client/actions/__tests__/mapInfo-test.js index 33cfe5f078..2b75c50846 100644 --- a/web/client/actions/__tests__/mapInfo-test.js +++ b/web/client/actions/__tests__/mapInfo-test.js @@ -20,6 +20,7 @@ var { GET_VECTOR_INFO, TOGGLE_MAPINFO_STATE, UPDATE_CENTER_TO_MARKER, + TOGGLE_EMPTY_MESSAGE_GFI, toggleEmptyMessageGFI, getFeatureInfo, changeMapInfoState, newMapInfoRequest, @@ -206,4 +207,8 @@ describe('Test correctness of the map actions', () => { expect(retval.type).toBe(UPDATE_CENTER_TO_MARKER); expect(retval.status).toBe('enabled'); }); + it('toggleEmptyMessageGFI', () => { + const retval = toggleEmptyMessageGFI(); + expect(retval.type).toBe(TOGGLE_EMPTY_MESSAGE_GFI); + }); }); diff --git a/web/client/actions/mapInfo.js b/web/client/actions/mapInfo.js index 815a7ea633..9faaea7e21 100644 --- a/web/client/actions/mapInfo.js +++ b/web/client/actions/mapInfo.js @@ -30,6 +30,9 @@ const TOGGLE_MAPINFO_STATE = 'TOGGLE_MAPINFO_STATE'; const UPDATE_CENTER_TO_MARKER = 'UPDATE_CENTER_TO_MARKER'; const CLOSE_IDENTIFY = 'IDENTIFY:CLOSE_IDENTIFY'; +const TOGGLE_EMPTY_MESSAGE_GFI = "IDENTIFY:TOGGLE_EMPTY_MESSAGE_GFI"; +const toggleEmptyMessageGFI = () => ({type: TOGGLE_EMPTY_MESSAGE_GFI}); + /** * Private * @return a LOAD_FEATURE_INFO action with the response data to a wms GetFeatureInfo @@ -240,6 +243,7 @@ module.exports = { TOGGLE_MAPINFO_STATE, UPDATE_CENTER_TO_MARKER, CLOSE_IDENTIFY, + TOGGLE_EMPTY_MESSAGE_GFI, toggleEmptyMessageGFI, closeIdentify, getFeatureInfo, changeMapInfoState, diff --git a/web/client/components/data/identify/DefaultViewer.jsx b/web/client/components/data/identify/DefaultViewer.jsx index 329fbd2610..9e58258b11 100644 --- a/web/client/components/data/identify/DefaultViewer.jsx +++ b/web/client/components/data/identify/DefaultViewer.jsx @@ -34,7 +34,8 @@ class DefaultViewer extends React.Component { onNext: PropTypes.func, onPrevious: PropTypes.func, onUpdateIndex: PropTypes.func, - setIndex: PropTypes.func + setIndex: PropTypes.func, + showEmptyMessageGFI: PropTypes.bool }; static defaultProps = { @@ -52,6 +53,7 @@ class DefaultViewer extends React.Component { }, containerProps: {}, index: 0, + showEmptyMessageGFI: true, onNext: () => {}, onPrevious: () => {}, setIndex: () => {} @@ -79,12 +81,12 @@ class DefaultViewer extends React.Component { const {layerMetadata} = res; return layerMetadata.title; }); - return ( + return this.props.showEmptyMessageGFI ? ( {titles.join(', ')} - ); + ) : null; } return null; }; diff --git a/web/client/components/data/identify/IdentifyContainer.jsx b/web/client/components/data/identify/IdentifyContainer.jsx index fe9cb2cce2..725b0c3e1b 100644 --- a/web/client/components/data/identify/IdentifyContainer.jsx +++ b/web/client/components/data/identify/IdentifyContainer.jsx @@ -51,7 +51,8 @@ module.exports = props => { setIndex, warning, clearWarning, - zIndex + zIndex, + showEmptyMessageGFI } = props; const latlng = point && point.latlng || null; @@ -105,6 +106,7 @@ module.exports = props => { format={format} missingResponses={missingResponses} responses={responses} + showEmptyMessageGFI={showEmptyMessageGFI} {...viewerOptions}/> diff --git a/web/client/epics/mapexport.js b/web/client/epics/mapexport.js index ccc48b2298..0377ebf3d6 100644 --- a/web/client/epics/mapexport.js +++ b/web/client/epics/mapexport.js @@ -12,12 +12,13 @@ const {EXPORT_MAP} = require('../actions/mapexport'); const { setControlProperty } = require('../actions/controls'); const { mapSelector } = require('../selectors/map'); +const { mapInfoConfigurationSelector } = require('../selectors/mapInfo'); const { layersSelector, groupsSelector } = require('../selectors/layers'); const { mapOptionsToSaveSelector } = require('../selectors/mapsave'); const textSearchConfigSelector = state => state.searchconfig && state.searchconfig.textSearchConfig; const PersistMap = { - mapstore2: (state) => JSON.stringify(MapUtils.saveMapConfiguration(mapSelector(state), layersSelector(state), groupsSelector(state), textSearchConfigSelector(state), mapOptionsToSaveSelector(state))) + mapstore2: (state) => JSON.stringify(MapUtils.saveMapConfiguration(mapSelector(state), layersSelector(state), groupsSelector(state), textSearchConfigSelector(state), mapOptionsToSaveSelector(state), mapInfoConfigurationSelector(state))) }; diff --git a/web/client/plugins/Identify.jsx b/web/client/plugins/Identify.jsx index 202c53ee7f..49b0776553 100644 --- a/web/client/plugins/Identify.jsx +++ b/web/client/plugins/Identify.jsx @@ -15,9 +15,9 @@ const {createSelector} = require('reselect'); const {mapSelector} = require('../selectors/map'); const {layersSelector} = require('../selectors/layers'); -const {getFeatureInfo, getVectorInfo, showMapinfoMarker, hideMapinfoMarker, showMapinfoRevGeocode, hideMapinfoRevGeocode, noQueryableLayers, clearWarning, toggleMapInfoState} = require('../actions/mapInfo'); +const {getFeatureInfo, getVectorInfo, showMapinfoMarker, hideMapinfoMarker, showMapinfoRevGeocode, hideMapinfoRevGeocode, noQueryableLayers, clearWarning, toggleMapInfoState, changeMapInfoFormat, updateCenterToMarker, closeIdentify, purgeMapInfoResults} = require('../actions/mapInfo'); const {changeMousePointer} = require('../actions/map'); -const {changeMapInfoFormat, updateCenterToMarker, closeIdentify, purgeMapInfoResults} = require('../actions/mapInfo'); +const {showEmptyMessageGFISelector} = require('../selectors/mapInfo'); const {currentLocaleSelector} = require('../selectors/locale'); const {compose, defaultProps} = require('recompose'); @@ -46,9 +46,10 @@ const selector = createSelector([ (state) => state.mapInfo && state.mapInfo.reverseGeocodeData, (state) => state.mapInfo && state.mapInfo.warning, currentLocaleSelector, - state => mapLayoutValuesSelector(state, {height: true}) -], (enabled, responses, requests, format, map, layers, point, layer, showModalReverse, reverseGeocodeData, warning, currentLocale, dockStyle) => ({ - enabled, responses, requests, format, map, layers, point, layer, showModalReverse, reverseGeocodeData, warning, currentLocale, dockStyle + state => mapLayoutValuesSelector(state, {height: true}), + state => showEmptyMessageGFISelector(state) +], (enabled, responses, requests, format, map, layers, point, layer, showModalReverse, reverseGeocodeData, warning, currentLocale, dockStyle, showEmptyMessageGFI) => ({ + enabled, responses, requests, format, map, layers, point, layer, showModalReverse, reverseGeocodeData, warning, currentLocale, dockStyle, showEmptyMessageGFI })); // result panel diff --git a/web/client/plugins/Save.jsx b/web/client/plugins/Save.jsx index a818153a25..7e3cf09289 100644 --- a/web/client/plugins/Save.jsx +++ b/web/client/plugins/Save.jsx @@ -23,11 +23,14 @@ const ConfigUtils = require('../utils/ConfigUtils'); const {mapSelector} = require('../selectors/map'); const {layersSelector, groupsSelector} = require('../selectors/layers'); const {mapOptionsToSaveSelector} = require('../selectors/mapsave'); - +const {mapInfoConfigurationSelector} = require('../selectors/mapinfo'); const MapUtils = require('../utils/MapUtils'); const showSelector = state => state.controls && state.controls.save && state.controls.save.enabled; const textSearchConfigSelector = state => state.searchconfig && state.searchconfig.textSearchConfig; -const selector = createSelector(mapSelector, mapOptionsToSaveSelector, layersSelector, groupsSelector, showSelector, textSearchConfigSelector, (map, additionalOptions, layers, groups, show, textSearchConfig) => ({ + +const selector = createSelector( + mapSelector, mapOptionsToSaveSelector, layersSelector, groupsSelector, showSelector, textSearchConfigSelector, mapInfoConfigurationSelector, + (map, additionalOptions, layers, groups, show, textSearchConfig, mapInfoConfiguration) => ({ currentZoomLvl: map && map.zoom, show, map, @@ -35,7 +38,8 @@ const selector = createSelector(mapSelector, mapOptionsToSaveSelector, layersSel mapId: map && map.mapId, layers, textSearchConfig, - groups + groups, + mapInfoConfiguration })); class Save extends React.Component { @@ -49,6 +53,7 @@ class Save extends React.Component { map: PropTypes.object, layers: PropTypes.array, groups: PropTypes.array, + mapInfoConfiguration: PropTypes.object, params: PropTypes.object, textSearchConfig: PropTypes.object }; @@ -90,7 +95,7 @@ class Save extends React.Component { goForTheUpdate = () => { if (this.props.mapId) { if (this.props.map && this.props.layers) { - const resultingmap = MapUtils.saveMapConfiguration(this.props.map, this.props.layers, this.props.groups, this.props.textSearchConfig, this.props.additionalOptions); + const resultingmap = MapUtils.saveMapConfiguration(this.props.map, this.props.layers, this.props.groups, this.props.textSearchConfig, this.props.additionalOptions, this.props.mapInfoConfiguration); const {name, description} = this.props.map.info; this.props.onMapSave({id: this.props.mapId, data: resultingmap, metadata: {name, description}, category: "MAP"}); this.props.onClose(); diff --git a/web/client/plugins/SaveAs.jsx b/web/client/plugins/SaveAs.jsx index df7dfd4c9c..21a042e54a 100644 --- a/web/client/plugins/SaveAs.jsx +++ b/web/client/plugins/SaveAs.jsx @@ -20,6 +20,7 @@ const {editMap, updateCurrentMap, errorCurrentMap, resetCurrentMap} = require('. const {mapSelector} = require('../selectors/map'); const {layersSelector, groupsSelector} = require('../selectors/layers'); const {mapOptionsToSaveSelector} = require('../selectors/mapsave'); +const {mapInfoConfigurationSelector} = require('../selectors/mapInfo'); const {mapTypeSelector} = require('../selectors/maptype'); const {indexOf} = require('lodash'); const uuid = require('uuid/v1'); @@ -41,13 +42,15 @@ const selector = createSelector( groupsSelector, mapOptionsToSaveSelector, saveAsStateSelector, - (map, layers, groups, additionalOptions, saveAsState) => ({ + mapInfoConfigurationSelector, + (map, layers, groups, additionalOptions, saveAsState, mapInfoConfiguration) => ({ currentZoomLvl: map && map.zoom, map, layers, groups, additionalOptions, - ...saveAsState + ...saveAsState, + mapInfoConfiguration })); class SaveAs extends React.Component { @@ -75,7 +78,8 @@ class SaveAs extends React.Component { metadataChanged: PropTypes.func, onMapSave: PropTypes.func, loadMapInfo: PropTypes.func, - textSearchConfig: PropTypes.object + textSearchConfig: PropTypes.object, + mapInfoConfiguration: PropTypes.object }; static contextTypes = { @@ -140,7 +144,7 @@ class SaveAs extends React.Component { // this method creates the content for the Map Resource createV2Map = () => { - return MapUtils.saveMapConfiguration(this.props.map, this.props.layers, this.props.groups, this.props.textSearchConfig, this.props.additionalOptions); + return MapUtils.saveMapConfiguration(this.props.map, this.props.layers, this.props.groups, this.props.textSearchConfig, this.props.additionalOptions, this.props.mapInfoConfiguration); }; saveMap = (id, name, description) => { diff --git a/web/client/reducers/__tests__/mapInfo-test.js b/web/client/reducers/__tests__/mapInfo-test.js index 928f8a3ec5..f71577d49a 100644 --- a/web/client/reducers/__tests__/mapInfo-test.js +++ b/web/client/reducers/__tests__/mapInfo-test.js @@ -8,7 +8,8 @@ const expect = require('expect'); const mapInfo = require('../mapInfo'); -const { featureInfoClick } = require('../../actions/mapInfo'); +const { featureInfoClick, toggleEmptyMessageGFI } = require('../../actions/mapInfo'); +const { MAP_CONFIG_LOADED } = require('../../actions/config'); const assign = require('object-assign'); require('babel-polyfill'); @@ -1426,4 +1427,32 @@ describe('Test the mapInfo reducer', () => { expect(state.responses[0].layerMetadata.buffer).toBe(2); }); + it('TOGGLE_EMPTY_MESSAGE_GFI', () => { + let state = mapInfo({ + infoFormat: "text/html", + configuration: {} + }, toggleEmptyMessageGFI()); + expect(state.configuration.showEmptyMessageGFI).toBe(true); + state = mapInfo(state, toggleEmptyMessageGFI()); + expect(state.configuration.showEmptyMessageGFI).toBe(false); + }); + it('MAP_CONFIG_LOADED', () => { + const oldInfoFormat = "text/html"; + const newInfoFormat = "application/json"; + let state = mapInfo({ + infoFormat: oldInfoFormat, + configuration: {} + }, { + type: MAP_CONFIG_LOADED, + config: { + mapInfoConfiguration: { + infoFormat: newInfoFormat, + showEmptyMessageGFI: true + } + } + }); + expect(state.configuration.showEmptyMessageGFI).toBe(true); + expect(state.configuration.infoFormat).toBe(newInfoFormat); + }); + }); diff --git a/web/client/reducers/mapInfo.js b/web/client/reducers/mapInfo.js index de6d1fcfdc..186a9d46c7 100644 --- a/web/client/reducers/mapInfo.js +++ b/web/client/reducers/mapInfo.js @@ -23,8 +23,12 @@ const { CLEAR_WARNING, FEATURE_INFO_CLICK, TOGGLE_MAPINFO_STATE, - UPDATE_CENTER_TO_MARKER + UPDATE_CENTER_TO_MARKER, + TOGGLE_EMPTY_MESSAGE_GFI } = require('../actions/mapInfo'); +const { + MAP_CONFIG_LOADED +} = require('../actions/config'); const {RESET_CONTROLS} = require('../actions/controls'); const assign = require('object-assign'); @@ -44,7 +48,10 @@ function receiveResponse(state, action, type) { } return state; } -const initState = {enabled: true}; +const initState = { + enabled: true, + configuration: {} +}; function mapInfo(state = initState, action) { switch (action.type) { @@ -92,9 +99,13 @@ function mapInfo(state = initState, action) { }); } case CHANGE_MAPINFO_FORMAT: { - return assign({}, state, { - infoFormat: action.infoFormat - }); + return {...state, + infoFormat: action.infoFormat, + configuration: { + ...state.configuration, + infoFormat: action.infoFormat + } + }; } case SHOW_MAPINFO_MARKER: { return assign({}, state, { @@ -191,6 +202,18 @@ function mapInfo(state = initState, action) { centerToMarker: action.status }); } + case TOGGLE_EMPTY_MESSAGE_GFI: { + return {...state, configuration: { + ...state.configuration, showEmptyMessageGFI: !state.configuration.showEmptyMessageGFI + } + }; + } + case MAP_CONFIG_LOADED: { + return {...state, + configuration: action.config.mapInfoConfiguration, + infoFormat: action.config.mapInfoConfiguration.infoFormat + }; + } default: return state; } diff --git a/web/client/selectors/__tests__/mapinfo-test.js b/web/client/selectors/__tests__/mapinfo-test.js index 1faab80105..f1b674619f 100644 --- a/web/client/selectors/__tests__/mapinfo-test.js +++ b/web/client/selectors/__tests__/mapinfo-test.js @@ -8,7 +8,14 @@ const expect = require('expect'); -const {mapInfoRequestsSelector, generalInfoFormatSelector, stopGetFeatureInfoSelector, isMapInfoOpen} = require('../mapinfo'); +const { + mapInfoRequestsSelector, + generalInfoFormatSelector, + stopGetFeatureInfoSelector, + isMapInfoOpen, + mapInfoConfigurationSelector, + showEmptyMessageGFISelector +} = require('../mapinfo'); describe('Test mapinfo selectors', () => { it('test generalInfoFormatSelector default value', () => { @@ -109,5 +116,30 @@ describe('Test mapinfo selectors', () => { }); expect(props).toEqual(true); }); + it('test mapInfoConfigurationSelector', () => { + const infoFormat = "text/html"; + const showEmptyMessageGFI = true; + const props = mapInfoConfigurationSelector({ + mapInfo: { + configuration: { + infoFormat, + showEmptyMessageGFI + } + } + }); + expect(props.infoFormat).toEqual(infoFormat); + expect(props.showEmptyMessageGFI).toEqual(showEmptyMessageGFI); + }); + it('test showEmptyMessageGFISelector', () => { + const showEmptyMessageGFI = true; + const props = showEmptyMessageGFISelector({ + mapInfo: { + configuration: { + showEmptyMessageGFI + } + } + }); + expect(props).toEqual(showEmptyMessageGFI); + }); }); diff --git a/web/client/selectors/mapinfo.js b/web/client/selectors/mapinfo.js index 48bce3cb5d..e3eb5327a1 100644 --- a/web/client/selectors/mapinfo.js +++ b/web/client/selectors/mapinfo.js @@ -37,6 +37,9 @@ const isMapInfoOpen = state => !!mapInfoRequestsSelector(state) && mapInfoReques */ const generalInfoFormatSelector = (state) => get(state, "mapInfo.infoFormat", "text/plain"); +const showEmptyMessageGFISelector = (state) => get(state, "mapInfo.configuration.showEmptyMessageGFI", true); // verify if we need to remove this default in austrocontrol +const mapInfoConfigurationSelector = (state) => get(state, "mapInfo.configuration", {}); + const measureActiveSelector = (state) => get(state, "measurement.lineMeasureEnabled") || get(state, "measurement.areaMeasureEnabled") || get(state, "measurement.bearingMeasureEnabled"); const drawSupportActiveSelector = (state) => { const drawStatus = get(state, "draw.drawStatus", false); @@ -73,5 +76,7 @@ module.exports = { isMapInfoOpen, generalInfoFormatSelector, mapInfoRequestsSelector, - stopGetFeatureInfoSelector + stopGetFeatureInfoSelector, + showEmptyMessageGFISelector, + mapInfoConfigurationSelector }; diff --git a/web/client/utils/MapUtils.js b/web/client/utils/MapUtils.js index 51a592ac65..6a4f5ab9ca 100644 --- a/web/client/utils/MapUtils.js +++ b/web/client/utils/MapUtils.js @@ -328,7 +328,7 @@ const extractTileMatrixSetFromLayers = (sourcesFromLayers, sources = {}) => { }, assign({}, sources)) || sources; }; -function saveMapConfiguration(currentMap, currentLayers, currentGroups, textSearchConfig, additionalOptions) { +function saveMapConfiguration(currentMap, currentLayers, currentGroups, textSearchConfig, additionalOptions, mapInfoConfiguration) { const map = { center: currentMap.center, @@ -371,7 +371,7 @@ function saveMapConfiguration(currentMap, currentLayers, currentGroups, textSear version: 2, // layers are defined inside the map object map: assign({}, map, {layers: formattedLayers, groups, text_serch_config: textSearchConfig}, !isEmpty(sources) && {sources} || {}), - ...additionalOptions + ...additionalOptions, mapInfoConfiguration }; } diff --git a/web/client/utils/__tests__/MapUtils-test.js b/web/client/utils/__tests__/MapUtils-test.js index 3d38353d5a..64abc81a86 100644 --- a/web/client/utils/__tests__/MapUtils-test.js +++ b/web/client/utils/__tests__/MapUtils-test.js @@ -428,6 +428,7 @@ describe('Test the MapUtils', () => { units: 'm', zoom: 10 }, + mapInfoConfiguration: undefined, version: 2 }); }); @@ -702,6 +703,7 @@ describe('Test the MapUtils', () => { units: 'm', zoom: 10 }, + mapInfoConfiguration: undefined, version: 2 }); }); @@ -955,10 +957,143 @@ describe('Test the MapUtils', () => { } } }, + mapInfoConfiguration: undefined, + version: 2 + }); + }); + it('save map configuration with tile matrix and map info configuration', () => { + const flat = [ + { + allowedSRS: {}, + bbox: {}, + description: undefined, + dimensions: [], + id: "layer001", + loading: true, + name: "layer001", + params: {}, + search: {}, + singleTile: false, + title: "layer001", + type: "wms", + url: "http:url001", + visibility: true, + catalogURL: "url", + matrixIds: { + 'EPSG:4326': [{ + identifier: 'EPSG:4326:0' + }] + }, + tileMatrixSet: [{ + TileMatrix: [{ + 'ows:Identifier': 'EPSG:4326:0' + }], + 'ows:Identifier': "EPSG:4326", + 'ows:SupportedCRS': "urn:ogc:def:crs:EPSG::4326" + }, { + TileMatrix: [{ + 'ows:Identifier': 'custom:0' + }], + 'ows:Identifier': "custom", + 'ows:SupportedCRS': "urn:ogc:def:crs:EPSG::900913" + }] + } + ]; + const groups = [ + {expanded: true, id: 'Default', name: 'Default', title: 'Default', nodes: ['layer001', 'layer002']}, + {expanded: false, id: 'custom', name: 'custom', title: 'custom', + nodes: [{expanded: true, id: 'custom.nested001', name: 'nested001', title: 'nested001', nodes: ['layer003']} + ]} + ]; + const mapConfig = { + center: {x: 0, y: 0, crs: 'EPSG:4326'}, + maxExtent: [-20037508.34, -20037508.34, 20037508.34, 20037508.34], + projection: 'EPSG:900913', + units: 'm', + zoom: 10 + }; + const saved = saveMapConfiguration(mapConfig, flat, groups, '', {}, {infoFormat: "text/html", showEmptyMessageGFI: false}); + expect(saved).toEqual({ + map: { + center: {crs: 'EPSG:4326', x: 0, y: 0}, + groups: [{ + id: 'Default', + expanded: true + }, { + id: 'custom', + expanded: false + }, { + id: 'custom.nested001', + expanded: true + }], + layers: [{ + allowedSRS: {}, + thumbURL: undefined, + availableStyles: undefined, + bbox: {}, + capabilitiesURL: undefined, + description: undefined, + dimensions: [], + nativeCrs: undefined, + features: undefined, + featureInfo: undefined, + format: undefined, + group: undefined, + hideLoading: false, + handleClickOnLayer: false, + id: "layer001", + matrixIds: ['EPSG:4326'], + maxZoom: undefined, + maxNativeZoom: undefined, + name: "layer001", + opacity: undefined, + params: {}, + provider: undefined, + search: {}, + singleTile: false, + source: undefined, + style: undefined, + styleName: undefined, + styles: undefined, + tileMatrixSet: true, + tiled: undefined, + title: "layer001", + transparent: undefined, + type: "wms", + url: "http:url001", + visibility: true, + catalogURL: "url", + hidden: false, + useForElevation: false, + origin: undefined, + thematic: undefined + }], + mapOptions: {}, + maxExtent: [-20037508.34, -20037508.34, 20037508.34, 20037508.34], + projection: 'EPSG:900913', + text_serch_config: '', + units: 'm', + zoom: 10, + sources: { + 'http:url001': { + tileMatrixSet: { + 'EPSG:4326': { + TileMatrix: [{ + 'ows:Identifier': 'EPSG:4326:0' + }], + 'ows:Identifier': "EPSG:4326", + 'ows:SupportedCRS': "urn:ogc:def:crs:EPSG::4326" + } + } + } + } + }, mapInfoConfiguration: { + infoFormat: "text/html", + showEmptyMessageGFI: false + }, version: 2 }); }); - it('extract TileMatrixSet from layers without sources and grouped layers', () => { expect(extractTileMatrixSetFromLayers()).toEqual({}); });