Repository navigation
Get & set options - #226
Conversation
katydecorah
left a comment
There was a problem hiding this comment.
This brings sooo much customization 😍
I hear you on wanting to be consistent on these get and set options, but I think it's also fair to not add options for the few that you listed your PR comment. It's hard to think of valuable use cases for them. Nevertheless, not that we have these patterns in place it should be fairly straightforward to add if someone requests a getter/setter that we don't already have.
I left you several comments with some (nitpicky) documentation suggestions, please take or leave as you see fit.
|
|
||
| /** | ||
| * Set the zoom level | ||
| * @param {Number} zoom 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`. |
There was a problem hiding this comment.
Small copy suggestion:
| * @param {Number} zoom 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 {Number} zoom The zoom level that the map should animate to when a `bbox` isn't found in the response. If a `bbox` is found the map will fit to the `bbox`. |
| }, | ||
|
|
||
| /** | ||
| * Sets the flyTo options |
There was a problem hiding this comment.
Small edit for consistency:
| * Sets the flyTo options | |
| * Set the flyTo options |
| }, | ||
|
|
||
| /** | ||
| * Gets the bounding box used by the plugin |
There was a problem hiding this comment.
For consistency:
| * Gets the bounding box used by the plugin | |
| * Get the bounding box used by the plugin |
| }, | ||
|
|
||
| /** | ||
| * Sets the bounding box to limit search results to |
There was a problem hiding this comment.
| * Sets the bounding box to limit search results to | |
| * Set the bounding box to limit search results to |
| }, | ||
|
|
||
| /** | ||
| * Set the countries to limit search results to |
There was a problem hiding this comment.
Should this be types?
| * Set the countries to limit search results to | |
| * Set the types to limit search results to |
| }, | ||
|
|
||
| /** | ||
| * Get the limit value used by the plugin |
There was a problem hiding this comment.
| * Get the limit value used by the plugin | |
| * Get the limit value for the number of results to display used by the plugin |
| }, | ||
|
|
||
| /** | ||
| * Get the minimum length used in the plugin |
There was a problem hiding this comment.
Maybe call out what the minimum length refers to?
| * Get the minimum length used in the plugin | |
| * Get the minimum number of characters typed to trigger results used in the plugin |
| }, | ||
|
|
||
| /** | ||
| * Set the minimum length value used by the plugin |
There was a problem hiding this comment.
| * Set the minimum length value used by the plugin | |
| * Set the minimum number of characters typed to trigger results used by the plugin |
| }, | ||
|
|
||
| /** | ||
| * Set the limit value used by the plugin |
There was a problem hiding this comment.
| * Set the limit value used by the plugin | |
| * Set the limit value for the number of results to display used by the plugin |
| }, | ||
|
|
||
| /** | ||
| * Get the filter function used by the plugin |
There was a problem hiding this comment.
I'm not exactly sure what filter does in suggestions, maybe we could add a little more to add context?
There was a problem hiding this comment.
This PR fixes #176 by adding getter/setter methods.
This PRs get/set methods for the following options:
languagezoomflyToplaceholderbboxcountriestypesminLengthlimitfilterproximity(already implemented)It's an open question as to whether we should support
get, and particularlyset, methods for these options, since changing their behavior more fundamentally alters the behavior of the plugin -- and I'm not sure of the use case of changing them after creating an instance with different values:accessTokenoriginlocalGeocoderreverseModereverseGeocode#208 will add get/set functions for html rendering functions and we should add analogous methods in #219 to support new options that we're adding in version 4 (#197)
npm run docsand commit changes to API.mdmasterheading before merging\cc @katydecorah @yuletide