-
Notifications
You must be signed in to change notification settings - Fork 55
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
Icons rescaled after print #1476
Comments
Had a go at it but I am probably destroying something since it was written a bit more complicated from the beginning: |
Acknowledged. I'm not sure I've seen the scale property of an icon style before, but you are right, things are scaled back to 100% after a print preview exit. My print-test-mega-map hit a snag on the above commit; I'll have a look at it and how it was before on the morrow. The scale property needs to be taken into account if the longer way, or what causes the snag needs to be worked around if the shorter. |
I have been unable to make your initial suggestion do what I think is intended, my current thought is that the (original) style scale can be fetched from the viewer and then loop through every feature and update as is currently done (but with the original scale number instead of 1). (A stray thought was a kind of memory at SetLayerScale() but it may not be necessary). I hope to be able to spend some more time with this next week. |
This seems to work for icons using a scale param in their style (this issue) if (isVector(layer)) {
const styleName = layer.get('styleName');
const styles = viewer.getStyle(styleName);
if (styleName && styles && styles.length === 1) {
const newStyle = Style.createStyle({
style: styleName,
viewer
})();
if (newStyle) {
source.getFeatures().forEach(feature => {
feature.setStyle(newStyle);
});
}
}
} however it is as much responsible for the related issue as the current setLayerScale function (entering the print preview) |
The alternate solution for this issue and resetLayerScale() needed the selection-robbing setStyle() in setLayerScale() in order to not be selection-robbing, it turns out. I haven't been able to getStyle() of a feature prior to setStyle() on said feature, even if the feature logged seems to have a style_ property before setStyle(). There is a "selected" property of selected features however that I might be able to use. |
Describe the bug
When using scaled symbols in the map, the scale seems to be overlooked when re rendering the map after the print preview.
Eg:
Screenshots

Before print:
After:

Ideas on this @Grammostola ?
The text was updated successfully, but these errors were encountered: