Maps4HTML / MapML-Specification

Map Markup Language is hypertext for Web maps, like HTML is hypertext for Web pages https://maps4html.org/MapML-Specification/spec/
Other
55 stars 12 forks source link

Idea: <map draggable> (or other) attribute (with a better name) #158

Open prushforth opened 3 years ago

prushforth commented 3 years ago

It seems that drag and drop functionality is kind of outside the normal scope of HTML specifications, being a script-driven facility.

On the other hand, dragging the URL of a MapML document onto an existing <mapml-viewer> and having it show up as a <layer-> element on top of the stack of layers is quite useful. I'm not sure how that can be done via keyboard accessibility, so that's an important consideration for standardizing it.

As well, the recently introduced ability to re-order <layer-> nodes by dragging them in the layer control seems to be quite useful.

However, some Web sites might not want this functionality on their web site. Does it seem like the right approach to add a boolean attribute to the widget element to indicate if the widget will respond to drag events? What are the implications of allowing drag and drop events on a native element such as a <map>?

Malvoz commented 3 years ago

I don't think a single attribute should cover both these cases:

And draggable is an enumerated attribute in HTML so I don't think it's compatible to have a <map draggable> boolean, it'd have to be something else.

OTOH we should be careful not to overload <map> (and <layer>) with declarative mechanisms.

prushforth commented 3 years ago

OTOH we should be careful not to overload (and ) with declarative mechanisms.

Words to live by. I also think of this in terms of how much we are asking browsers to build for maps, to which of course the answer at this time is "Needs Implementer Interest". What concerns me is that adding such things pushes back the timeframe for implementer interest to develop. Anyway, it's an idea for discussion at least.

For the element, the objective would be to enable/disable the dropping of URLs and potentially other elements onto the map viewport. I find this feature highly useful, but I can certainly see how companies, for example Google, would not want to make it so easy to create a mashup in which you're able to compare your coordinates with theirs. However, for public data providers like OpenStreetMap, government emergency management agencies and so on, dropability would be a killer feature.

For layers, it would be ideal to enable that when you drag a layer out of the layer control, it behaves like its URL, so it could be dragged from one map onto another.

Opting in/out of draggable layer items in the layer control's exposed UI

I hadn't considered that but yes indeed I could see sites wanting to restrict the accidental re-ordering of layers.