-
Notifications
You must be signed in to change notification settings - Fork 31
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
BiG-CZ: List Popup #2314
BiG-CZ: List Popup #2314
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works really well! The code is nice and neat, and the commit message packaging is done in a very accessible and easy to understand manner. Great job!
Regarding the height thing, I agree it is annoying and potentially disruptive, but at the very end of a page list. I think that's a small enough use case for us to not worry about at this time. The only design alternative I can think of is padding the results, but the whitespace may be more awkward than the height change.
Here are a few issues I noticed though:
- Hovering on items in the popup list does not highlight them on the map or the sidebar. It should, since it all other interactions work the same.
- Clicking on item in the list and then reaching the detail popup does not highlight the item on the map or the sidebar. It should.
- Hovering on an item in the sidebar hides the popup. This should not happen. Clicking should hide it, but hovering should not.
- In many cases, the title is not useful enough to differentiate in the first few characters that are shown for each item. I wonder if we should have two lines for the titles before (dot dot dot)ing them. This could use the input of @ajrobbins and @jfrankl
I'll take another look once 1, 2, 3 above have been addressed.
src/mmw/js/src/core/views.js
Outdated
}, | ||
|
||
// Get a list of results intersecting the clicked point | ||
intersectingFeatures = _.reduce( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer using _.filter
instead of _.reduce
:
intersectingFeatures = _.filter(e.target._layers, intersectsClickBounds);
src/mmw/js/src/core/views.js
Outdated
layer.setStyle(dataCatalogActiveStyle); | ||
result.set('active', true); | ||
|
||
layer.on('popupclose', function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this event handler taken off at any point? Or do they just pile on with more and more clicks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They were probably piling, good catch. I'm changing this to once
Great job on attaching demo gifs for every use case too 👌 |
I think the existing treatment is sufficient, since we don't know what format the title will take (the examples shown here are only one kind of result) |
That's a good example of it not accommodating important information. However, the same could be true if we have two lines, since there is no standardization on the result titles coming in from the API. |
Thanks, @rajadain. Those were good points. I've pushed some additional fixups + commits to address. Properly linking the popup state and map + sidebar was unexpectedly difficult, but I think it's working now (issue described in commit message). |
Taking another look at this. |
For WDC, if a popup is open for a single element, hovering on others keeps the yellow highlight of the popup-element there. That is, there are two highlighted elements on the map: one for the popup and another for the sidebar element on which the user is hovering. For the multi-popups, this does not happen. Hovering on any element in the sidebar removes the highlight of the popup element. This should not happen: |
I'll take another look once these issues have been addressed. |
Will push a fix soon for the 3rd comment about WDC. I'm having trouble recreating the other two issues described.
Here's the blue border I see on the details view:
Here's what happens when I zoom |
b666014
to
f5d20d2
Compare
@rajadain and I looked together IRL, and he wasn't making up those bugs! I've squashed down the fixups and added a commit that adds a Here's a brief recap
EDIT: @rajadain showed me this did not fix it. Making an issue
We were also able to recreate this together by going from list popup -> detail popup, then closing the popup. I believe it's fixed now.
This is the one I'll be making an issue for. We currently set the active styling directly on the popup layer, instead of using the map state. We can't do this for the list popup because the popup is on the map, not a specific layer. |
@rajadain, is it worthwhile to rebase this on |
In the interest of not adding things to the |
18ba277
to
4ee102e
Compare
* Previously we didn't fill the Cinergi boxes, so clicks only registered on their borders * Transparently fill the boxes so we can capture all intersecting clicks
* Previously only the topmost catalog feature would fire a click event * We want to show all intersected layers per click, move the popup binding into an on click handler on the whole FeatureGroup * Clicks that only intersect a single feature show popups the same as before * Clicks that intersect multiple features, just log them to the console for now
* Create a new popup view that first shows a list view of all click-intersected results. If a list item is clicked, shows the selected result's detail view
* The list popups are directly on the map, not tied to any particular layer. Close them manually when the catalog is switched or we enter a detail view
* Use Backbone Pageable Collection to paginate popover list view when results > 3 items
* Highlight the sidebar list item and map element when hovering a popup list * This involved changing the way we add the "ring" highlight to the map when the shape is outside the viewport bounds for CINERGI - Before we were using jquery to add a "highlight" class to the map container. This caused additional mouseenter and mouseleave events to fire on the popup list element. The cursor and highlighting would flicker - Switch to adding a whole DOM element to show the "highlight" ring. This does not cause additional mouse events to fire.
4ee102e
to
9bb0e53
Compare
Rebased on develop, and updated target. |
Waiting on #2351 to fix the build, after which this should pass ... |
@azavea-bot rebuild |
Taking another look to confirm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all your help with this, and uncovering those bugs. |
Overview
When BiG-CZ shapes overlapped we were only able to display the topmost layer. Add a popup that allows browsing details of all the shapes at the clicked point.
Connects #2282
Demo
Multipage
Single page
Notes
I left the height dynamic for now. When there's only a single item on a page, the above height "jumping" happens. I'm not sure what's desirable @jfrankl
Testing Instructions
bundle