Skip to content

Image source is clipped to -180,180 when terrain is enabled. #4088

@Hooterr

Description

@Hooterr

maplibre-gl-js version: 4.2.0

browser: chrome (not important)

Steps to Trigger Behavior

  1. Add a style with terrain
  2. Add an image source that's outside -180,180 longitude
  3. Enable terrain

Link to Demonstration

https://jsbin.com/fiyisil/edit?html,output

const urlWms = "https://placehold.co/600x600/png";
const sourceName = "sourceName";
const wmsLayerName = "wms";
const imageCoordinates = [
    [-20, 60],
    [300, 60],
    [300, -60],
    [-20, -60]
];

map.addSource(sourceName, {
        'type': 'image',
        'url': urlWms,
        'coordinates': imageCoordinates
    });

map.addLayer({
    'id': wmsLayerName,
    'type': 'raster',
    'source': sourceName,
    "paint": {
        'raster-opacity': 0.33,
        'raster-fade-duration': 0
    }
});

Terrain on
image

Terrain off
image

Expected Behavior

Image wraps correctly when terrain is enabled.

Actual Behavior

Image seems to be clipped to -180,180 longitude
Also the opacity seems to be changing when terrain is enabled/disabled

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingneed more infoFurther information is requestedterrain💰 bounty MMedium Bounty, USD 250

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions