Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View State Transitions in v8 aren't working #4305

Closed
jameswesc opened this issue Feb 24, 2020 · 2 comments
Closed

View State Transitions in v8 aren't working #4305

jameswesc opened this issue Feb 24, 2020 · 2 comments

Comments

@jameswesc
Copy link

jameswesc commented Feb 24, 2020

Description

View State Transitions in v8 aren't working

Repro Steps

The example for view state transitions in this repo shows the issue. Link here

Environment (please complete the following information):

  • Framework Version: ^8.0.0

I'm using some of the binary data features that came with v8 and I'd really like to do some view state transitions working. I've been using deck with Svelte and Mapbox. The example linked above shows no movement on transitions.

I tried recreating the above example using Svelte & Mapbox. Using the code below I can get the map to transition, but the Scatterplot layer does not transition with the base map, and interaction is locked to the final position after the transition.

  // This is called on set up
 onMount(() => {
        map = new mapboxgl.Map({
           // Setup Mapbox
        })

        deck = new Deck({
            canvas,
            width: "100%",
            height: "100%",
            controller: true,
            initialViewState: INITIAL_VIEW_STATE,
            onViewStateChange: ({ viewState }) => {
                map.jumpTo({
                    center: [viewState.longitude, viewState.latitude],
                    zoom: viewState.zoom,
                    bearing: viewState.bearing,
                    pitch: viewState.pitch
                })
            },
            layers: [
                new ScatterplotLayer({
                    data: CITIES,
                    getPosition: d => [d.longitude, d.latitude],
                    getColor: [255, 180, 0],
                    radiusMinPixels: 10
                })
            ]
        })

    })
    
    // This is called when a user selects a particular city
    function jump(city) {
        return () =>
            deck.setProps({
                viewState: {
                    latitude: city.latitude,
                    longitude: city.longitude,
                    zoom: 10,
                    onTransitionInterruption: TRANSITION_EVENTS.BREAK,
                    transitionDuration: 3000,
                    transitionInterpolator: new FlyToInterpolator()
                },
                layers: [
                    new ScatterplotLayer({
                        data: CITIES,
                        getPosition: d => [d.longitude, d.latitude],
                        getColor: [255, 180, 0],
                        radiusMinPixels: 10
                    })
                ]
            })
    }

I can share a repo if that's preferred, but a working example would probably be more useful for others.

@Pessimistress
Copy link
Collaborator

See #4075

@jameswesc
Copy link
Author

:/ I didn't do a good enough job searching for old issues. Sorted it out from that.

Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants