Skip to content
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

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

Merged
merged 15 commits into from
Sep 12, 2019

Conversation

colleenmcginnis
Copy link
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

Copy link
Member

@mourner mourner left a comment

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

@@ -276,39 +276,45 @@ class Map extends Camera {
_requestManager: RequestManager;

/**
* 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
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
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?

src/ui/map.js Outdated
@@ -482,11 +498,19 @@ class Map extends Camera {
* Resizes the map according to the dimensions of its
* `container` element.
*
* 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
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"?

src/ui/map.js Outdated
@@ -507,13 +531,17 @@ class Map extends Camera {
/**
* 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
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?

src/ui/map.js Outdated
@@ -203,7 +203,7 @@ const defaultOptions = {
* @param {number} [options.pitch=0] The initial pitch (tilt) of the map, measured in degrees away from the plane of the screen (0-60). If `pitch` is not specified in the constructor options, Mapbox GL JS will look for it in the map's style object. If it is not specified in the style, either, it will default to `0`.
* @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.
Copy link
Collaborator

@andrewharvey andrewharvey Sep 11, 2019

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

src/ui/map.js Outdated Show resolved Hide resolved
@andrewharvey
Copy link
Collaborator

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

src/ui/map.js Outdated Show resolved Hide resolved
src/ui/map.js Outdated Show resolved Hide resolved
src/ui/map.js Outdated Show resolved Hide resolved
src/ui/map.js Outdated Show resolved Hide resolved
src/ui/map.js Outdated Show resolved Hide resolved
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