Skip to content

[docs] Address user feedback on resize and *RenderedWorldCopies - #8748

Merged
mourner merged 15 commits into
masterfrom
cmcg-reader-feedback-map
Sep 12, 2019
Merged

mourner merged 15 commits into
masterfrom
cmcg-reader-feedback-map

Conversation

@colleenmcginnis

Copy link
Copy Markdown
Contributor

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 Related links for relevance.

cc @mapbox/docs

@mourner mourner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍 apart from a few nits and pending a green build (a few linting fixes).

Comment thread src/ui/map.js
/**
* 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.)".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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?

Comment thread src/ui/map.js Outdated
*
* 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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: "another script" might not be a little confusing — perhaps change to "programmatically"?

Comment thread src/ui/map.js Outdated
* 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();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps worth adding var bounds = ... in examples like this to show that it returns a value?

Comment thread src/ui/map.js Outdated
* @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.

@andrewharvey andrewharvey Sep 11, 2019

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think a visual would go a long way here. https://github.com/mapbox/mapbox-gl-js-docs/pull/72 for your consideration. 💁

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment thread src/ui/map.js
Comment thread src/ui/map.js Outdated
@andrewharvey

Copy link
Copy Markdown
Collaborator

A lot of good changes here, thanks! I just made a few comments.

Comment thread src/ui/map.js Outdated
Comment thread src/ui/map.js Outdated
Comment thread src/ui/map.js Outdated
Comment thread src/ui/map.js Outdated
Comment thread src/ui/map.js Outdated
Colleen McGinnis and others added 2 commits September 12, 2019 09:52
@mourner
mourner merged commit e30d31e into master Sep 12, 2019
@mourner
mourner deleted the cmcg-reader-feedback-map branch September 12, 2019 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants