jieter / Leaflet.Sync

Synchronized view of two maps.
http://jieter.github.io/Leaflet.Sync/examples/dual.html
BSD 3-Clause "New" or "Revised" License
235 stars 53 forks source link

Add synchronized cursors #30

Closed baipi closed 8 years ago

baipi commented 8 years ago

27

Add synchronized circle marker cursors between synced maps to compare more accurately.

jieter commented 8 years ago

@baipi thanks for the pull, I added a couple of comments. I thought the linter would catch a couple of these, but it did not, I tightened the eslint config to show the errors.

What happens if the users moves the mouse out of the map?

baipi commented 8 years ago

@jieter, thanks for the review, I will make changes soon.

If users move the mouse out of the map, the marker stays at the last mouse position on the map.

jieter commented 8 years ago

I see, I was asking because that might not be what we want: if the cursor is gone, the thing we use to mirror the cursor in the other map should be gone too.

baipi commented 8 years ago

I based the pull request on the issue #27, it doesn't really specify what should be comportment. The pull request is a first step which could be easily improve/adapt for user needs.

jieter commented 8 years ago

My quick implementation uses the mouseout event to hide the cursor: https://github.com/turban/Leaflet.Sync/blob/sync-cursor/L.Map.Sync.js#L46-L50

baipi commented 8 years ago

Hi @jieter, I made some changes yesturday. For now, I don't have time to implement and test the hidden cursor. Maybe it could be a part of a futur pull request ?

jieter commented 8 years ago

@baipi thanks. I needed to fix some things and it still needs tests and documenation...