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

Duplicate points of interests when zooming #582

Closed
nadavheimann opened this issue Dec 28, 2017 · 12 comments
Closed

Duplicate points of interests when zooming #582

nadavheimann opened this issue Dec 28, 2017 · 12 comments
Assignees
Labels
bug Medium Should be added/fixed in the future
Milestone

Comments

@nadavheimann
Copy link

i have multipal interest point on same point
look at the attachment

capture

its same problem at all points

@HarelM
Copy link
Member

HarelM commented Dec 30, 2017

I have seen this happen from time to time, I could not understand when and why it starts.
This seems to pass when refreshing the browser.
This seems to get worse when zooming and panning the map.
Let me know if you can find a short scenario that reproduces this behavior, I couldn't... :-(

@HarelM HarelM self-assigned this Dec 30, 2017
@HarelM HarelM added bug Medium Should be added/fixed in the future help wanted labels Dec 30, 2017
@HarelM HarelM changed the title Points of interest multipal Duplicate points of interests when zooming Jan 2, 2018
@HarelM
Copy link
Member

HarelM commented Jan 14, 2018

I was able to reproduce the issue using a scenario similar to this one:
Change base layer may time while changing with the visibility of the categories inside the public routes layer. after playing with both buttons for a while I get the following error message, from then on, every change in zoom level adds some markers to the cluster:

ERROR Error: Uncaught (in promise): TypeError: Cannot read property '_zoom' of undefined
TypeError: Cannot read property '_zoom' of undefined
    at NewClass._addLayer (leaflet.markercluster.js:6)
    at NewClass.addLayer (leaflet.markercluster.js:6)
    at categories.layer.ts:135
    at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:392)
    at Object.onInvoke (core.js:4629)
    at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:391)
    at Zone.webpackJsonp.../../../../zone.js/dist/zone.js.Zone.run (zone.js:142)
    at zone.js:873
    at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:425)
    at Object.onInvokeTask (core.js:4620)
    at NewClass._addLayer (leaflet.markercluster.js:6)
    at NewClass.addLayer (leaflet.markercluster.js:6)
    at categories.layer.ts:135
    at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:392)
    at Object.onInvoke (core.js:4629)
    at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:391)
    at Zone.webpackJsonp.../../../../zone.js/dist/zone.js.Zone.run (zone.js:142)
    at zone.js:873
    at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:425)
    at Object.onInvokeTask (core.js:4620)
    at resolvePromise (zone.js:824)
    at zone.js:876
    at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:425)
    at Object.onInvokeTask (core.js:4620)
    at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:424)
    at Zone.webpackJsonp.../../../../zone.js/dist/zone.js.Zone.runTask (zone.js:192)
    at drainMicroTaskQueue (zone.js:602)
    at ZoneTask.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (zone.js:503)
    at invokeTask (zone.js:1540)
    at XMLHttpRequest.globalZoneAwareCallback (zone.js:1566)

@MatanBenMoshe, FYI.

HarelM added a commit that referenced this issue Jan 14, 2018
@HarelM
Copy link
Member

HarelM commented Jan 14, 2018

Related check-in is to reverse the order of changing a base-layer - first we add the new layer and then remove the previous, I think this might explain this issue as the cluster layer doesn't work well when there's no base layer, I think...

@HarelM HarelM added this to the Next Release milestone Jan 15, 2018
@HarelM
Copy link
Member

HarelM commented Jan 15, 2018

I'm publishing a fix tonight for this issue, I was somewhat able to reproduce it, although I'm not sure this is the only scenario which causes the bug.
I don't have a good reproducible scenario as it is related to timing, but after the code change I was not able to reproduce it again so I'm hoping I found the root cause...
In case if you see this happening again after tonight upgrade please write here and I'll reopen the issue.

@HarelM HarelM closed this as completed Jan 15, 2018
@HarelM
Copy link
Member

HarelM commented Jan 16, 2018

The issue was not solved using the code changes I made.
I can now easily reproduce it using the following scenario:
Go to:
https://israelhiking.osm.org.il/#!/13/32.9843/35.4004

  1. hide all route layers
  2. show only bike routes
  3. hide bike routes
  4. show bike routes --> bug can be seen in console and when zooming.
    Discussed also in Duplicate markers Leaflet/Leaflet.markercluster#860

@HarelM HarelM reopened this Jan 16, 2018
@HarelM HarelM closed this as completed in 36fe360 Feb 27, 2018
@HarelM
Copy link
Member

HarelM commented Feb 27, 2018

@nadavheimann @MatanBenMoshe I'll publish tonight a fix to this issue, hopefully will put this issue behind us once and for all.
If you encounter this issue again please report it here and I'll reopen this issue.

@HarelM
Copy link
Member

HarelM commented Mar 1, 2018

Published.

@nadavheimann
Copy link
Author

nadavheimann commented Mar 1, 2018 via email

@amiad
Copy link
Contributor

amiad commented Mar 22, 2018

The problem happen again.

@HarelM
Copy link
Member

HarelM commented Mar 22, 2018

I need to be able to reproduce the scenario in order to do something with your report...
Can you see if you can find a way to make it happen?

@amiad
Copy link
Contributor

amiad commented Mar 26, 2018

I hide and show some times the route layers and then when I move the map or zoom it the points duplicate.

@HarelM
Copy link
Member

HarelM commented Mar 26, 2018

Yes, this is how I originally discovered this issue, but after the fix I made I didn't saw it happen again.
I don't have a good way to reproduce it so it will be extremely hard for me to fix it.
If you find a scenario that is easy to reproduce please share it and I'll see if I can help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Medium Should be added/fixed in the future
Projects
None yet
Development

No branches or pull requests

3 participants