Skip to content

Implement isStyle validation instead of always returning true #89

@tmshv

Description

@tmshv

Problem

src/store/effects/add-file.ts:8-11 has a stub function that accepts any object as a valid MapLibre style:

function isStyle(value: object): boolean {
    // TODO check the value is real maplibre style
    return true
}

This means any JSON file will be treated as a valid map style, causing confusing runtime errors when the invalid style is applied.

What needs to change

Implement basic validation — at minimum check for required MapLibre style spec fields like version, sources, and layers. The MapLibre style spec defines the expected structure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions