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

How to set pitch #1614

Closed
musicformellons opened this issue Oct 12, 2015 · 1 comment
Closed

How to set pitch #1614

musicformellons opened this issue Oct 12, 2015 · 1 comment

Comments

@musicformellons
Copy link

In the API docs it says:
"Options common to Map#jumpTo, Map#easeTo, and Map#flyTo, controlling the destination location, zoom level, bearing and pitch."

I tried setting pitch from within flyTo but it does not work (it flies fine but without pitch). This is the code:

var isAtStart = true;

function fly() {
    // depending on whether we're currently at point a or b, aim for
    // point a or b
    var target = isAtStart ? end : start;

    // and now we're at the opposite point
    isAtStart = !isAtStart;

    map.flyTo({
        // These options control the ending camera position: centered at
        // the target, at zoom level 15, and north up.
        center: target,
        zoom: 19,
        bearing: 0,   // Map rotation bearing in degrees counter-clockwise from north
        pitch: 110, // Angle of cameraview

        // These options control the flight curve, making it move
        // slowly and zoom out almost completely before starting
        // to pan.
        speed: 0.9, // speed of flying
        curve: 1.1, // curve of zoom

        // This can be any easing function: it takes a number between
        // 0 and 1 and returns another number between 0 and 1.
        easing: function (t) {
            return t;
        }
    });
}

Furthermore, I set pitch and flyto up under a two separate clickable buttons and then both work (can fly with a pitch). When I run my pitchfunction without clicking it also works. However running in a script Pitch() and then flyTo(), it ignores Pitch() and starts flying without pitch.

@jfirebaugh
Copy link
Contributor

Thanks for the report. This appears to be a duplicate of #1429.

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