Skip to content

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

Merged
merged 2 commits into from
Feb 14, 2024
Merged

PB-266: Corrected KML icons size #641

merged 2 commits into from
Feb 14, 2024

Conversation

ltshb
Copy link
Contributor

@ltshb ltshb commented Feb 13, 2024

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

Copy link

cypress bot commented Feb 13, 2024

Passing run #588 ↗︎

0 175 21 0 Flakiness 0

Details:

PG-266: Improvement based on code review
Project: web-mapviewer Commit: 4666839f30
Status: Passed Duration: 04:14 💡
Started: Feb 14, 2024 2:13 PM Ended: Feb 14, 2024 2:18 PM

Review all test suite changes for PR #641 ↗︎

@ltshb ltshb force-pushed the feat-PB-266-icon-size branch 5 times, most recently from 3be761a to b685964 Compare February 13, 2024 07:43
@ltshb ltshb requested a review from pakb February 13, 2024 08:02
@ltshb ltshb force-pushed the feat-PB-266-icon-size branch 2 times, most recently from 1b2ec8d to b0a3d6a Compare February 13, 2024 10:43
@ltshb ltshb requested a review from ltkum February 13, 2024 11:41
@ltshb ltshb force-pushed the feat-PB-266-icon-size branch from b0a3d6a to c365fa8 Compare February 13, 2024 11:41
@ltshb ltshb requested a review from ismailsunni February 13, 2024 13:10
@ltshb ltshb force-pushed the feat-PB-266-icon-size branch from c365fa8 to 0d85eaa Compare February 13, 2024 14:12
@ltshb ltshb force-pushed the feat-PB-266-icon-size branch 4 times, most recently from d6a292b to 2ef6735 Compare February 14, 2024 08:09
* @returns {String} A full URL to this icon on the service-icons backend
*/
generateURL(iconSize = MEDIUM, iconColor = RED) {
generateURL(iconColor = RED, iconScale = 1) {
Copy link
Contributor

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...)

Copy link
Contributor Author

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.

// 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)
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point

@ltshb ltshb force-pushed the feat-PB-266-icon-size branch from 2ef6735 to febbeec Compare February 14, 2024 14:04
@ltshb ltshb requested a review from pakb February 14, 2024 14:11
@ltshb ltshb merged commit 5f20832 into develop Feb 14, 2024
@ltshb ltshb deleted the feat-PB-266-icon-size branch February 14, 2024 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants