Skip to content

Support custom mapId in GeoJsonFolder config #142

@MisterGC

Description

@MisterGC

Problem

Currently, the GeoJsonFolder data source derives the mapId automatically from the folder path using mapNameFromUri(). This transformation:

  1. Converts to lowercase
  2. Replaces :, \, /, . with dashes
  3. Collapses consecutive dashes
  4. Removes -openapi-json suffix

For example, /home/user/geodata becomes -home-user-geodata.

Users cannot override this behavior to set a meaningful, custom mapId.

Proposed Solution

Add an optional mapId property to the GeoJsonFolder configuration schema. If provided, use it directly; otherwise, fall back to the current mapNameFromUri() derivation.

Example config:

dataSources:
  - type: GeoJsonFolder
    folder: /path/to/my/geodata
    mapId: my-custom-map  # optional
    withAttrLayers: true

Implementation

The GeoJsonSource constructor already supports an optional mapId parameter - it just needs to be wired through the config layer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DatasourcesThis issue concerns a specific mapget datasource implementation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions