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

[google_maps_flutter] Implement polyline patterns in google maps ios #5757

Merged
merged 48 commits into from
May 28, 2024

Conversation

Hari-07
Copy link
Contributor

@Hari-07 Hari-07 commented Dec 26, 2023

This PR Implements patterns in google maps ios polylines. Currently the patterns param is simply ignored on ios, despite the official google maps SDK for ios having instructions on how to achieve repeated patterns: https://developers.google.com/maps/documentation/ios-sdk/shapes#add-a-repeating-color-pattern-to-a-polyline

List which issues are fixed by this PR. You must list at least one issue.
flutter/flutter#60083

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Nil

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@Hari-07
Copy link
Contributor Author

Hari-07 commented Dec 26, 2023

I don't currently have any tests, however that is because looking at the existing tests, since I only made changes to the ios package, it didn't seem right to author tests in the google_maps_flutter package.

But looking at tests in google_maps_flutter_ios it seemed like they do not test things like what this PR covers

Open to authoring tests, if someone could let me know what the tests should test

@Hari-07 Hari-07 force-pushed the polyline-pattern-ios branch from 8334dd1 to 348b17f Compare December 26, 2023 09:40
@stuartmorgan
Copy link
Contributor

Marking as a draft for now since this needs native unit tests before it will be ready for review (per discussion in Discord).

@stuartmorgan stuartmorgan marked this pull request as draft January 2, 2024 14:32
@Hari-07
Copy link
Contributor Author

Hari-07 commented Jan 4, 2024

I implemented tests for 2 out of 3 functions I wrote. For the 3rd function, the test should look something like

- (void)testStrokeStylesFromPatterns {
    NSArray* patterns = @ [@[@"gap", @10], @[@"dash", @10]];
    UIColor* strokeColor = [UIColor redColor];
    
    NSArray<GMSStrokeStyle*> *patternStrokeStyle = [FLTGoogleMapJSONConversions strokeStylesFromPatterns:patterns strokeColor:strokeColor];
    
    XCTAssertEqual([patternStrokeStyle count], 2);
    
    GMSStrokeStyle* firstStrokeStyle = patternStrokeStyle[0];
    GMSStrokeStyle* secondStrokeStyle = patternStrokeStyle[1];
    
    // XCTAssertEqualObjects(firstStrokeStyle, [GMSStrokeStyle solidColor:[UIColor clearColor]]);
    // XCTAssertEqualObjects(secondStrokeStyle, [GMSStrokeStyle solidColor:strokeColor]);
}

However, the color property is not readable so I couldn't get this to work.

@Hari-07
Copy link
Contributor Author

Hari-07 commented May 25, 2024

I've updated for all your comments other than this thread. Have left a comment on that too.

Apologies about the delay

@Hari-07 Hari-07 requested a review from stuartmorgan May 25, 2024 13:22
@Hari-07
Copy link
Contributor Author

Hari-07 commented May 25, 2024

One of the test failure is that the new _Test header isn't in the umbrella header. Do we need to put test headers into it tho?

@stuartmorgan
Copy link
Contributor

One of the test failure is that the new _Test header isn't in the umbrella header. Do we need to put test headers into it tho?

Yes, unfortunately the way our builds are structured we have to make the test headers public currently. (Longer term, moving to Swift will resolve this problem.)

Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

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

Just minor nits, other than that, LGTM once it passes CI!

@Hari-07
Copy link
Contributor Author

Hari-07 commented May 28, 2024

@stuartmorgan Thank you so much for the detailed reviews, and the back and forth. This was a long one. I didn't have prior experience with Obj-C and was figuring it out as we went hence the many beginner mistakes.

Have fixed your latest round of suggestions as well, the only CI failure is its expecting a changelog change in google_maps_flutter but as per this conversation that's not required.

Hope this can get merged in soon 🙏

@stuartmorgan stuartmorgan added the override: no changelog needed Override the check requiring CHANGELOG updates for most changes label May 28, 2024
@stuartmorgan
Copy link
Contributor

CHANGELOG override: updating non-main examples to not check for iOS in other packages doesn't warrant client-facing commenting.

Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@stuartmorgan stuartmorgan added the autosubmit Merge PR when tree becomes green via auto submit App label May 28, 2024
@auto-submit auto-submit bot merged commit a61103b into flutter:main May 28, 2024
74 checks passed
@Hari-07 Hari-07 deleted the polyline-pattern-ios branch May 29, 2024 04:44
ThangVuNguyenViet pushed a commit to ThangVuNguyenViet/packages that referenced this pull request May 29, 2024
…lutter#5757)

This PR Implements patterns in google maps ios polylines. Currently the patterns param is simply ignored on ios, despite the official google maps SDK for ios having instructions on how to achieve repeated patterns: https://developers.google.com/maps/documentation/ios-sdk/shapes#add-a-repeating-color-pattern-to-a-polyline

*List which issues are fixed by this PR. You must list at least one issue.*
flutter/flutter#60083

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
Nil
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 29, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request May 29, 2024
flutter/packages@a933c30...31d3329

2024-05-28 49699333+dependabot[bot]@users.noreply.github.com [pigeon]: Bump org.jetbrains.kotlin:kotlin-gradle-plugin from 1.9.22 to 2.0.0 in /packages/pigeon/platform_tests/test_plugin/android (flutter/packages#6815)
2024-05-28 [email protected] [google_maps_flutter] Implement polyline patterns in google maps ios (flutter/packages#5757)
2024-05-28 [email protected] [many] Remove references to v1 embedding (flutter/packages#6494)
2024-05-28 [email protected] [go_router] docs: updated link in navigation.md to correct file path for push_with_shell_route.dart (flutter/packages#6670)
2024-05-28 49699333+dependabot[bot]@users.noreply.github.com [webview]: Bump androidx.webkit:webkit from 1.10.0 to 1.11.0 in /packages/webview_flutter/webview_flutter_android/android (flutter/packages#6805)
2024-05-28 [email protected] Roll Flutter from 0b31ffc to a1a33e6 (6 revisions) (flutter/packages#6822)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
victorsanni pushed a commit to victorsanni/flutter that referenced this pull request May 31, 2024
flutter/packages@a933c30...31d3329

2024-05-28 49699333+dependabot[bot]@users.noreply.github.com [pigeon]: Bump org.jetbrains.kotlin:kotlin-gradle-plugin from 1.9.22 to 2.0.0 in /packages/pigeon/platform_tests/test_plugin/android (flutter/packages#6815)
2024-05-28 [email protected] [google_maps_flutter] Implement polyline patterns in google maps ios (flutter/packages#5757)
2024-05-28 [email protected] [many] Remove references to v1 embedding (flutter/packages#6494)
2024-05-28 [email protected] [go_router] docs: updated link in navigation.md to correct file path for push_with_shell_route.dart (flutter/packages#6670)
2024-05-28 49699333+dependabot[bot]@users.noreply.github.com [webview]: Bump androidx.webkit:webkit from 1.10.0 to 1.11.0 in /packages/webview_flutter/webview_flutter_android/android (flutter/packages#6805)
2024-05-28 [email protected] Roll Flutter from 0b31ffc to a1a33e6 (6 revisions) (flutter/packages#6822)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
arc-yong pushed a commit to Arctuition/packages-arc that referenced this pull request Jun 14, 2024
…lutter#5757)

This PR Implements patterns in google maps ios polylines. Currently the patterns param is simply ignored on ios, despite the official google maps SDK for ios having instructions on how to achieve repeated patterns: https://developers.google.com/maps/documentation/ios-sdk/shapes#add-a-repeating-color-pattern-to-a-polyline

*List which issues are fixed by this PR. You must list at least one issue.*
flutter/flutter#60083

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
Nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App override: no changelog needed Override the check requiring CHANGELOG updates for most changes p: google_maps_flutter platform-android platform-ios
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants