Repository navigation
Pass flyTo options to map upon selection - #214
Merged
Merged
Conversation
katydecorah
approved these changes
Mar 19, 2019
katydecorah
left a comment
Contributor
There was a problem hiding this comment.
Nice work figuring out those tests! I left two comments to address a small text change
| - `options.origin` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Use to set a custom API origin. Defaults to <https://api.mapbox.com>. | ||
| - `options.zoom` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** On geocoded result what zoom level should the map animate to when a `bbox` isn't found in the response. If a `bbox` is found the map will fit to the `bbox`. (optional, default `16`) | ||
| - `options.flyTo` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** If false, animating the map to a selected result is disabled. (optional, default `true`) | ||
| - `options.flyTo` **([Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) \| [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object))?** If false, animating the map to a selected result is disabled. If true, animating the map with use the default animation parameters. If an object, the object will be passed to the flyTo map method to specify a custom animation. |
Contributor
There was a problem hiding this comment.
If true, animating the map with use the default
Should this read:
If true, animating the map will use the default
| * @param {String} options.origin Use to set a custom API origin. Defaults to https://api.mapbox.com. | ||
| * @param {Number} [options.zoom=16] On geocoded result what zoom level should the map animate to when a `bbox` isn't found in the response. If a `bbox` is found the map will fit to the `bbox`. | ||
| * @param {Boolean} [options.flyTo=true] If false, animating the map to a selected result is disabled. | ||
| * @param {Boolean|Object} [options.flyTo] If false, animating the map to a selected result is disabled. If true, animating the map with use the default animation parameters. If an object, the object will be passed to the flyTo map method to specify a custom animation. |
Contributor
There was a problem hiding this comment.
If true, animating the map with use the default
Should this read:
If true, animating the map will use the default
| flyTo: true | ||
| }); | ||
|
|
||
| var mapFlyMethod = sinon.spy(map, "flyTo"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses #51 by passing the
flyToobject in the constructor options to theflyTomethod on the map when a result selection has been made.If the property is an object, the object will be passed to the map to specify a custom animation
If the property is
true, the map will animate using the default animation parametersIf the property is
false, the map will not animate to the selected resultbriefly describe the changes in this PR
write tests for all new functionality
update CHANGELOG.md with changes under
masterheading before merging