Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function createCloudOptimizedGeoTIFFLayer(parsedLayer: Partial<Layer>): CloudOpt
* one, returns null if this external layer can't be "reloaded" from URL (i.e. KML/GPX added
* through local file) or will return the untouched ActiveLayerConfig for other layer types
*/
export function createLayerObject(parsedLayer: Partial<Layer>, currentLayer: Layer) {
export function createLayerObject(parsedLayer: Partial<Layer>, currentLayer?: Layer) {
const { year, updateDelay, features, adminId, ...customAttributes } =
parsedLayer.customAttributes ?? {}

Expand Down Expand Up @@ -252,10 +252,6 @@ function dispatchLayersFromUrlIntoStore(
const currentLayer =
layerAtIndex?.id === parsedLayer.id ? layerAtIndex : matchingLayerInConfig

if (!currentLayer) {
return
}

const { layer: layerObject, featuresRequests: layerFeatureRequests } =
createLayerObject(parsedLayer, currentLayer)

Expand Down Expand Up @@ -359,7 +355,7 @@ function generateLayerUrlParamFromStoreValues(): string {
.map((layer: Layer) =>
transformLayerIntoUrlString(
layer,
layersStore.config.find((config: Layer) => config.id === layer.id),
layersStore.config.find((layerConfig: GeoAdminLayer) => layerConfig.id === layer.id),
featuresIds[layer.id]
)
)
Expand Down
Loading