Skip to content

Map onClick lngLat returns longitude out of WGS84 range on lower zoom levels #6740

@kudlav

Description

@kudlav

maplibre-gl-js version: 5.13.0

browser: Firefox 145.0

Steps to Trigger Behavior

  1. Visit https://jsfiddle.net/16xfdcpy/8/
  2. Click on the left half of the map
  3. map.on click returns lng < -180 (e.g. -218.3398437500004)
  4. Zoom the map from the zoom level 2 to the zoom level 3
  5. Click on the same place
  6. map.on click returns lng within +-180 (e.g. 137.96875000000017)

Link to Demonstration

https://jsfiddle.net/16xfdcpy/8/

Expected Behavior

The event should return lngLat within the WGS84 +-180 range.
The event should return the same lngLat for all zoom levels.

Actual Behavior

lngLat returns invalid values on zoom levels 0-2. Works as expected on zoom levels 3+.
Maybe related to: #6701

20251119-1313-58.0784855.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    need more infoFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions