Closed matt-wallis closed 5 years ago
There are comments in #72 that may be of use when implementing this feature.
Consider:
Have a marker that is used solely to represent the selected initiative.
Call it selected initiative marker
.
It may have its own distinctive icon, which may be bigger than usual, or have a distinctive shadow. The selective initiative marker should:
When an initiative is selected, what should we do with its 'normal' marker?
If we hide it, and it is clustered, will the cluster-count mysteriously (from the user's point of view) be decremented? Perhaps, if the selected initiative marker
completely obscures the 'normal' marker, then we need do nothing.
How much 'baggage' would need to be transferred from the 'normal' marker to the selected initiative marker
? e.g. popups and hover text?
Probably best if the selected initiative marker
is created when an initiative is selected, and destroyed when it is de-selected. That also permits more than one marker to be selected.
An interesting use-case for selecting more than one marker is the case where the user wants to say that 2 markers represent the same initiative (i.e. a sameAs
relationship exists). Typically, these will be co-located, so it is probably best if all selected initiative markers
belong to a cluster.
Something else to try out for selected markers: Permanently show the tooltip (i.e. the name of the initiative). See Leaflet ToolTip, option permanent
.
ctrlKey
is pressed on click, then the initiative is added to the set of selected initiatives.N.B Muli-selection is desktop-only, but that should be fine for the 'advanced' feature of multiple selections.
Implementation note: Leaflet's MouseEvent provides access to the original DOM event, which has a ctrlKey
property.
Note: When a marker is clicked, we do not want to automatically zoom and pan to the Marker.
On clicking an item in the search results, the corresponding initiative becomes selected. All other selected initiatives are de-selected.
This is equivalent to the sole search result item being clicked.
This assumes that
The above is not yet implemented.
In this case, it is doubtful that we'd want the map to pan and zoom to the icon when the history item is revisited, because the user may have carefully set up the map pan/zoom only to find that is disturbed by using history navigation. However we do need to provide a mechanism for the user to pan/zoom to the selected iinitiative after its details have been displayed in the sidebar via history navigation. Maybe just click on the sidebar display? Or have a button?
This needs careful thought, particularly to bare in mind behaviour on small devices, where the map and sidebar are not displayed simultaneously.
When an initiative is selected via sidebar navigation, we would also need to de-select any initiatives that are selected prior to the action.
The history is maintained and accessed by presenter/sidebar/search.js
. This is the obvious place to handle all events relating to search results and initiative selections. But it needs to be renames to reflect this: presenter/sidebar/sse_initiatives.js
.
Similarly, the module currently called view/sidebar/search.js
should be renamed view/sidebar/sse_initiatives.js
.
In both cases above, the modules contain functionality relating to the search box. This should be moved into a new module {presenter|view}/seachBox.js
.
The presenter for sse_initiatives then deals with sets of initiatives:
presenter
will instruct the view
to show that initiatives' details.presenter
will instruct the view
to show a list of initiatives.Looking good. Large Screen Feedback: The history is working nicely - quite powerful. It creates an expectation that the map should zoom to visualise those selected in the remembered search. This however may not be appropriate. What might a zoom to selected option look like? Mobile Feedback: When in the sidebar, can the icon to touch to return to map view be a map icon? See zoom to selected idea here
This works. Closable?
This works. Closable?
We still need to add the button to the sidebar that zooms/pans to the initiative(s) in the sidebar. Or is that a different issue?
Ok, lets keep it open until that is there. Slighty related. On a mobile, the close sidebar button is very small. It requires care not to press the settings button beside it. So either, can we make it slightly larger, or move the other button away, to the other side, of the bar, perhaps?
On a mobile, the close sidebar button is very small. It requires care not to press the settings button beside it. So either, can we make it slightly larger, or move the other button away, to the other side, of the bar, perhaps?
Can you raise a separate issue for this?
I think this is no longer relevant with new designs for how the panel will work. @joebillings
We need to have a concept of "the selected initiative". There are various use cases where this is required:
The selected initiative should be clearly distinguishable from others. It should not be within a 'cluster' (a number of the map instead of a marker), regardless of the map zoom level.
We need to consider also if more than one initiative can be selected. Some possible use cases in the future:
sameas
one another. This would only become relevant whe we can update the triplestore (in particular the triples that declaresameas
relations)