Skip to content
This repository has been archived by the owner on Jun 16, 2019. It is now read-only.

Marker clustering with overlay view (custom markers)? #117

Open
kylegillen opened this issue Dec 18, 2016 · 5 comments
Open

Marker clustering with overlay view (custom markers)? #117

kylegillen opened this issue Dec 18, 2016 · 5 comments

Comments

@kylegillen
Copy link

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.

@maximou4391
Copy link

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.

@dave4jr
Copy link

dave4jr commented Jan 8, 2017

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.

@maximou4391
Copy link

Hi dave4jr,
I manage do use overlay with the cluster library and also to display custom html inside the overlays. Ping me ([email protected]) if you need help.

@maximou4391
Copy link

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.

@weijyewang
Copy link

@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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants