Web-Map-Custom-Element icon indicating copy to clipboard operation
Web-Map-Custom-Element copied to clipboard

Implement the "Leaflet API" on top of `<mapml-viewer>` and `<layer->` etc

Open prushforth opened this issue 4 years ago • 0 comments

This is more of a thought experiment than an actual implementation idea.

What would it take to run Leaflet plugins if the Web browser actually implemented a <map> and (etc) element set?

It seems reasonable that simple maps would be simple using declarative HTML, but could these browser mapping facilities be used to underpin (implement) a script library that provided backwards compatibility with the Leaflet 1.x API, such that plugins would run without modification?

The idea comes from the notion of jQuery, which is no longer needed in a browser, because element.querySelector or querySelectorAll are natively implemented. But if your code uses jQuery, jQuery itself could be shimmed, with the underlying functionality provided by the native implementation. Of course it would be smarter to just remove dependence on jQuery, but maybe some abstractions that are implemented by Leaflet would become conspicuous by our inability to provide them easily. Those abstractions might be necessary, but they also might be non-low hanging fruit, which would necessarily be progressive enhancements (script-only).

prushforth avatar Feb 15 '21 21:02 prushforth