DigitalCommons / open-data-and-maps

Deprecated: Implementation of Linked Open Data by the Solidarity Economy Association
6 stars 1 forks source link

Make the selected initiative clearly distinguishable on the map #100

Closed matt-wallis closed 5 years ago

matt-wallis commented 6 years ago

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:

matt-wallis commented 6 years ago

There are comments in #72 that may be of use when implementing this feature.

matt-wallis commented 6 years ago

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.

matt-wallis commented 6 years ago

Something else to try out for selected markers: Permanently show the tooltip (i.e. the name of the initiative). See Leaflet ToolTip, option permanent.

matt-wallis commented 6 years ago

How does an initiative become selected/deselected?

By clicking on its Marker

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.

By being chosen from Search Results

On clicking an item in the search results, the corresponding initiative becomes selected. All other selected initiatives are de-selected.

By being the only item in the Search results

This is equivalent to the sole search result item being clicked.

By being revisited in History

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.

Conclusions

matt-wallis commented 6 years ago

Implementation

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:

ColmMassey commented 6 years ago

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

ColmMassey commented 5 years ago

This works. Closable?

matt-wallis commented 5 years ago

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?

ColmMassey commented 5 years ago

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?

matt-wallis commented 5 years ago

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?

ColmMassey commented 5 years ago

I think this is no longer relevant with new designs for how the panel will work. @joebillings