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

Android: Fix lineCap of Polyline #2375

Merged
merged 3 commits into from
Jul 18, 2018
Merged

Conversation

kruyvanna
Copy link
Contributor

Does any other open PR do the same thing?

No

What issue is this PR fixing?

#2374

How did you test this PR?

Verified on Android, HTC M8

@rborn
Copy link
Collaborator

rborn commented Jul 12, 2018

Hi, thanks for the PR ❤️

Does it work correctly on ios? (both ios and google maps)

@kruyvanna
Copy link
Contributor Author

Hi @rborn, on iOS, the MapKit version works correctly.
for GoogleMaps on iOS, the native SDK doesn't support lineCap unfortunately (as of today).
https://developers.google.com/maps/documentation/ios-sdk/shapes

@kruyvanna
Copy link
Contributor Author

@rborn I send you the screenshots of iOS and Android
line_cap

@rborn
Copy link
Collaborator

rborn commented Jul 12, 2018

@kruyvanna that's great, one more thing: could you please amend the docs that it's not supported yet? https://github.com/react-community/react-native-maps/blob/master/docs/polyline.md

@kruyvanna
Copy link
Contributor Author

@rborn done. Not sure about my English wording.

@@ -22,6 +24,7 @@
private float width;
private boolean geodesic;
private float zIndex;
private Cap lineCap = new RoundCap();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need here a RoundCap ?

docs/polyline.md Outdated
@@ -9,7 +9,7 @@
| `strokeColor` | `String` | `#000` | The stroke color to use for the path.
| `strokeColors` | `Array<String>` | `null` | The stroke colors to use for the path (iOS only). Must be the same length as `coordinates`.
| `lineCap` | `String` | `round` | The line cap style to apply to the open ends of the path. Possible values are `butt`, `round` or `square`.
| `lineJoin` | `String` | `round` | The line join style to apply to corners of the path. Possible values are `miter`, `round` or `bevel`.
| `lineJoin` | `String` | `round` | The line join style to apply to corners of the path. Possible values are `miter`, `round` or `bevel`. Note: lineJoin is not yet supported for GoogleMaps provider on iOS.
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's lineJoin not available or lineCap (english is great 🤗)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops!, it's lineCap. :D

cap = new SquareCap();
break;
default:
cap = new RoundCap();
Copy link
Collaborator

@rborn rborn Jul 13, 2018

Choose a reason for hiding this comment

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

Do we need a default cap ? I mean maybe people don't want one.

Copy link
Contributor Author

@kruyvanna kruyvanna Jul 13, 2018

Choose a reason for hiding this comment

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

the docs says round is the default one

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok great, I'm blind 😹

Copy link
Contributor Author

Choose a reason for hiding this comment

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

:D

@kruyvanna
Copy link
Contributor Author

@rborn I corrected the docs changing from lineJoin to lineCap

@rborn
Copy link
Collaborator

rborn commented Jul 13, 2018

All good, thanks a lot ❤️

@alvelig LGTM 🐽

@kruyvanna
Copy link
Contributor Author

@rborn Btw, I added support for lineDashPattern on Android.
The appearance of the dash is dependent on lineCap property.
So, should I wait for this PR to be merged first then make a new PR or should I make a new PR right a way.
kruyvanna@f0ac2e5

@rborn
Copy link
Collaborator

rborn commented Jul 13, 2018

@kruyvanna new PR please

@kruyvanna
Copy link
Contributor Author

@rborn ok

@rborn rborn merged commit b9ec81b into react-native-maps:master Jul 18, 2018
timxyz pushed a commit to 3sidedcube/react-native-maps that referenced this pull request Aug 24, 2018
* master: (168 commits)
  Adding overlaying components details (react-native-maps#2425)
  docs: pin color limitations for android (react-native-maps#2429)
  Revert "Added MBTiles support for iOS and Android (react-native-maps#2208)" (react-native-maps#2387)
  Added MBTiles support for iOS and Android (react-native-maps#2208)
  Fix disabling the toolbar and my location button (react-native-maps#2317)
  Fixes warnings about self (react-native-maps#2341)
  Android: Fix lineCap of Polyline (react-native-maps#2375)
  Update installation.md (react-native-maps#2381)
  update doc (react-native-maps#2363)
  zIndex doesn't work when the map moves in iOS 11 (react-native-maps#2359)
  Fix readme formatting (react-native-maps#2358)
  add support for calloutAnchor with GoogleMaps on iOS; fixes react-native-maps#1852 (react-native-maps#2351)
  Added animateToNavigation method to MapView (react-native-maps#2049)
  Add react-native@^0.55 to peerDependencies (react-native-maps#2332)
  Fix custom marker updates on android react-native-maps#1611 react-native-maps#2048
  [iOS] Prefix or eliminate globals in AIRMapMarker (react-native-maps#2306)
  Fix CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF warnings (react-native-maps#2154)
  Fix for compile error (react-native-maps#2215). (react-native-maps#2232)
  Make tiles display at the same physical size regardless of pixel dens… (react-native-maps#2248)
  Added support of lineDashPattern polyline prop to iOS Google Maps (react-native-maps#2243)
  ...

# Conflicts:
#	lib/components/MapMarker.js
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.

2 participants