Skip to content
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

search parameter/map_zoom: Test for null to allow 0 as value #3003

Merged
merged 3 commits into from
Oct 19, 2017

Conversation

pfirpfel
Copy link
Contributor

Addresses @fredj feedback.

@pfirpfel pfirpfel self-assigned this Oct 18, 2017
@pfirpfel pfirpfel requested a review from fredj October 18, 2017 09:45
@@ -965,7 +965,7 @@ gmf.SearchController.prototype.fulltextsearch_ = function(query, resultIndex, op
const feature = format.readFeature(data.features[resultIndex - 1]);
this.featureOverlay_.addFeature(feature);
const fitOptions = /** @type {olx.view.FitOptions} */ ({});
if (opt_zoom) {
if (opt_zoom !== null) {
Copy link
Member

Choose a reason for hiding this comment

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

if opt_zoom is not passed to the function, it will be undefined not null

Copy link
Member

Choose a reason for hiding this comment

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

And the @param for opt_zoom should be changed to:

@param {number=} opt_zoom Optional zoom level.

See https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler#optional-parameter-in-a-param-annotation

@@ -965,7 +965,7 @@ gmf.SearchController.prototype.fulltextsearch_ = function(query, resultIndex, op
const feature = format.readFeature(data.features[resultIndex - 1]);
this.featureOverlay_.addFeature(feature);
const fitOptions = /** @type {olx.view.FitOptions} */ ({});
if (opt_zoom) {
if (typeof opt_zoom !== 'undefined') {
Copy link
Member

Choose a reason for hiding this comment

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

can be simplified to if (opt_zoom !== undefined) {

Copy link
Member

Choose a reason for hiding this comment

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

+1

@fredj
Copy link
Member

fredj commented Oct 19, 2017

travis fails (probably) because the branch is from your fork, not the camptocamp one

@fredj fredj merged commit 69c012d into camptocamp:master Oct 19, 2017
@pfirpfel pfirpfel deleted the fix-search-param-zoom branch October 20, 2017 06:59
@sbrunner sbrunner added this to the 2.3 milestone Apr 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants