-
Notifications
You must be signed in to change notification settings - Fork 280
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
Pixelorigin #424
Pixelorigin #424
Conversation
@jywarren @rexagod here is an explanation of this one because its a little tricky - the typical Since we overrode this method, instead we get a result like the one shown in #402: To fix this I update which came out like this: for (var k in latlngObj) {
if ((zoom === 0 && (map.project(latlngObj[k]).y < 2 || map.project(latlngObj[k]).y >= 255)) ||
(zoom !== 0 && (map.project(latlngObj[k]).y / zoom < 2 || map.project(latlngObj[k]).y / Math.pow(2, zoom) >= 255))
) {
// calling reset / update w/ the same corners bc it prevents a marker flicker for rotate
this.setBounds(L.latLngBounds(this.getCorners()));
this.fire('update');
return;
}
} 2 is for the top, 255 is for the bottom. Made it less than 256 because 256 would trigger the distortions. |
let me know your thoughts and ill make corresponding doc updates if you like it! |
@jywarren were u ok with this solution? |
0a9e963
to
1e81bc0
Compare
@jywarren merging here first because its already ready. |
Fixes #402 (<=== Add issue number here)
Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!
grunt
If tests do fail, click on the red
X
to learn why by reading the logs.Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software
Thanks!
=======
changes:
setBounds
calls_reset
, so we no longer use that method ourselves.setCorners()
as well, also mentioned as useful in Implementgroup mapknitter#9590.7.8
pending:
=======