farmOS / farmOS-map

farmOS-map is an OpenLayers wrapper library designed for agricultural mapping needs. It can be used in any project that has similar requirements.
https://farmOS.github.io/farmOS-map
MIT License
40 stars 22 forks source link

Highlight map container when "active" #62

Closed paul121 closed 3 years ago

paul121 commented 4 years ago

A simple way to indicate that the map must be "active" before dragging & zooming might be to "highlight" the container when it is active. Just as when you click in a text field in an HTML form. Might be enough to convey to users why it is only interactive the "second" time they try

jgaehring commented 4 years ago

Good idea!

I wonder if it might also be helpful to have some sort of indicator which pops up on the map on mouse enter when it's inactive. Perhaps just some animated text that slides up and says "Click to interact" or something like that.

FWIW, I am not using this feature/behavior (I believe it's added in the farmOS codebase) in Field Kit. Instead I'm keeping maps purely static (ie, no interactions enabled), unless they occupy the full window, then you can zoom, pan, etc all you like w/o having to click to activate.

mstenta commented 4 years ago

I like this idea a lot. And @jgaehring's idea to show text of some sort.

Before thinking about that, though, I'd like to think about what exactly the problem(s) are and what the expected behavior is.

@paul121's last sentence hits the nail on the head, I think:

why it is only interactive the "second" time they try

This specifically points to the "drag pan" requiring an extra click as the core problem. I don't think the "scroll zoom" requiring a click first is necessarily a problem. In fact the reason we made this change in the first place was to prevent scrolling the map when you are trying to scroll the page.

There is actually an issue for the drag pan piece of this specifically: https://github.com/farmOS/farmOS-map/issues/48

That was closed with a very rough workaround, but perhaps it should be reopened and a proper solution should be implemented to prevent focus being required for the "drag pan" interaction.

And if that solves the core issue, then maybe we don't need to highlight the map? What do you think?

mstenta commented 4 years ago

I reopened #48.

If you think that would obviate the need for highlighting the map, then feel free to close this.

paul121 commented 4 years ago

but perhaps it should be reopened and a proper solution should be implemented to prevent focus being required for the "drag pan" interaction.

That seems like a good solution.

Still curious if highlighting would be good for zooming. As an "advanced" user, I'm probably not the best to provide that feedback.. let's close and reconsider if someone else has issues with zooming.

mstenta commented 4 years ago

I reopened #48.

After giving this some more thought, I'm second guessing it. See comment in #48: https://github.com/farmOS/farmOS-map/issues/48#issuecomment-590905059

mstenta commented 4 years ago

Reopening this for further consideration.

paul121 commented 3 years ago

The Claro and Gin themes in farmOS 2.x style ALL active elements with a highlighted border. Maybe the app using farmOS-map should be responsible for this behavior. If farmOS-map were to implement something, it might be conflicting with the style in the context of the other application.

I'm going to close this issue and open another feature request for what @jgaehring suggested:

Perhaps just some animated text that slides up and says "Click to interact" or something like that.

map_border