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

Fix density/pixelratio #3

Closed
tobrun opened this issue Apr 25, 2018 · 6 comments
Closed

Fix density/pixelratio #3

tobrun opened this issue Apr 25, 2018 · 6 comments
Milestone

Comments

@tobrun
Copy link
Member

tobrun commented Apr 25, 2018

When running the project, it's noticable that labels are oversized:

ezgif com-video-to-gif 62

@tobrun tobrun added this to the v0.0.1 milestone Apr 25, 2018
@tobrun
Copy link
Member Author

tobrun commented Apr 25, 2018

When debugging I'm noticing a difference between width/height with flutter vs gl-native

  • w: 360 vs 1440.0
  • h: 612 vs 2448.0

If those values are used for h/w on flutter, the map is renders but the gestures do no correspond correctly

@seddonm1
Copy link
Contributor

Was this comment before or after your mapbox/mapbox-gl-native#11772 change?

Currently code will not compile as it is dependent on that change being implemented upstream.

FYI for anyone testing until that upstream change gets released just change:

    nativeMapView = new NativeMapView(context, 1, this, mapRenderer);
to:
    nativeMapView = new NativeMapView(context, this, mapRenderer);

@seddonm1
Copy link
Contributor

#17

do you think mapbox/mapbox-gl-native#11772 can be included into 6.1.0-snapshot?

@tobrun
Copy link
Member Author

tobrun commented Apr 26, 2018

Currently code will not compile as it is dependent on that change being implemented upstream.

You need to get a fresh copy of the SNAPSHOT dependency, you can do a gradle command as cleanBuildCache to do that.

do you think mapbox/mapbox-gl-native#11772 can be included into 6.1.0-snapshot?

once a PR is merged to a release branch, we automatically build a new snapshot.

@seddonm1
Copy link
Contributor

No worries. Ill quickly fix my PR

@tobrun
Copy link
Member Author

tobrun commented May 4, 2018

Finally got to the bottom of this: Flutter exposes 2 coordinate systems called local and global. You can convert between the two using box.globalToLocal and box.localToGlobal. These coordinate systems do not match what we expect on the map side (same input as on android), to support this we need to convert local to the expected pixel output using the device pixel ratio. This is needed when the map is created and when we receive inputs from the flutter framework (eg. gesture input). Due to limited flutter knowledge I'm going to punt on this for now, map renders at correct resolution and gestures work as expected.

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

No branches or pull requests

2 participants