googlearchive/js-marker-clusterer

Marker clustering with overlay view (custom markers)?

kylegillen opened this issue · 5 comments

Hi. Great lib!

Not sure if here would be the best place to ask or over in the gmaps.js repo, but figured I'd take a shot.

I was wondering if anyone knew how to go about extending google.maps.OverlayView() so that gmaps MarkerClusterer constructor could cluster them as it does with standard markers?

I saw this post on SO: http://stackoverflow.com/questions/8297456/google-maps-v3-clustering-with-custom-markers but when I attempted to extend the gmaps implementation of OverlayView, these methods were never called.

  overlay.setVisible = function(visible) {
   // custom implementation
  }

  overlay.getPosition = function() {
    return this.position;
  }

So I assume gmaps goes about its own way of abstracting the drawing of clusters also?

Anyways, any help is much appreciated.

Thanks.

I nextriot,
I just tried and it worked well, but now my question is, can we put custom html div instead of the images :) that would be cool, I will try.
Maxime.

I'm trying to do the same thing. I'm sure a ton of people are having this same issue. I think the RichMarker solved this issue but there's no longer support for it, not sure why, can't find anything on that subject.

Hi dave4jr,
I manage do use overlay with the cluster library and also to display custom html inside the overlays. Ping me (maximou4391@hotmail.fr) if you need help.

Hi @dave4jr,

I used this example http://humaan.com/custom-html-markers-google-maps with this one you can put everything you want in innerHTML and that's pretty much it. You can also use it in typescript with proper typings.

@maximou4391 I tried the same approach like @dave4jr and @nextriot and I'm facing the same issue as well. How did you make it work? I'm on Angular 6 and Typescript