Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Combination of padding and pitch lead to unexpected results #16490

Description

@rinigus

Platform: Linux, Qt 5.14
Mapbox SDK version: git master; d4af66e

Summary

When adding non-zero padding to the camera, there is interaction between zoom and pitch settings that is not expected (shown below). With zero pitch, zoom stays the same regardless of of the padding, as expected.

As it is shown below, effective pitch becomes larger than 60 degrees making the application slow and unresponsive.

This issue was not present in QMapboxGL incorporated into Qt as a location module.

In this application (Pure Maps), padding is used to push the center of the map towards button when the user is navigating. While just exploring, padding is set to small leading to the map center being in the center as well.

Steps to trigger behavior

  1. Set pitch to 60 degrees, select location, zoom (16 for example)
  2. Use smaller window, like 600 x 600 pixels
  3. Compare results without padding (padding 0) and padding with the center towards the bottom of the screen. In my case, padding was 450 from top, 29 from bottom, 30 from left and right.

Expected behavior

Despite padding, scale and pitch would be the same as in the map without padding.

Actual behavior

Results are dramatically different and it is not clear how to compensate for it.

Map without padding, zoom 16, pitch 60 degrees:

nopadding

Map with larger padding, zoom 16, pitch 60 degrees:

withpadding

Map with larger padding, zoom and pitch found to match map without padding:

To match the map without padding, I changed zoom and pitch in the map with padding. Result was zoom ~16.6 and pitch ~52 degrees

withpadding-matching

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    archivedArchived because of inactivity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions