maplibre / maplibre/maputnik

Valid style JSON causes infinite loading

Open
#786 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
TypeScript
Stars
2.6k
Forks
477
Avg merge
6h 13m
Merged PRs (30d)
75

Description

Maputnik version: > 1.6.1
Browser: > Chrome
OS: macOS

Description of the bug:

Steps to reproduce the behavior:

  1. Have a style with a layer definition like this:
{
  "id": "water_lines_labels",
  "type": "symbol",
  "source": "osm",
  "source-layer": "water_lines",
  "minzoom": 14,
  "maxzoom": 24,
  "layout": {
    "visibility": "visible",
    "text-field": "{name}",
    "symbol-placement": "line",
    "text-pitch-alignment": "auto",
    "text-rotation-alignment": "auto",
    "text-size": 11,
    "text-anchor": "bottom",
    "text-letter-spacing": 0,
    "text-font": [
      "Backpack Regular",
      "Arial Unicode"
    ]
  },
  "paint": {
    "text-color": "rgba(255, 255, 255, 1)",
    "text-halo-color": "rgba(116, 207, 240, 1)",
    "text-halo-width": 1
  },
  "symbol-spacing": 500, 
  "text-anchor": "bottom"
}

  1. Upon trying to load this style, the editor enters an infinite loop of HTTP requests and never stops. No error message or console output is displayed.
  2. The error seems to be caused by symbol-spacing and text-anchor properties being in the root of the layer (which is malformed)

I had to binary-search by hand my style file to find it, so I hope this helps someone.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Reproduce the issue with the supplied style, then trace the style-loading and validation entry points while watching the repeated HTTP requests. Done means malformed root-level properties produce a clear error or terminate loading instead of causing an infinite request loop, with a regression test if the project’s existing test structure supports it.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.