hosuaby / Leaflet.SmoothMarkerBouncing

Smooth animation of marker bouncing for Leaflet.
BSD 2-Clause "Simplified" License
147 stars 28 forks source link

Getting Cannot read property 'style' of null for those markers which are within a cluster #1

Closed dhrubo001 closed 8 years ago

dhrubo001 commented 8 years ago

errr Getting Cannot read property 'style' of null for those markers which are within a cluster

function markerFunction(id){

 for (var i in m){

        var markerID = m[i].options.title;
        if (markerID == id){

            m[i].openPopup();

            if(m[i].isBouncing())
            {
                m[i].stopBouncing();
                m[i].closePopup();
            }
            else{
                markers.zoomToShowLayer(m[i], function(){
                m[i].setBouncingOptions({
                bounceHeight : 20,    // height of the bouncing
                bounceSpeed  : 40,    // bouncing speed coefficient
                exclusive    : true,  // if this marker bouncing all others must stop
               }).bounce();
            });
            }

        }
   }

}

And the marker is also vanishes when i zoom into the cluster, and again comes back when i zoom out

What i am doing wrong, help needed

PLEASE CHECK THE ATTACHMENT

hosuaby commented 8 years ago

Hello. Currently plugin doesn't work together with cluster plugin. Support for clusters can be added in future versions. You can contribute by adding this feature.

dhrubo001 commented 8 years ago

Any remedies what should i do to overcome this situation??

hosuaby commented 8 years ago

For the moment the only solution is not use those two plugins together.

dhrubo001 commented 8 years ago

ok

mat81 commented 8 years ago

Hello, sorry my english is not so good, I'm french :) Your plugin is really great !! Marker disappear when coming from a cluster, because of opacity = 0 in css I just add delete styles['opacity'] for test in onAdd function line 950 It seems all right

dhrubo001 commented 8 years ago

Can you plz show little bit about our code

hosuaby commented 8 years ago

Yes @mat81 you are very close. @dhrubo001 I am fixing issue. Will made a new release very soon

hosuaby commented 8 years ago

New release 1.1.3 fixes this issue with Leaflet.MarkerCluster.

mrethical commented 4 years ago

This seems to be an issue again with the latest version (2.0.0)

hosuaby commented 4 years ago

Hello @mrethical . Version 2.0.0 was tested with Leaflet.markercluster. Can you pease provide more details. Browser, versions, code snippet, please.

mrethical commented 4 years ago

This is the console log screenshot from the latest version of chrome (v86) Capture

Here's the screenshot on the code block responsible on bouncing a marker (btw I'm using typescript): Capture

Marker bouncing works, but as soon as I zoom out and the markers are clustered, I get the error.

hosuaby commented 4 years ago

@mrethical I confirm this bug. I will try to fix it.

hosuaby commented 4 years ago

@mrethical fixed in v2.0.1

mrethical commented 4 years ago

Works! Thanks for the fix.