Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

HARP-13493: Make maxZoomLevel value in technique non inclusive #2016

Merged
merged 1 commit into from
Jan 11, 2021

Conversation

germanz
Copy link
Contributor

@germanz germanz commented Dec 16, 2020

Signed-off-by: German Zargaryan german.zargaryan@here.com

Thank you for contributing to harp.gl!

Before requesting a pull request, please remember to check the following documents:

If you are adding new functionality we would highly appreciate if you can describe what is the capability you are adding and even better if you can add some examples. Please also remember to add tests for it.

CI Check

Our bots will check whether your PR can be directly integrated into the mainline. We have some internal integration tests running on the background, our bots will inform you of the next steps and someone from our team will take a look and help if needed!

And please do not forget to sign-off your commit! You can read more about DCO here. But, in short, you just need to use git commit -s or append --signoff when you are committing to the repo.

Happy contributing!

@codecov
Copy link

codecov bot commented Dec 16, 2020

Codecov Report

Merging #2016 (0601d3b) into master (30f41eb) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2016      +/-   ##
==========================================
+ Coverage   66.56%   66.58%   +0.01%     
==========================================
  Files         297      297              
  Lines       26341    26342       +1     
  Branches     5944     5945       +1     
==========================================
+ Hits        17535    17539       +4     
+ Misses       8806     8803       -3     
Impacted Files Coverage Δ
...re/harp-datasource-protocol/lib/TechniqueParams.ts 72.13% <ø> (ø)
.../harp-datasource-protocol/lib/StyleSetEvaluator.ts 89.05% <100.00%> (ø)
@here/harp-mapview/lib/TileObjectsRenderer.ts 44.20% <100.00%> (ø)
@here/harp-mapview/lib/text/Placement.ts 88.37% <100.00%> (+1.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 30f41eb...0601d3b. Read the comment docs.

@@ -693,7 +693,7 @@ export class StyleSetEvaluator {
}
}

if (typeof maxZoomLevel === "number" && zoomLevel > maxZoomLevel) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to document this change in BaseTechniqueParams in @here/harp-datasource-protocol/lib/TechniqueParams.ts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Collaborator

@atomicsulfate atomicsulfate left a comment

Choose a reason for hiding this comment

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

Please document the behaviour change as part of the next release notes:
https://github.com/heremaps/harp.gl/releases/

There's not draft of next release (0.22) so you can create a new one. Just follow the same format as the previous releases. Once done click on "Save draft", not on "Publish release".

atomicsulfate
atomicsulfate previously approved these changes Dec 16, 2020
@nzjony
Copy link
Member

nzjony commented Jan 5, 2021

I agree with the idea of making it non-inclusive, however the naming is unfortunate, the max in maxZoomLevel is short for "maximum", which (according to google), means: "the greatest amount, extent, or intensity possible, permitted, or recorded.", i.e. the maximum always refers to an attainable value, however this changes breaks this concept.

I think a better name could be start beginZoomLevel and limitZoomLevel, where "limit" is (at least in mathematics) clear that it is a value that we get close to, but don't reach.

@atomicsulfate , @germanz , please reconsider.

@germanz
Copy link
Contributor Author

germanz commented Jan 8, 2021

retest this please

Signed-off-by: German Zargaryan <german.zargaryan@here.com>
@germanz
Copy link
Contributor Author

germanz commented Jan 8, 2021

@nzjony I agree with you about the definition of the term. However, I think it is better to keep it simple and document the range [minZoomLevel, maxZoomLevel) so that the upper edge is not reachable.

It will be unfortunate to break the compatibility by renaming the property or introducing another one and cause confusion. Other Map rendering APIs also use the same terms.

@@ -264,7 +264,7 @@ export interface BaseTechniqueParams {
minZoomLevel?: DynamicProperty<number>;

/**
* Maximum zoom level. If the current zoom level is larger, the technique will not be used.
* Maximum zoom level. If the current zoom level is equal to or greater, the technique will not be used.
Copy link
Member

Choose a reason for hiding this comment

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

You may want to check with our Design team before going forward with this change of semantics.

Copy link
Member

Choose a reason for hiding this comment

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

Also, shouldn't you update the semantics of all the zoom/data level constraints? e.g. DataSource.maxDisplayLevel, DataSource.maxDataLevel, MapView.maxZoomLevel, MapControls.maxZoomLevel?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As agreed for the time being we leave the semantic of those properties as-is, both edges inclusive.

@germanz germanz merged commit 9d2b004 into master Jan 11, 2021
@germanz germanz deleted the HARP-13493 branch January 11, 2021 12:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants