Search code examples
javascriptjquerygoogle-mapsmarkerclusterer

GoogleMap MarkerClusterer Issue


I am trying to convert my GoogleMap to use MarkerClusterer. I have simplified everything down so that once my map is created, I can add a MarkerClusterer with my markers. In this case I am trying to make only one marker.

  marker = new google.maps.Marker({
  position: new google.maps.LatLng(20,20),
  map:map
  });
  console.log("about to make markerCluster")
  markerCluster = new MarkerClusterer(map,[]);
  console.log("made markerCluster")
  console.log("trying to add marker")
  markerCluster.addMarker(marker)
  console.log("added marker")

Here I get to "trying to add marker" and no further. The error messsage given in Chrome Javascript Console is:

Uncaught TypeError: undefined is not a function markerclusterer.js:155

isMarkerInViewport_ markerclusterer.js:155

MarkerClusterer.addMarker markerclusterer.js:183 (anonymous function)

...

Any ideas?


Solution

  • Figured out my own issue: was using version 1.0 and needed to be using issue 2.1 >.< thank you to anyone who looked into this