Skip to content

Commit

Permalink
fix: do not show geojson or arcgis layers since they are not supporte…
Browse files Browse the repository at this point in the history
…d yet
  • Loading branch information
jenniferarnesen committed Nov 3, 2023
1 parent de92d37 commit 7058a7a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/util/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
DEFAULT_SYSTEM_SETTINGS,
SYSTEM_SETTINGS,
} from '../constants/settings.js'
import { createExternalLayer } from './external.js'
import { createExternalLayer, supportedMapServices } from './external.js'
import { getDefaultLayerTypes } from './getDefaultLayerTypes.js'
import { getHiddenPeriods } from './periods.js'
import { fetchExternalLayersQuery } from './requests.js'
Expand All @@ -29,6 +29,7 @@ export const appQueries = {
const getBasemapList = (externalMapLayers, systemSettings) => {
const externalBasemaps = externalMapLayers
.filter((layer) => layer.mapLayerPosition === 'BASEMAP')
.filter((layer) => supportedMapServices.includes(layer.mapService))
.map(createExternalLayer)
.filter((basemap) => layerTypes.includes(basemap.config.type))

Expand All @@ -51,6 +52,7 @@ const getBasemapList = (externalMapLayers, systemSettings) => {
const getLayerTypes = (externalMapLayers) => {
const externalLayerTypes = externalMapLayers
.filter((layer) => layer.mapLayerPosition !== 'BASEMAP')
.filter((layer) => supportedMapServices.includes(layer.mapService))
.map(createExternalLayer)

return getDefaultLayerTypes().concat(externalLayerTypes)
Expand Down
7 changes: 7 additions & 0 deletions src/util/external.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ const MAP_SERVICE_TMS = 'TMS'
const MAP_SERVICE_XYZ = 'XYZ'
const MAP_SERVICE_VECTOR_STYLE = 'VECTOR_STYLE'

export const supportedMapServices = [
MAP_SERVICE_WMS,
MAP_SERVICE_TMS,
MAP_SERVICE_XYZ,
MAP_SERVICE_VECTOR_STYLE,
]

const mapServiceToTypeMap = {
[MAP_SERVICE_WMS]: WMS_LAYER,
[MAP_SERVICE_XYZ]: TILE_LAYER,
Expand Down

0 comments on commit 7058a7a

Please sign in to comment.