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

MarkerClusterer: a.getPosition is not a function #280

Open
Defcon0 opened this issue May 11, 2018 · 0 comments
Open

MarkerClusterer: a.getPosition is not a function #280

Defcon0 opened this issue May 11, 2018 · 0 comments

Comments

@Defcon0
Copy link

Defcon0 commented May 11, 2018

Hello,

when including the MarkerClusterer, I get:

markerclusterer.min.js:1 Uncaught TypeError: a.getPosition is not a function
    at MarkerClusterer.isMarkerInBounds_ (markerclusterer.min.js:1)
    at MarkerClusterer.createClusters_ (markerclusterer.min.js:1)
    at MarkerClusterer.setReady_ (markerclusterer.min.js:1)
    at MarkerClusterer.onAdd (markerclusterer.min.js:1)
    at MarkerClusterer.Wz (overlay.js:1)
    at Yz._.Rf.B (js?v=3&language=en&key=AIzaSyC2_LcHBd66GwtvEdmOv63XW4o52Mx0mvU&callback=google.loader.callbacks.maps:139)
    at Qg.trigger (js?v=3&language=en&key=AIzaSyC2_LcHBd66GwtvEdmOv63XW4o52Mx0mvU&callback=google.loader.callbacks.maps:123)
    at Qg.<anonymous> (js?v=3&language=en&key=AIzaSyC2_LcHBd66GwtvEdmOv63XW4o52Mx0mvU&callback=google.loader.callbacks.maps:52)
    at _.dw.trigger (js?v=3&language=en&key=AIzaSyC2_LcHBd66GwtvEdmOv63XW4o52Mx0mvU&callback=google.loader.callbacks.maps:123)
    at _.dw.<anonymous> (js?v=3&language=en&key=AIzaSyC2_LcHBd66GwtvEdmOv63XW4o52Mx0mvU&callback=google.loader.callbacks.maps:52)

This is because, for unknown reasons, some functions are also passed to the MarkerClusterer constructor in the generated JavaScript:

map5af554434ba9c709193302_container.functions.to_array(map5af554434ba9c709193302_container.overlays.markers)

returns

0:_.Ie {__gm: {…}, gm_accessors_: {…}, position: _.D, gm_bindings_: {…}, zIndex: 666, …}
1:_.Ie {__gm: {…}, gm_accessors_: {…}, position: _.D, gm_bindings_: {…}, zIndex: 666, …}
2:ƒ (obj)
3:ƒ (name, item)
4:ƒ (name, item, fromIndex)

But only the first two markers are my markers (I only added 2 of them to my map). The latter 3 functions are passed in erroneously I think.

Maybe a bug?

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

No branches or pull requests

1 participant