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

[layer-leaflet/maplibre] Fixing container resizing #1487

Merged
merged 4 commits into from
Nov 19, 2024

Conversation

sim51
Copy link
Collaborator

@sim51 sim51 commented Nov 19, 2024

Description

When the container height/width changed (programmatically, ie not a resize event), the map layer was not updated or badly.
A "Change width" button has been added on the map layer stories to reproduce the issue.

Changes

Sigma

  • Adding the function createLayer function to allow to specify the HTML tag we want to create
  • Emitting the sigma resize event when the resize is applied

layer-leaflet & layer-maplibre

  • using the createLayer function to create the div map container
  • on leaflet, invalidate the map size in the resize function

Adding the function `createLayer`wich is a refacto of the
`createCanvas` on which we can specify the html tag.
The `createCanvas` functionality stays unchanged.
The resize event is now emitted when the new size has been applied.
When the container height/width changed (programmatically, ie not a resize event), the map layer was not updated or badly.
By creating the map's container via the sigma API and by invalidate the
map's size, the issue is fixed.
@jacomyal jacomyal merged commit 15b6887 into main Nov 19, 2024
2 checks passed
@jacomyal jacomyal deleted the bsi/resizing-with-map-layer branch November 25, 2024 10:01
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

Successfully merging this pull request may close these issues.

2 participants