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 heatmap support #21489

Merged
merged 1 commit into from Feb 7, 2021
Merged

Conversation

@crisbeto
Copy link
Member

@crisbeto crisbeto commented Jan 3, 2021

Adds support for rendering heatmaps on the google-map component using the map-heatmap-layer directive. The directive is mostly a direct wrapper around the google.maps.visualization.HeatmapLayer class, except for the fact that it also accepts a LatLngLiteral, whereas the Google Maps class only accepts LatLng objects. I decided to add some logic to convert them automatically, because creating LatLng requires the Maps API to have been loaded which can lead to race conditions if it's being loaded lazily.

Example

@crisbeto crisbeto requested review from devversion and angular/dev-infra-components as code owners Jan 3, 2021
@google-cla google-cla bot added the cla: yes label Jan 3, 2021
Copy link
Member

@jelbourn jelbourn left a comment

LGTM, though @mbehrlich should also take a look

}

if (changes['data'] && _data !== undefined) {
// TODO(crisbeto): the API allows for `MVCArray<LatLng|WeightedLocation>` or

This comment has been minimized.

@jelbourn

jelbourn Jan 5, 2021
Member

Is it worth sending a PR to fix the types?

This comment has been minimized.

@crisbeto

crisbeto Jan 5, 2021
Author Member

Yeah, I was planning on sending out out, but I haven't gotten around to it yet.

This comment has been minimized.

</head>
```

**Note:**

This comment has been minimized.

@mbehrlich

mbehrlich Jan 5, 2021
Collaborator

There are several classes that we may want to implement in the future that also require adding separate libraries. Should we make this note more general, to apply to several components, while giving more specific instructions about which library to use in the component-specific readme?

This comment has been minimized.

@crisbeto

crisbeto Jan 6, 2021
Author Member

I think it may be too vague if we're doing it now since there aren't any other components that use this approach. It might be better to do it once we have other components.

@crisbeto crisbeto force-pushed the crisbeto:google-heatmap branch 2 times, most recently from 87d2c81 to c17ec2b Jan 6, 2021
Copy link
Collaborator

@mbehrlich mbehrlich left a comment

LGTM

@crisbeto crisbeto force-pushed the crisbeto:google-heatmap branch 2 times, most recently from a3a1266 to cc428ad Jan 10, 2021
@crisbeto crisbeto force-pushed the crisbeto:google-heatmap branch from cc428ad to 666bf4b Jan 21, 2021
@crisbeto crisbeto force-pushed the crisbeto:google-heatmap branch from 666bf4b to 7fd36f4 Jan 29, 2021
@annieyw
Copy link
Collaborator

@annieyw annieyw commented Feb 5, 2021

@crisbeto needs rebase

Adds support for rendering heatmaps on the `google-map` component using the
`map-heatmap-layer` directive. The directive is mostly a direct wrapper around the
`google.maps.visualization.HeatmapLayer` class, except for the fact that it also accepts a
`LatLngLiteral`, whereas the Google Maps class only accepts `LatLng` objects. I decided
to add some logic to convert them automatically, because creating `LatLng` requires
the Maps API to have been loaded which can lead to race conditions if it's being loaded
lazily.
@crisbeto crisbeto force-pushed the crisbeto:google-heatmap branch from 7fd36f4 to 2acb4aa Feb 5, 2021
@crisbeto
Copy link
Member Author

@crisbeto crisbeto commented Feb 5, 2021

Rebased @annieyw.

@annieyw annieyw merged commit 09581ee into angular:master Feb 7, 2021
16 checks passed
16 checks passed
@in-solidarity
Inclusive Language Check completed with success
Details
@ngbot
ci/angular: merge status All checks passed!
ci/circleci: api_golden_checks Your tests passed on CircleCI!
Details
ci/circleci: bazel_build Your tests passed on CircleCI!
Details
ci/circleci: build_release_packages Your tests passed on CircleCI!
Details
ci/circleci: e2e_tests Your tests passed on CircleCI!
Details
ci/circleci: integration_tests Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: ngcc_compatibility Your tests passed on CircleCI!
Details
ci/circleci: tests_browserstack Your tests passed on CircleCI!
Details
ci/circleci: tests_local_browsers Your tests passed on CircleCI!
Details
ci/circleci: tests_saucelabs Your tests passed on CircleCI!
Details
ci/circleci: upload_release_packages Your tests passed on CircleCI!
Details
ci/circleci: view_engine_build Your tests passed on CircleCI!
Details
ci/circleci: view_engine_test Your tests passed on CircleCI!
Details
@google-cla
cla/google All necessary CLAs are signed
wagnermaciel added a commit to wagnermaciel/components that referenced this pull request Feb 8, 2021
Adds support for rendering heatmaps on the `google-map` component using the
`map-heatmap-layer` directive. The directive is mostly a direct wrapper around the
`google.maps.visualization.HeatmapLayer` class, except for the fact that it also accepts a
`LatLngLiteral`, whereas the Google Maps class only accepts `LatLng` objects. I decided
to add some logic to convert them automatically, because creating `LatLng` requires
the Maps API to have been loaded which can lead to race conditions if it's being loaded
lazily.
wagnermaciel added a commit to wagnermaciel/components that referenced this pull request Feb 8, 2021
Adds support for rendering heatmaps on the `google-map` component using the
`map-heatmap-layer` directive. The directive is mostly a direct wrapper around the
`google.maps.visualization.HeatmapLayer` class, except for the fact that it also accepts a
`LatLngLiteral`, whereas the Google Maps class only accepts `LatLng` objects. I decided
to add some logic to convert them automatically, because creating `LatLng` requires
the Maps API to have been loaded which can lead to race conditions if it's being loaded
lazily.
@angular-automatic-lock-bot
Copy link

@angular-automatic-lock-bot angular-automatic-lock-bot bot commented Mar 10, 2021

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 Mar 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants