-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Hack for power users to deal with transform scale #9014
Conversation
I'm not familiar with Flow, if someone could help to fix type issue |
Am I correct that this is not a self-contained solution but exposes some hooks that allow for the users to implement a hack in their client? I think we'd rather have self-contained solutions to these issues in GL JS. The print feature on your site is impressive but I don't think this is the way we'd want to go in the library. |
You're right, I'll check how usage could be enhanced.. 👍 |
Updates from master repository
update from master
Update from master
update from master
I looked into this a bit. I think this pull request conflates two things:
I worked on an alternative fix for the former in #9057. It works for scaled maps without additional code in the surrounding page (i.e. it doesn't use the custom The latter is ticketed in #1953. The problem with |
I know that this is very old thread, but I can't force higher @pakastin Can you maybe help me with that, and give more information how you handled this in your application that this started to working properly? Or maybe it's not possible without your changes in this PR? Because I just imported the import browser from 'mapbox-gl/src/util/browser'; and now I'm thinking if I even changing same object that |
This is more for power users, but if you show map inside scaled element (transform: scale), mouse events won't work. It was also impossible to change map rendering pixel ratio. To get round with the issue, I did following things:
window.devicePixelRatio
tobrowser.devicePixelRatio
browser
inindex.js
to make it possible to change the getter_scaleRatio
to canvas container to make it possible to fix scale issueSo when there's
transform: scale
applied, I do following:devicePixelRatio
getter tricks map to render in lower pixel densityYou can see the working version here when you click the printing button. It'll scale map to fit A4 portrait and landscape paper sizes. Also before exporting image, it'll use higher pixel density.
Launch Checklist