Skip to content

mapox layers reordered after updating figure with Plotly.react #5266

Closed
@jonmmease

Description

@jonmmease

Overview

I would like to overlay a mapbox image layer on top of a mapbox raster layer and update the image layer's coordinates and/or source properties in response to zoom/pan events using Plotly.react

On initial render, everything works fine and the z-order of the two layers matches the order in the layout.mapbox.layers array. However, after updating the image layer's coordinates in a plotly_relayout callback, the image layer is pushed behind the raster layer.

Here's an example, where the opacity of the raster layer is set to 0.5 so that you can see the image behind it.

Codepen: https://codepen.io/jonmmease/pen/vYKvxwx?editors=1010

mapbox_layer_order

Unless anyone has an idea of what might be going on here, I'll start poking around in https://github.com/plotly/plotly.js/blob/master/src/plots/mapbox/layers.js.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions