Maps4HTML / HTML-Map-Element-UseCases-Requirements

Use cases and requirements for Maps on the Web
https://maps4html.org/HTML-Map-Element-UseCases-Requirements/
Other
22 stars 12 forks source link

Capability: JS independence #32

Open AmeliaBR opened 5 years ago

AmeliaBR commented 5 years ago

This issue is for discussion of the map viewer capability (potential requirement) “Display a basic map without JavaScript”.


From the 2015 use cases report's list of limitations of current tools:

Reliance on script All of the above Web map techniques depend on JavaScript, and so Web maps, considered as a feature of the Web, require a scripted environment to even exist. JavaScript on the Web embodies the 'code-on-demand' optional constraint of the Web. Thus a feature such as Web maps depends on an optional feature of the Web itself. When the option is not available or fails, the Web itself fails, or does not possess this feature. The fact that a sophisticated, not to say important, feature such as Web maps can be enabled by virtue of an optional feature of the Web is however, a testament to the magical qualities of the Web. Nevertheless, dependence on this facet of the Web has lead to a situation where there are no inherent map semantics in HTML, or on the Web.

Turning this around, a capability of a web map viewer is its ability to provide at least basic function when JS is disabled or fails for other reasons.

prushforth commented 5 years ago

I was browsing Zach Leatherman's twitter today, and I was reminded of a site that provides a reasonable map experience even with script disabled. It must have taken some excellent server side scripting, but nonetheless is very impressive and worth noting here. https://www.fixmystreet.com/report/1576145?lat=52.479435&lon=-1.889648&zoom=2

nchan0154 commented 5 years ago

This is definitely the best map experience we've seen so far when it comes to having JS disabled!

To summarize their technique, each map tile is served as an image. When JS is disabled, the pan and zoom buttons are actually link elements that change the URL of the page. The page URL takes the lat, long and zoom parameters much like some of the map widgets we've seen so far. A good example of progressive enhancement in action.

prushforth commented 4 years ago

I think this section of the document could recognize that

<img usemap="#themap" ...><map name="themap"><area ...></map>

is a JavaScript-less map already supported natively by browsers, albeit without spatial semantics.

In this example, <img> and <area> are (abstract) "layers".