Skip to content

AdvancedMarker position null messes up cluster location #902

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
LeLunZ opened this issue Jul 29, 2024 · 0 comments · May be fixed by #903
Open

AdvancedMarker position null messes up cluster location #902

LeLunZ opened this issue Jul 29, 2024 · 0 comments · May be fixed by #903
Labels
triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@LeLunZ
Copy link

LeLunZ commented Jul 29, 2024

With the addition of the changes for the AdvancedMarkers, a problem has slipped in.
The documentation of AdvancedMarkers.position says:

An AdvancedMarkerElement may be constructed without a position, but will not be displayed until its position is provided

The problem is that in every algorithm (supercluster/grid/superviewport) the MarkerUtils.getPosition function is used which assumes that position of null means lat=0, lng=0 which then leads to problems when calculating the center of a cluster.


One solution could be to return null instead of google.maps.LatLng(null) in the MarkerUtils.getPosition function and then check everywhere where the position is used if MarkerUtils.getPosition(marker) == null.

@LeLunZ LeLunZ added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jul 29, 2024
@LeLunZ LeLunZ linked a pull request Jul 29, 2024 that will close this issue
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant