Skip to content

Remove setStyle within init which did not allow our own setStyle #2

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged

Conversation

themogwi
Copy link

@themogwi themogwi commented Dec 27, 2016

This change looks to have no negative effects and allows for the use of setStyle to customize marker icons for instance.

Without the change doing something like the following would have no effect and the default pin icon would be used.

dataLayer = new DataLayerClusterer({
    "map": map,
    "maxZoom": 15
});

dataLayer.addGeoJson(data);

dataLayer.setStyle(function(feature) {
    var militaryFriendly = feature.getProperty('military_friendly');
    return {
        icon: militaryFriendly === true ? baseURL + 'img/map/university-green.png' : baseURL + 'img/map/university-red.png'
    };
});

@Connum Connum merged commit 9d33d3b into Connum:master Feb 3, 2017
@Connum
Copy link
Owner

Connum commented Feb 3, 2017

It does indeed not seem to have any impact. I feared that it could make markers that are loaded from the start pop up shortly before being clustered, but I could not see it happening in my tests.

Thanks again for contributing!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants