googlearchive / js-marker-clusterer

A marker clustering library for the Google Maps JavaScript API v3.
https://googlemaps.github.io/js-marker-clusterer/docs/reference.html
Apache License 2.0
1.28k stars 775 forks source link

Adding support for css class styling. #111

Open KevinJCandlert opened 7 years ago

KevinJCandlert commented 7 years ago

I wanted a way to get custom styling from CSS instead of having repeatedly inline CSS for each cluster marker. If the cssClass options are supplied it will ignore the default styling and the options from the 'styles' parameter.

This is more or less the same feature as #24 but with less white-space changes and different implementation.

googlebot commented 7 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


KevinJCandlert commented 7 years ago

I signed it!

Remo commented 7 years ago

@KevinJCandlert google doesn't support this anymore, but we've created a fork where you can find this option https://gmaps-marker-clusterer.github.io/gmaps-marker-clusterer/#reference-styles

KevinJCandlert commented 7 years ago

@Remo Yeah, I've noticed that. But I couldn't find which branch you've merged. I'm not entirely satisfied with my own merge request - As it ignores all the other styling options.

But just adding a CSS class to the cluster-marker along with all the inline styling requires you to add !important to all your CSS-attributes.

It's hard to get it right and also maintain some kind of good UX for the API 👍

Remo commented 7 years ago

I think there were two branches, this should be the one that was merged (not by me) https://github.com/gmaps-marker-clusterer/gmaps-marker-clusterer/pull/6/files