googlemaps / googlemaps/js-markerclusterer

TypeError: undefined is not an object (evaluating 'projection.fromLatLngToDivPixel')

Open
#910 3 comments 7 reactions 0 assignees View on GitHub
triage me type: bug
Dominant language
TypeScript
Stars
293
Forks
104
Avg merge
3m
Merged PRs (30d)
18

Description

When calling clearMarkers/addMarkers relatively early after the map is initialised, a error is thrown.
It seems even though the map is initialised, markerclusterer doesn't have a valid projection.

---

#### Environment details

Markerclusterer: 2.5.3

#### Steps to reproduce

1. create a markerclusterer object.
2. register mapInitialized Callback (in the callback call .clearMarkers or addMarkers)
3. error is thrown when callback is called

#### Stack trace
```
latLngBoundsToPixelBounds — index.esm.js:233
extendBoundsToPaddedViewport — index.esm.js:194
getPaddedViewport — index.esm.js:202
calculate — index.esm.js:567
render — index.esm.js:872
clearMarkers — index.esm.js:862
```

Following these steps will guarantee the quickest resolution possible.

Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.