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

Fix for Dragging Problem #907 #909

Merged
merged 26 commits into from
Sep 13, 2018
Merged

Fix for Dragging Problem #907 #909

merged 26 commits into from
Sep 13, 2018

Conversation

DerGuteWolf
Copy link
Contributor

Fix for Dragging Problem #907

@danzel
Copy link
Member

danzel commented Aug 21, 2018

Please remove the dist/ changes from this PR

package.json Outdated
@@ -6,7 +6,7 @@
"devDependencies": {
"git-rev-sync": "^1.8.0",
"happen": "^0.3.1",
"jake": "~0.5.16",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does jake version change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, I don't know. IMHO jake itself did the change. I will revert this back.

storageArray = storageArray || [];

for (var i = this._childClusters.length - 1; i >= 0; i--) {
this._childClusters[i].getAllChildMarkers(storageArray);
}

for (var j = this._markers.length - 1; j >= 0; j--) {
if (ignoreDraggedMarker && this._markers[j].__dragStart)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tabs for indentation

delete e.target.__dragStart;
if (dragStart) {
this._moveChild(e.target, dragStart, e.target._latlng);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tabs for indentation

@@ -26,14 +26,16 @@ export var MarkerCluster = L.MarkerCluster = L.Marker.extend({
},

//Recursively retrieve all child markers of this cluster
getAllChildMarkers: function (storageArray) {
getAllChildMarkers: function (storageArray, ignoreDraggedMarker) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be included in the documentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, certainly. Should I write a proposal?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added a sentence to README.md, also indentation is now fixed

@DerGuteWolf
Copy link
Contributor Author

ok, will remove dist changes. I only had them first in for the fiddle wo use it.

@danzel
Copy link
Member

danzel commented Aug 22, 2018

Thanks, have tweaked the readme a bit.

@DerGuteWolf
Copy link
Contributor Author

Is now everythink ok with the PR?

@danzel
Copy link
Member

danzel commented Sep 2, 2018

Could we get a spec test, or if not possible then a manual test in examples/old-bugs with instructions on how to verify this behaviour?

Should be the last thing I ask for, thanks!

@DerGuteWolf
Copy link
Contributor Author

I tried to add a manual test, but as with all tests in examples/old-bugs I get these errors, which prevent the tests from working (and me from verifying the added test):
MarkerCluster.js:1 Uncaught SyntaxError: Unexpected token export
MarkerClusterGroup.js:5 Uncaught SyntaxError: Unexpected token export

@danzel
Copy link
Member

danzel commented Sep 4, 2018

I think for the manual tests you probably need to build the dist/ files (but not commit them) and point at those?
There is a good change they are broken because they don't get used often.

@DerGuteWolf
Copy link
Contributor Author

ok, changed now to use dist files. Works for #907. #808 works now with zoom out, but when zooming in again the dragged marker gets lost sometimes. I would propose to use this PR now and open a new bug for this new problem.

@DerGuteWolf
Copy link
Contributor Author

Is now everything ok? Can I do something to get this PR accepted?

@danzel danzel merged commit 83f7300 into Leaflet:master Sep 13, 2018
@danzel
Copy link
Member

danzel commented Sep 13, 2018

Merged and 1.4.1 released.
Zooming out still grabs markers (when they would have normally got clustered), but it is an improvement for sure!
Thanks!

@DerGuteWolf DerGuteWolf mentioned this pull request Nov 15, 2019
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants