Skip to content

Commit

Permalink
fix: add layer name workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
jenniferarnesen committed Nov 6, 2023
1 parent 54bd94c commit 7290228
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/loaders/externalLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const externalLoader = async (layer) => {
return {
...layer,
layer: EXTERNAL_LAYER,
name: config.name,
name: config.name, // TODO - will be fixed by DHIS2-16088
legend,
config,
isLoaded: true,
Expand Down
2 changes: 1 addition & 1 deletion src/loaders/geoJsonUrlLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const geoJsonUrlLoader = async (layer) => {

return {
...layer,
name,
name: newConfig.name, // TODO - will be fixed by DHIS2-16088
legend,
data: geoJson?.features,
config: newConfig,
Expand Down
9 changes: 2 additions & 7 deletions src/util/external.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ const MAP_SERVICE_XYZ = 'XYZ'
const MAP_SERVICE_VECTOR_STYLE = 'VECTOR_STYLE'
const MAP_SERVICE_GEOJSON_URL = 'GEOJSON_URL'

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 All @@ -29,6 +22,8 @@ const mapServiceToTypeMap = {
[MAP_SERVICE_GEOJSON_URL]: GEOJSON_LAYER,
}

export const supportedMapServices = Object.keys(mapServiceToTypeMap)

// Create external layer from a model
export const createExternalLayer = (model, forBasemap) => ({
layer:
Expand Down

0 comments on commit 7290228

Please sign in to comment.