Skip to content

Swipe and sync between two maps #404

@kylebarron

Description

@kylebarron

It would be cool to have a way to do "map comparisons" from Python. This would be along the lines of mapbox-gl-compare:

On the JS side, this would take a bit of work. Primarily, I have to figure out how to:

  • render two map views, either side by side or possibly above and below
  • sync the view state between them
  • render a basemap in both

I did a little test:

      <DeckGL
        views={[
          new MapView({
            id: "left",
            width: "50%",
            controller: true,
          }),
          new MapView({
            id: "right",
            x: "50%",
            width: "50%",
            controller: true,
          }),
        ]}
image

It's nice that the deck.gl part is working, but not sure how to get the basemap to render in both.

On the Python side, the easiest way to do this would probably be to have a new SplitMap class that manages two sets of layers.

See also:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions