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

feat(google-maps): Add MapPolyline component #17512

Merged
merged 7 commits into from
Dec 3, 2019

Conversation

mbehrlich
Copy link
Collaborator

Add a MapPolyline component to @angular/google-maps that allows drawing
polylines on a Google Map.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 26, 2019
* @see developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.getEditable
*/
getEditable(): boolean {
return this._polyline!.getEditable();
Copy link
Member

Choose a reason for hiding this comment

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

From what I can tell, we aren't guaranteed to have a _polyline at all times so the the ! here is misleading. It might be better to null check it. Same goes for all the other getters.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I did it like this because _polyline is initialized in ngOnInit, but it should always be initialized. Let me know if the latest changes I'm uploading are acceptable.

@mbehrlich mbehrlich requested a review from crisbeto November 1, 2019 18:11
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

Include docs for polyline in this change?

@mbehrlich
Copy link
Collaborator Author

Include docs for polyline in this change?

If this component isn't going out in the 9.0 release, will that be confusing for users if Polyline is in the docs but not in the release? My intention was to make a separate document for all of the geometry components and have the main docs link to it when they were ready. What do you think?

@mbehrlich mbehrlich requested a review from jelbourn November 5, 2019 01:55
@jelbourn jelbourn added the target: minor This PR is targeted for the next minor release label Nov 6, 2019
@mbehrlich mbehrlich requested a review from Splaktar November 7, 2019 23:40
(polylineClick)="handleClick()"
(polylineRightclick)="handleRightclick()">
</map-polyline>
</google-map>`,
Copy link
Member

Choose a reason for hiding this comment

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

Not a big deal, but it seems like this template is 4 space indented vs 2.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this is something unusual with how spacing in multi line template literals are being interpreted. It is two spaces on my IDE, I'm not sure if there's a setting I need to to change on my IDE or what but I'll look into it.

Add a MapPolyline component to @angular/google-maps that allows drawing
polylines on a Google Map.
Clean up test data and use underscore for private members.
Change component to a directive.
Fix lint error due to exceeding line length limit.
Change event listener prefix from "map" to "polyline" in polyline
component to indicate the different behavior of the polyline events.
@Splaktar
Copy link
Member

Splaktar commented Nov 9, 2019

As mentioned in the api_golden_checks build message you need to run a local Bazel command to approve the changes to the public API.

This can be done via bazel run //tools/public_api_guard:google-maps/google-maps.d.ts_api.accept.

Then you can amend your commit and force push it up to your branch.

@crisbeto
Copy link
Member

crisbeto commented Nov 9, 2019

@Splaktar the --define=compile=legacy shouldn't be added anymore. Now we're generating the API goldens with Ivy.

@Splaktar
Copy link
Member

Splaktar commented Nov 9, 2019

@crisbeto Oh good! I'll update it.

@mbehrlich Then it would be good if you could squash your commits. This guide has instructions for that. In the future, if you amend your commit and force push, you can avoid the need to squash.

Copy link
Member

@Splaktar Splaktar left a comment

Choose a reason for hiding this comment

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

Other than the need to squash and update the API Goldens, this LGTM!

@jelbourn
Copy link
Member

jelbourn commented Nov 9, 2019

No need to manually squash commits any more; we always just use "Squash and merge" on github

(though I tend to always squash mine anyway out of habit)

@mbehrlich mbehrlich requested a review from a team as a code owner November 11, 2019 20:55
@mbehrlich
Copy link
Collaborator Author

Should be ready now.

@Splaktar Splaktar added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label Nov 14, 2019
@jelbourn jelbourn added merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note blocked This issue is blocked by some external factor, such as a prerequisite PR pr: lgtm action: merge The PR is ready for merge by the caretaker labels Nov 18, 2019
@jelbourn
Copy link
Member

Caretaker note: can be merged after 9.0.0 is released

@jelbourn jelbourn added pr: merge safe and removed blocked This issue is blocked by some external factor, such as a prerequisite PR labels Dec 3, 2019
@jelbourn jelbourn merged commit 0c10828 into angular:master Dec 3, 2019
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jan 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants