Skip to content

refactor(cluster): Default item rendering to onBeforeClusterItemRendered()#633

Merged
barbeau merged 1 commit intogooglemaps:masterfrom
CUTR-at-USF:refactor-default-cluster-item
Feb 21, 2020
Merged

refactor(cluster): Default item rendering to onBeforeClusterItemRendered()#633
barbeau merged 1 commit intogooglemaps:masterfrom
CUTR-at-USF:refactor-default-cluster-item

Conversation

@barbeau
Copy link
Collaborator

@barbeau barbeau commented Feb 21, 2020

As discussed in #630, refactor the default cluster item rendering implementation from a private method into the protected method onBeforeClusterItemRendered(). This allows apps that extend DefaultClusterRenderer to easily override the default behavior.

I also made the following style changes to the rendering code to make it easier to read (but doesn't change function):

  • Change format of !(item.getTitle() == null) to item.getTitle() != null.
  • Re-order 2nd and 3rd clause of IF to make it clearer that the marker title is set to the snippet if the title text isn't available and the snippet is.

Refs: 630

Fixes #630

@barbeau barbeau requested a review from arriolac February 21, 2020 19:47
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 21, 2020
@codecov
Copy link

codecov bot commented Feb 21, 2020

Codecov Report

Merging #633 into master will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #633   +/-   ##
=======================================
  Coverage   19.00%   19.00%           
=======================================
  Files          71       71           
  Lines        4056     4056           
  Branches      610      609    -1     
=======================================
  Hits          771      771           
  Misses       3251     3251           
  Partials       34       34           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 39f0c22...f518a61. Read the comment docs.

Copy link
Contributor

@arriolac arriolac left a comment

Choose a reason for hiding this comment

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

LGTM

@barbeau barbeau merged commit 4ce5122 into googlemaps:master Feb 21, 2020
@barbeau barbeau deleted the refactor-default-cluster-item branch February 21, 2020 22:18
@arriolac arriolac added this to the 1.0 milestone Feb 24, 2020
@barbeau barbeau mentioned this pull request Feb 25, 2020
@arriolac arriolac added semver: major Hint for users that this is an API breaking change. and removed semver: major Hint for users that this is an API breaking change. labels Feb 25, 2020
arriolac added a commit that referenced this pull request Feb 25, 2020
arriolac added a commit that referenced this pull request Feb 25, 2020
* chore(Release): 1.0.0

* Adding 1.0.0 header and removing duplicate issue.

* Remove dupe issues.

* Add #633 to breaking changes list.
arriolac added a commit that referenced this pull request Feb 26, 2020
* chore(Release): 1.0.0

* Adding 1.0.0 header and removing duplicate issue.

* Remove dupe issues.

* Add #633 to breaking changes list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor default cluster item rendering into onBeforeClusterItemRendered()

3 participants