-
-
Notifications
You must be signed in to change notification settings - Fork 754
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
Add Marker's "opacity" option and "setOpacity" method #3620
Conversation
Why not split this into two fields? |
Also, these values should really be numbers instead of strings. |
In theory, opacity can be 50% instead of 0.5, but I agree, a number would be better from an API perspective. |
19a2978
to
9453c24
Compare
Now setOpacity accepts 2 numbers. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #3620 +/- ##
==========================================
- Coverage 87.42% 87.01% -0.41%
==========================================
Files 240 240
Lines 32189 32212 +23
Branches 2067 2253 +186
==========================================
- Hits 28140 28030 -110
- Misses 3139 3242 +103
- Partials 910 940 +30 ☔ View full report in Codecov by Sentry. |
Can you also merge from main branch? |
9453c24
to
2da1f26
Compare
Done. Merged from main. After that npx jest stopped working for me locally. (I use it because the doc suggests using it to run individual tests). |
Yes, it's due to the new reported I added. |
Can you update the build test with the extra size? |
@sbachinin first and foremost thanks for all the work and the review changes, I know I can by annoying sometimes... CC: @cenfun |
Seems to be a problem with my test. In all test cases marker "is invisible" though I expected it to be visible in one case. |
Ok, great! This means that the report is working as expected and found a place that is not covered! Yay! |
@HarelM I'm glad to know this. |
In order to make this line fully covered, I need a very delicate scenario when the marker's base is invisible but its center is visible. I'm not sure if it makes sense to test this. |
I'll merge this as this feature wasn't introduced by you. @SnailBones can you please open a PR with a test that covers this scenario? |
@HarelM I don't think this is possible with a unit test, since AFAIK we don't have a way to set real terrain in unit tests. Maybe a browser test could work? |
I believe you can mock what you need, can't you? |
If you don't mind I have an idea how to cover the case of semi-visible marker. |
Looks fine to me, you mock what you need to cover this use case. |
Implements #3458
A small caveat here.
This solution means that all users have to provide an array of 2 strings. (2nd string is the reduced opacity when marker is behind the terrain).
But in most cases (without 3d terrain) this second string will be useless and just an incovenience.
Perhaps it makes sense to split this single option and method to:
'opacity/setOpacity' and 'reducedOpacity/setReducedOpacity'