-
Notifications
You must be signed in to change notification settings - Fork 15
PB-266: Corrected KML icons size #641
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
Conversation
Passing run #588 ↗︎Details:
Review all test suite changes for PR #641 ↗︎ |
3be761a
to
b685964
Compare
1b2ec8d
to
b0a3d6a
Compare
b0a3d6a
to
c365fa8
Compare
c365fa8
to
0d85eaa
Compare
d6a292b
to
2ef6735
Compare
* @returns {String} A full URL to this icon on the service-icons backend | ||
*/ | ||
generateURL(iconSize = MEDIUM, iconColor = RED) { | ||
generateURL(iconColor = RED, iconScale = 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not using a constant anymore? (SMALL, MEDIUM, etc...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the icon scale of MEDIUM, ... is the open layer scale and here I want to be sure to get the icon at its scale 1 by default and we always takes icon from backend at the same scale and let openlayer do the scaling.
src/utils/kmlUtils.js
Outdated
// scale_factor := iconStyle.getSize()[0] / 32 | ||
// iconStyle.getSize()[0] = 48 (always 48 pixel on old viewer) | ||
// scale_factor = 48/32 => 1.5 | ||
iconStyle.setScale(iconStyle.getScale() * 1.5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it might be good to move the constant ICON_XML_SCALE_FACTOR
declared in E2E test here, export it, and re-use it in the test too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point
2ef6735
to
febbeec
Compare
Now the KML icon size and text size is retro compatible with the old kml adding a new
extra large
size.The icon scaling is a bit tricky due to a factor to normalize icons to 32 pixel introduced by open layer in version 6.7 (old viewer used an older openlayer version, see openlayers/openlayers#12695).
Relates to #628
Test link