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

Add "number" parameter to MarkerCluster #2811

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rcpinheiro
Copy link

When you add markers to MarkerCluster add a optional "number" parameter to the MarkerOptions (default: number=1). That way, MarkerCluster instead of showing the count of Markers, will show the sum of the "number" field in the Markers.
Very useful when you try to add lots and lots of identifical markes. For instance, if you have 100 markers in the same location, you only have to add one marker with "number=100" instead of adding 100 markers.

Pull request guide

Thank you for considering to improve this cordova-plugin-googlemaps.

When you create a pull request, please make it to multiple_maps branch instead of master branch.

Because the multiple_maps branch is edge version.

Thank you for your understanding.

When you add markers to  MarkerCluster add a optional "number" parameter to the MarkerOptions (default: number=1). That way, MarkerCluster instead of showing the count of Markers, will show the sum of the "number" field in the Markers.
Very useful when you try to add lots and lots of identifical markes. For instance, if you have 100 markers in the same location, you only have to add one marker with "number=100" instead of adding 100 markers.
@wf9a5m75
Copy link
Member

Could you show me the screenshot? (I'm outside now)

@wf9a5m75
Copy link
Member

Ah, I got your idea.
You want to show the value of markers instead of number of markers.

@rcpinheiro
Copy link
Author

rcpinheiro commented Jul 15, 2020

Right.
Three markers with "number" equal to 48, 11 and 2:
image

When you zoom out:
image

@rcpinheiro
Copy link
Author

On second thought, the name "number" is not a good one. It's best to call it "value" or "weight".

@wf9a5m75
Copy link
Member

@rcpinheiro
Thank you for your PR. Your idea is good, but creating a special meaning property for particular is not good.
Because some people might want to more complex calculation, such as return value * priority;

I also asked someone wanted to customize the strings of the number, such as 2532 -> 2.5k

So, I will create a custom callback instead of particular property.

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.

None yet

2 participants