Skip to content

Impossible to set height and width on icon #288

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

Closed
mwargan opened this issue Dec 17, 2023 · 1 comment
Closed

Impossible to set height and width on icon #288

mwargan opened this issue Dec 17, 2023 · 1 comment
Labels
Breaking Change bug Something isn't working

Comments

@mwargan
Copy link
Contributor

mwargan commented Dec 17, 2023

We can use height or width on our icons according to OSLayers, but for this, the scale needs to be undefined, otherwise it fails the assert. See https://github.com/openlayers/openlayers/blob/9fc75eb74eb6097ab9e7713b6e19f7fe0f3ac261/src/ol/style/Icon.js#L179

However, we cannot set undefined with :scale="undefined" because Vue will then just use the default, which is 1 in this case.

Proposal

Set undefined by default in the props (breaking change), or otherwise rework logic to support undefined as a passed value.

@d-koppenhagen d-koppenhagen added bug Something isn't working Breaking Change labels Dec 17, 2023
d-koppenhagen added a commit that referenced this issue Dec 17, 2023
…property

BREAKING CHANGE: **`ol-style-icon`**: the property `scale` has no longer a default of `1`. Please pass a value of one explicitly if needed. The change was needed since the underlying OpenLayers lib want's to either have a `scale` defined or  `width`/`height`. Before it wasn't possible to define an icon by `width`/`height` since the `scale` was set by default.

closes #288
@d-koppenhagen
Copy link
Collaborator

Fix is released on with v4.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Change bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants