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

Add clearer notes to setMapBoundaries method #2707

Merged
merged 1 commit into from
Mar 8, 2019
Merged

Add clearer notes to setMapBoundaries method #2707

merged 1 commit into from
Mar 8, 2019

Conversation

chris-poe
Copy link
Contributor

When using the setMapBoundaries method, it is not immediately clear why the user is able to scroll past the specified boundaries. Noting that the method uses the maps center coordinates would help clarify.

Does any other open PR do the same thing?

No, there are no other pull requests open on this issue.

What issue is this PR fixing?

Clarifies the use of the setMapBoundaries method.

How did you test this PR?

No testing needed for markdown edits.

When using the setMapBoundaries method, it is not immediately clear why the user is able to scroll past the specified boundaries. Noting that the method uses the maps center coordinates would help clarify.
@christopherdro christopherdro merged commit 2e0c89d into react-native-maps:master Mar 8, 2019
@EskelCz
Copy link

EskelCz commented Jul 30, 2019

@chris-poe I'm trying to use the function and I must concur, it is not clear. Unfortunately not even with your improvement. Are the boundary coordinates somehow relative to something? Doesn't make any sense to me.
I've put in absolute coordinates of what I want to be available to the user and it seems like it simply doesn't work.

@chris-poe
Copy link
Contributor Author

@EskelCz what is meant by that is the center coordinates of the phone's viewport will not move past the boundaries you set.

Maybe a visual would help. As you can see below, we have a bounding box around the United States (red line) which represents the boundaries specified by the setMapBoundaries method. Also we have a visual representation of the phones viewport (purple line). The purple dot in the center of the viewport represents the viewport's center coordinates. Those center coordinates won't move past the boundaries you set by the setMapBoundaries method.

Selection_003

I think the confusion we were all having is that we thought the viewport itself (purple line) would stay within the bounds of the red box, but that is not the case.

I think I will be editing my change because after coming back I agree that I still didn't quite clarify as well as I could have.

Hope this helps.

@EskelCz
Copy link

EskelCz commented Jul 31, 2019

Ah I see, that's where an image is worth a thousand words :) Thanks!
I got it to work, it was a silly mistake in my implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants