Commit Graph

79 Commits

Author SHA1 Message Date
Bryan Housel
d28b269b4c Speed up the scrolling on Firefox Linux too
(re: #5512)

This just changes
`detected.os === 'win'`  to  `detected.os !== 'mac'`
2018-12-12 15:45:55 -05:00
Bryan Housel
4f8f45ec52 Fix issues with slow scrolling and improper panning on windows
(closes #5512)
2018-11-30 22:57:30 -05:00
Quincy Morgan
d6ea64241b Trackpad scroll-to-zoom while holding Shift or Option/Alt 2018-11-21 20:55:30 -05:00
Bryan Housel
9627e1e261 Test in all browsers, improve calcs, cleanup code 2018-11-20 11:48:27 -05:00
Bryan Housel
45a3e58c37 Add support for 2-finger pan and zoom gestures
Also adjust the zooming delta function on Firefox
(which uses wheel events in line units instead of pixel units)
2018-11-19 22:40:23 -05:00
Bryan Housel
b7e218a6cb Remap Safari gesture events to wheel events - #5492
(still needs some more testing)
2018-11-17 02:31:15 -05:00
Bryan Housel
3bc841e95b Adjust layer ordering to draw touch targets above data layers 2018-11-09 21:48:45 -05:00
Bryan Housel
c2971f667d Remove setCenter() from map.dimensions()
This was triggering a weird redraw which made the map slow and look wrong
The map will redraw again in a few milleseconds anyway.

This means that the the map will not stay on the center, but rather the
top-left corner, which kind of feels better anyway, as it doesn't move things
around as much.
2018-11-02 10:52:16 -04:00
Bryan Housel
cc938698e8 Add ability to select custom data 2018-08-25 11:14:04 -04:00
Bryan Housel
f74d21557c Force redraws after moving a note or cancelling a note
similar to 95ea0dbbc, there is no history change event to force a redraw
2018-07-24 19:34:01 -04:00
Bryan Housel
63614d5909 formatting 2018-07-24 15:14:26 -04:00
Bryan Housel
46dc44b35b Make the mode buttons dynamic
- show/hide the note button when the notes layer is enabled/disabled
- enable/disable the note button based on notesEditable
2018-07-23 22:21:47 -04:00
Bryan Housel
78fc2f7c27 No longer need to pass dimension to loadTiles 2018-07-23 21:07:28 -04:00
Thomas Hervey
e23ef4ba4a redraw on note drag. TODO: change dispatch call 2018-07-23 15:09:25 -04:00
Thomas Hervey
bf9b19359a WIP drag note 2018-07-20 21:41:44 -04:00
Thomas Hervey
73ee5c2fc9 fixed select_note mode, cleaned note_editor, TODO: enable note save 2018-07-03 22:45:51 -04:00
Bryan Housel
7716532061 Class surface as lowzoom around z17-z18.5 (based on latitude)
(closes #5101)
2018-06-23 01:42:11 -04:00
Bryan Housel
b238d442a6 Adjust default zoom for points to z19
(closes #5099)
2018-06-21 01:33:18 -04:00
Bryan Housel
aa9cc84ae7 pacify eslint 2018-06-13 18:14:32 -04:00
Bryan Housel
3c02c2ee7b Don't update the streetside viewfield when the map is moving 2018-06-13 15:34:39 -04:00
Bryan Housel
5a97f54317 Fix zoom scaleExtent to allow zoom out to z2 (full map)
(closes #4959)

Also includes some code formatting and cleanup
2018-04-02 15:26:52 -04:00
Bryan Housel
835d45ed6d Never let mouseCoordinates return NaN (fallback to map center) 2018-01-19 11:53:14 -05:00
Bryan Housel
1cfda3ec86 Only store zoomPan event in mousemove if it has a source event
(closes #4706)

d3 transitioned events don't have a source event,
causing mousemove to go null
2018-01-19 11:42:18 -05:00
Bryan Housel
8472f99347 Zooming out should not exit save mode
(closes #4664)
2018-01-08 09:49:32 -05:00
Bryan Housel
be00a526b6 Make sure all targets are redrawn during a mode change
There was an issue where the lines did not redraw their targets right away
when entering drag node, which could make it possible for a quick drag node
to try to connect to its parent line.  With the chooseEdge exclusion it
would not connect to the parent nearby, but in another weird part of the line.
2017-12-22 11:42:21 -05:00
Bryan Housel
563c496a65 Update selected vertices when drawing in select mode
This is a better solution to catching and drawing new verteices that
got added because a user double clicked on a line.
2017-12-19 09:08:59 -05:00
Bryan Housel
7a8f50c74e More fixes for drawing/snapping, don't draw touch targets for activeIDs 2017-12-18 22:54:49 -05:00
Bryan Housel
89d8d37576 Drawing all the correct vertices now where I want them, simplify classes
Some highlights
- `getSiblingAndChildVertices` are expensive, so they're saved and called less frequently
- draw touch targets for all the visible vertices
- remove redundant css classes and `setClass` function
2017-12-15 17:28:20 -05:00
Bryan Housel
b9e48d1682 WIP: Move layer-hit to layer-points with explict sublayers, update tests
This is more work to further isolate the layers that entities draw to.
It makes it easier to debug what is going on, and can eventually lead to
deferred drawing, if each draw function is in its own place and not dependant
on anything else.

I've started to replace the vertex-hover with an explicit layer for touch
targets.

Also had to change a lot of the svg tests, which are really brittle.
Things would happen like - the surface would be created, it would kick of a
deferred redraw, which would notice that the zoom was 0 and call
editOff, which would remove the osm layers that were just created and
that the tests were trying to draw to. These tests need proper zoom and
projection otherwise nothing works.
2017-12-14 17:38:43 -05:00
Bryan Housel
899abc7ef5 WIP to render vertices while dragging
(re: #3003 / #4602)

For now, drawHover is commented out.  Still not sure what I will do with it.
This means that things flicker a bit when dragging, also connecting nodes
(and closing lines) does not currently work.

There was lot going on preventing the vertices from rendering while dragging.

1. `modeDragNode` needed a proper `selectedIDs()` function that works like other
modes.. Many other places in iD (including the vertex renderer) call `context.selectedIDs()`..
This means that `modeDragNode` needs a new function `restoreSelectedIDs()` to do what
`selectedIDs()` was previously doing (a place to store selectedIDs so that we
can reselect those entities after the user is done dragging a node in select mode)

2. Just so many things in svg/vertices.js
  - siblingAndChildVertices was missing some things for points that we render
    as vertices (points in wireframe, points with directions)
  - the sibling vertices weren't being included in the `filter` function, so
    would disappear when doing differenced/extent redraws
  - probably some other things
2017-12-12 17:39:36 -05:00
Bryan Housel
a5bbc21728 Remove unnecessary zoom parameter 2017-12-11 17:34:01 -05:00
Bryan Housel
f247bd1e66 Move icon code into uiFlash, default flash icon to icon-no
Previously it was up to the caller to draw whatever they want into the
footer flash.  With this change, uiFlash creates an icon and a text, so
the caller doesn't need to do as much work.
2017-12-05 23:41:34 -05:00
Bryan Housel
0c0ecdfcfc Comment out some of the requestIdleCallback to fix walkthrough crash
(closes #4533)

There are several issues here.. Here's a quick brain dump:

- the requestIdleCallbacks in map.js (scheduleRedraw) seem to be causing
crashiness in Firefox on fast zoom/unzoom, mousewheel, etc.. anything where
the view transform changes a lot and the redraws don't catch up.
(commented out, reverted back to lodash throttle)

- the requestIdleCallback worker queue in idle_worker.js seems to be causing
crashiness in Firefox and Chrome when exiting the walkthrough.  Something about
deferring the tile parsing as the user leaves the intro has a problem.
It might be an infinite `while` loop, not sure.
(commented out, reverted back to for loop)

- the requestIdleCallback in call_when_idle.js is only used to defer
tile loading in context.loadTiles() - this one seems fine, and actually
has maybe the biggest benefit for improving performance.
(left in)
2017-11-15 22:21:40 -05:00
Bryan Housel
9b705a6375 Don't call async callbacks after connection resets/switches
(closes #4288)
2017-11-14 21:30:01 -05:00
Bryan Housel
d906ca6b10 Convert lodah-es and d3 to named imports for renderer 2017-09-25 14:35:33 -04:00
Bryan Housel
5a8709bc67 Treat osm layer like other vector layers and give it a toggle
(closes #2904)
2017-09-18 22:03:34 -04:00
Kushan Joshi
909b72a39e cleaning up 2017-08-24 17:03:04 +05:30
Kushan Joshi
91a569985d playing with map render 2017-08-24 17:02:49 +05:30
Bryan Housel
99a3741b0c Better isolation of services, to avoid hitting network during test runs
1. All services are disabled in testing now to prevent network accesses
2. Only services are enabled when needed to test something
3. Many changes throughout code to allow iD to run with services disabled
   (e.g. check for osm service instead of assuming context.connection() will work)
4. Actually export the services so we can disable and enable them
2017-08-09 22:04:09 -04:00
Bryan Housel
881f979d46 Return to browse mode when zooming out beyond edit limit
(closes #4184)
2017-08-08 18:14:23 -04:00
Bryan Housel
f52a356b46 Keep previous mousemove event updated while zoompanning
(closes #4155)
2017-07-22 01:00:56 -04:00
Bryan Housel
e88aeadd32 Undo/Redo handler shouldn't switch modes unless already in browse/select 2017-05-03 16:07:16 -04:00
Bryan Housel
992a6aa958 More guard code to protect against user undos and mode changes 2017-04-15 00:32:36 -04:00
Bryan Housel
697cef1b06 Fix zoom/pan for the intro curtain
(closes #2386)
2017-03-22 15:57:26 -04:00
Bryan Housel
4903d495b7 Draw selected items last, so halos are more visible
(see #2914)
2017-03-21 02:17:04 -04:00
Bryan Housel
5ba72292ac Fix mouse xy calculation for mousewheel scroll normalization 2017-02-23 21:45:36 -05:00
Bryan Housel
334188c6fe Normalize mousewheel zooming across browsers
(closes #3029)
2017-02-23 20:11:21 -05:00
Bryan Housel
f7c3de9545 Preserve backward compability with radial menu
Old menu behavior can be restored with 2 cookies:
- `edit-menu-style=radial` - Display menu as a radial menu, limited to 8 items
- `edit-menu-show-always=1` - Show menu on all clicks, not just contextmenu/right
2017-02-22 16:50:42 -05:00
Bryan Housel
e756520bd8 suppressMenu(true) is now the default 2017-02-21 15:47:22 -05:00
Bryan Housel
c5383c1f55 Darker unintrusive flash.. WIP flash operations on keypress 2017-02-10 16:39:08 -05:00