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

Sprite / hatching orientation when the map bearing is changed #995

Open
fxi opened this issue May 30, 2024 · 0 comments
Open

Sprite / hatching orientation when the map bearing is changed #995

fxi opened this issue May 30, 2024 · 0 comments

Comments

@fxi
Copy link
Member

fxi commented May 30, 2024

Currently, when rotating the map, the rule’s hatching is not oriented correctly, leading to incorrect readings. A solution would be to update a CSS variable --mx_map_rotation to align the hatching properly with the map’s rotation.

map.on('rotate', () => {
    const bearing = map.getBearing();
    document.body.style.setProperty('--mx_map_rotation', `${bearing}deg`);
});
.mx-legend-vt-rule-background {
    transform: rotate(var(--mx_map_rotation));
}
mx_sync_sprites_rules.mp4
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

1 participant