Re:Show HN: Get the real best price for your hotel or get a ...
by jdmichal on Wednesday September 16, 2015 @03:29PM
(#10229169)
> We took a conscious decision disabling the scrolling wheel as zoom in/out because otherwise it would have triggered too many "refine searches".
Tip: Any operation that's reliant on mouse events should be throttled or debounced -- they are just too noisy. For mapping, I have done debounces as long as two seconds without the delay being obvious. I suspect due to the style of user interaction in combination with the loading animations from the map itself.
Re:Show HN: Get the real best price for your hotel or get a ...
by dzoing on Wednesday September 16, 2015 @04:01PM
(#10229415)
really appreciated - it's somewhat debounced already, but it seems to be not quite right... I'd be curious to hear about how you went about debouncing (what time delays on which specific actions, zoom, moving the map)
Re:Show HN: Get the real best price for your hotel or get a ...
by jdmichal on Wednesday September 16, 2015 @04:29PM
(#10229635)
Option one: Use the built-in `idle` event on the top-level map object. This basically does all the debouncing for you, though I don't remember off the top of my head whether this event happens before or after the `tilesloaded` event. The distinction would only be important if you want to wait for the map to visually update before displaying the results.
Option two: I think for your use case just listening on the single `bounds_changed` event will do what you want. That should trigger for all types of map movement or zooming. For the callback, use a closure which clears and sets a timeout event with the desired debounce time; no need to overcomplicate it. Then it's just tuning the delay until it hits that sweet spot between firing too often and obvious visual delays.
Re:Show HN: Get the real best price for your hotel or get a ...
by malnourish on Wednesday September 16, 2015 @02:35PM
(#10228764)
Perhaps disable refining searches and instead have a button refines. This could allow users to scroll idiomatically and save on unnecessary traffic.
Re:Show HN: Get the real best price for your hotel or get a ...
by borgatov on Wednesday September 16, 2015 @02:38PM
(#10228792)
We're already exploring some options, and this is definitely one of them.
Re:Show HN: Get the real best price for your hotel or get a ...
by malnourish on Wednesday September 16, 2015 @02:51PM
(#10228865)
Great to hear, best of luck!
Regarding the landing page I think it's still a speed problem, but I'll take a closer look to this.
Thanks again.