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

Examples: better solution for stylesheet conflicts between libraries #193

Open AmeliaBR opened 4 years ago

AmeliaBR commented 4 years ago

Right now, all the styles and generated markup from different mapping libraries is getting imported into the same example pages. This is causing some selector conflicts, especially for TomTom which re-uses MapBox and OpenLayers styles and selectors, with their own additions and tweaks.

Currently, I've got one of the TomTom stylesheets commented out because of this, but that means adding extra styles where they are required (e.g. here). Might be worth trying to identify a full version of the stylesheet with the conflicts removed? Or create and host separate versions of every complete stylesheet with a scoping class at the top of every selector (e.g., to distinguish .mapboxgl-example .mapboxgl-ctrl {} from .tomtom-example .mapboxgl-ctrl {}). We'd end up with extra CSS for the rules that are the same, but at least avoid clashes.

dmorissette commented 4 years ago

How about one page per example, with an index page listing all the examples with a one-liner description for each? In the style of what we find here https://openlayers.org/en/latest/examples/ (the search box can be considered optional, for bonus points)

NickFitz commented 4 years ago

Might it be worth breaking each example up into a main page and a per-framework sub-page, with the main page embedding the per-framework examples in iframes? (As everything depends on JS anyway, the per-framework example pages could detect if they were framed and remove or hide any unnecessary content within themselves such as headings.)

@dmorissette I've been thinking it would be convenient to have an examples/index.html, as I'm quite reliant on the default Apache index page for quick access to the examples in my local repo as I work.

AmeliaBR commented 4 years ago

I'm quite reliant on the default Apache index page for quick access to the examples in my local repo

Me as well. I really wish Github Pages had an automatic index option. Keeping a manual index page up to date is a pain when you don't have a build system otherwise. But maybe we could run an extra little script on the main report, that finds all the index links from each section and organizes them into an appendix at the end?