-
Notifications
You must be signed in to change notification settings - Fork 86
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
Conversation
@@ -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) { |
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.
if opt_zoom
is not passed to the function, it will be undefined
not null
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.
And the @param
for opt_zoom
should be changed to:
@param {number=} opt_zoom Optional zoom level.
@@ -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') { |
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.
can be simplified to if (opt_zoom !== undefined) {
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.
+1
9c9a1a3
to
a12641b
Compare
travis fails (probably) because the branch is from your fork, not the camptocamp one |
Addresses @fredj feedback.