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

Add coloration behind clusters #98

Open
mbjackson-capp opened this issue May 12, 2024 · 2 comments
Open

Add coloration behind clusters #98

mbjackson-capp opened this issue May 12, 2024 · 2 comments

Comments

@mbjackson-capp
Copy link
Contributor

The "number of points in this cluster" numbers on the map don't currently have any coloration behind them. The default behavior for a MarkerCluster is to have coloration; we should figure out how to restore that (and, perhaps, change coloration dynamically so smaller clusters have less intense color as you zoom in further)

The example image from Leaflet is
(which there is now a copy of in our repo)

@mbjackson-capp
Copy link
Contributor Author

It looks like there are two basic ways to do this:

  1. Change global settings in styles.css for entire app by adding CSS selectors for MarkerCluster
    https://stackoverflow.com/questions/49538465/changing-leaflet-markercluster-icon-color-inheriting-the-rest-of-the-default-cs

  2. Explicitly set style when declaring the markerClusterGroup, as in:

var markers = L.markerClusterGroup({
    // Other options...
    styles: [{
        // Customize the cluster icon style
        textColor: '#fff',  // Text color
        iconSize: [30, 30],  // Icon size
        backgroundColor: '#007bff'  // Background color
    }]
});

(code suggestion from ChatGPT 3.5)

Unfortunately, in early attempts to apply each of these, neither of them worked. The additions to styles.css didn't even work when flagged as !important. Figure out what's going on here

@mbjackson-capp
Copy link
Contributor Author

consider map.css

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

No branches or pull requests

1 participant