Skip to content

Positron style boundary_3 filter logs runtime error when admin_level is null #107

@tordans

Description

@tordans

Hi! We’re using the OpenFreeMap Positron style as our MapLibre basemap:

https://tiles.openfreemap.org/styles/positron

We consistently see this browser console error:

Expected value to be of type number, but found null instead.

Context

Suspected cause

The style layer boundary_3 appears to do numeric comparisons on admin_level:

  • >= admin_level 3
  • <= admin_level 6

Some features seem to have admin_level: null, which triggers the runtime expression type warning.

Expected behavior

No expression type errors in console when rendering the style.

Workaround on our side

We suppress the error by replacing the filter with a null-safe variant that first checks type:

  • ['==', ['typeof', ['get', 'admin_level']], 'number']
  • then the numeric comparisons.

Could the style be updated to guard admin_level before numeric comparisons in boundary_3?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions