SINTEF-9012 / PruneCluster

Fast and realtime marker clustering for Leaflet
MIT License
551 stars 131 forks source link

Not update anchor icons after filtered #157

Open denny123 opened 6 years ago

denny123 commented 6 years ago

i have:

                pruneCluster.Cluster._markers.forEach(function(marker) {
            if(cat == 0) marker.filtered = false;
            else {
                if(marker.category == cat) marker.filtered = false;
                else marker.filtered = true;
            }
        });
        pruneCluster.ProcessView();

and if in cluster(more then 1 markers) remained only one marker then he have anchor icon how all cluster before. But if have before one marker in cluster(only marker) then he have own anchor icon(right). ProcessView not update anchors icons.

fungiboletus commented 6 years ago

Hei,

I'm not sure I understand your question. But firstable, I don't think you should use _markers. It's a private variable by naming conventions and you may use it only if you know what you are doing for a hack.

denny123 commented 6 years ago

ps private: how a can more change filter for each markers?

fungiboletus commented 6 years ago

Can you try to have a list of markers in your code, similarly to the examples ?

Le 13 nov. 2017 10:37 AM, "denny123" notifications@github.com a écrit :

ps private: how a can more change filter for each markers?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/SINTEF-9012/PruneCluster/issues/157#issuecomment-343848336, or mute the thread https://github.com/notifications/unsubscribe-auth/AACyrB-0CpRpv_qv9TUbn9t6Lym9lGGDks5s1_-_gaJpZM4QbXaV .

denny123 commented 6 years ago

i cant, i dont know how more.

denny123 commented 6 years ago

by problem: here have iconAnchor and i have:

                        Marker.data.icon = L.icon({
                iconUrl: 'icon.png',
                iconSize: [24, 32],
                iconAnchor: [12, 32]
            });

after change filtered (similarly to the examples) if stay only one marker in cluster then iconAnchor not right - only replacing icon cluster on icon marker.