[docs] Address user feedback on resize and *RenderedWorldCopies - #8748
Conversation
mourner
left a comment
There was a problem hiding this comment.
👍 apart from a few nits and pending a green build (a few linting fixes).
| /** | ||
| * The map's {@link ScrollZoomHandler}, which implements zooming in and out with a scroll wheel or trackpad. | ||
| * The map's `ScrollZoomHandler`, which implements zooming in and out with a scroll wheel or trackpad. | ||
| * Find more details and examples using `scrollZoom` in the {@link ScrollZoomHandler} section. |
There was a problem hiding this comment.
Maybe worth clarifying all the handler comments with what you can actually do with the property? E.g. "Allows you to control scroll zooming behavior dynamically (toggle on and off, adjust options, etc.)".
There was a problem hiding this comment.
I started doing this, but it felt repetitive. What do you think about skipping this for now and reevaluating if we continue to get feedback on these sections?
| * | ||
| * This method must be called after the map's `container` is resized by another script, | ||
| * Checks if the map container size changed and updates the map if it has changed. | ||
| * This method must be called after the map's `container` is resized by another script |
There was a problem hiding this comment.
Nit: "another script" might not be a little confusing — perhaps change to "programmatically"?
| * Returns the map's geographical bounds. When the bearing or pitch is non-zero, the visible region is not | ||
| * an axis-aligned rectangle, and the result is the smallest bounds that encompasses the visible region. | ||
| * @example | ||
| * map.getBounds(); |
There was a problem hiding this comment.
Perhaps worth adding var bounds = ... in examples like this to show that it returns a value?
| * @param {LngLatBoundsLike} [options.bounds] The initial bounds of the map. If `bounds` is specified, it overrides `center` and `zoom` constructor options. | ||
| * @param {Object} [options.fitBoundsOptions] A [`fitBounds`](#map#fitbounds) options object to use _only_ when fitting the initial `bounds` provided above. | ||
| * @param {boolean} [options.renderWorldCopies=true] If `true`, multiple copies of the world will be rendered, when zoomed out. | ||
| * @param {boolean} [options.renderWorldCopies=true] If `true`, multiple copies of the world will be rendered side by side when the map is zoomed out far enough that a single representation of the world does not fill the map's entire container. |
There was a problem hiding this comment.
I know this was an issue with the docs even before you're change here, but technically it's not just zoomed out. zoomed right in to z14 showing a map of Fiji you want renderWorldCopies to true otherwise half the country will be cut off.
Perhaps a better way instead of saying when zoomed out is, saying outside of the -180 to 180degrees longitude bounds?
There was a problem hiding this comment.
I think a visual would go a long way here. https://github.com/mapbox/mapbox-gl-js-docs/pull/72 for your consideration. 💁
There was a problem hiding this comment.
Also -- I didn't update the text for getRenderWorldCopies and setRenderWorldCopies yet, but once we're comfortable with the language here I can update those, too.
|
A lot of good changes here, thanks! I just made a few comments. |
Co-Authored-By: Vladimir Agafonkin <agafonkin@gmail.com>
Fixes https://github.com/mapbox/mapbox-gl-js-docs/issues/19
Fixes https://github.com/mapbox/mapbox-gl-js-docs/issues/51
Fixes https://github.com/mapbox/mapbox-gl-js-docs/issues/65
This PR is the first in a series that will address user feedback on the contents of the API docs including adding inline examples to all sections of the API docs and auditing
Relatedlinks for relevance.cc @mapbox/docs