Skip to content
43 changes: 43 additions & 0 deletions docs/elements/map-caption.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
id: map-caption
title: "<map-caption>"
slug: /elements/map-caption/
---

The `<map-caption>` element is a child of `<mapml-viewer>` and is used to define
a simple text string that is not visually rendered (at this time).
The caption should be read by screen readers when the `<mapml-viewer>` is focused,
as it generates the `<mapml-viewer aria-label="...">` value, if no aria-label
has been specified by the HTML author. `<map-caption>` may be the first or last
element child of `<mapml-viewer>`.

<iframe src="../../../demo/map-caption-demo/" title="MapML Demo" height="410" width="100%" scrolling="no" frameBorder="0"></iframe>

---

## Specifications

| Specification |
|--------------------------------------------------------------|
| [Not yet specified](https://github.com/Maps4HTML/MapML/issues/234) |

---

## Requirements

[Report problems with these requirements on GitHub](https://github.com/Maps4HTML/HTML-Map-Element-UseCases-Requirements/issues/new?title=-SUMMARIZE+THE+PROBLEM-&body=-DESCRIBE+THE+PROBLEM-)

<p><b><span class="requirement">requirement</span>
<span class="enhancement">enhancement</span>
<span class="impractical">impractical</span>
<span class="undecided">undecided</span>
<span class="discussion">under discussion</span></b></p>

| | Spec | Viewer | API |
|:---------------------------------------------------------------------------------|:------: |:-----: |:---: |
| [**Interpreting locations & map positions (5.3)**](https://maps4html.org/HTML-Map-Element-UseCases-Requirements/#map-viewers-capabilities-locations) | | | |
| <div class="discussion">Provide an accessible name for a map</div> | [under discussion](https://github.com/Maps4HTML/HTML-Map-Element-UseCases-Requirements/issues/260) | [provisional](https://maps4html.org/web-map-doc/docs/elements/map-caption/) | [under discussion](https://github.com/Maps4HTML/HTML-Map-Element-UseCases-Requirements/issues/260) |
---

> - [Edit this page on **Github**](https://github.com/Maps4HTML/web-map-doc/edit/main/docs/elements/map-caption.md)
> - [Chat with us on **Gitter**](https://gitter.im/Maps4HTML/chat)
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
id: map-caption
title: "<map-caption>"
slug: /elements/map-caption/
---

L'élément `<map-caption>` est un enfant de `<mapml-viewer>` et est utilisé pour
définir une simple chaîne de texte qui n'est pas rendue visuellement.
Le contenu devrait être lu par les lecteurs d'écran lorsque le `<mapml-viewer>`
est focalisé, car il est utilisé pour générer la valeur de l'attribut
`<mapml-viewer aria-label="...">`, si l'auteur n'en fournit pas.
`<map-caption>` peut être le premier ou le dernier élément enfant de `<mapml-viewer>`.

<iframe src="../../../demo/map-caption-demo/" title="MapML Demo" height="410" width="100%" scrolling="no" frameBorder="0"></iframe>

---

## Spécifications

| Specification |
|--------------------------------------------------------------|
| [Pas encore spécifié](https://github.com/Maps4HTML/MapML/issues/234) |

---

## Exigences

[Signaler les problèmes liés à ces exigences sur GitHub](https://github.com/Maps4HTML/HTML-Map-Element-UseCases-Requirements/issues/new?title=-SUMMARIZE+THE+PROBLEM-&body=-DESCRIBE+THE+PROBLEM-)

<p><b><span class="requirement">exigence</span>
<span class="enhancement">amélioration</span>
<span class="impractical">peu pratique</span>
<span class="undecided">indécis</span>
<span class="discussion">en cours de discussion</span></b></p>

| | Spéc. | Visualiseur | API |
|:---------------------------------------------------------------------------------|:------: |:-----: |:---: |
| [**Interprétation des lieux et des positions sur la carte (5.3)**](https://maps4html.org/HTML-Map-Element-UseCases-Requirements/#map-viewers-capabilities-locations) | | | |
| <div class="discussion">Fournir un nom accessible pour une carte</div> | [en cours de discussion](https://github.com/Maps4HTML/HTML-Map-Element-UseCases-Requirements/issues/260) | [provisoire](https://maps4html.org/web-map-doc/docs/elements/map-caption/) | [en cours de discussion](https://github.com/Maps4HTML/HTML-Map-Element-UseCases-Requirements/issues/260) |
---

> - [Modifier cette page sur **Github**](https://github.com/Maps4HTML/web-map-doc/edit/main/docs/elements/map-caption.md)
> - [Discutez avec nous sur **Gitter**](https://gitter.im/Maps4HTML/chat)
1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = {
],
'Mapping Elements': [
'elements/mapml-viewer',
'elements/map-caption',
'elements/layer',
'elements/mapml',
'elements/extent',
Expand Down
49 changes: 49 additions & 0 deletions static/demo/map-caption-demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Demo</title>
<script type="module" src="../../dist/mapml-viewer.js"></script>
<link rel="stylesheet" href="../embeded-demo-style.css"/>

<link rel="stylesheet" href="../codemirror-5.64.0/lib/codemirror.css">
<script src="../codemirror-5.64.0/lib/codemirror.js"></script>
<script src="../codemirror-5.64.0/mode/xml/xml.js"></script>
<script src="../codemirror-5.64.0/mode/css/css.js"></script>
<script src="../codemirror-5.64.0/mode/javascript/javascript.js"></script>
<script src="../codemirror-5.64.0/addon/edit/closetag.js"></script>

</head>
<body>
<div style="text-align: center;">
<!------------------------------------------------- CHANGE THIS ------------------------------------------------->
<h2>MapML Demo: &lt;map-caption&gt;</h2>
<button class="run" onclick="plot()" aria-label="run code"><span aria-hidden="true">▶</span></button>
</div>

<div class="tab">
<button id="default" class="tablinks" onclick="switchTab(event, 'HTML')">HTML</button>
<button class="tablinks" onclick="switchTab(event, 'CSS')">CSS</button>
</div>

<div class="tabcontent" id="HTML">
<!------------------------------------------------- CHANGE THIS ------------------------------------------------->
<textarea rows="10" style="width:100%" id="htmlEditor">
<mapml-viewer projection="OSMTILE" zoom="1" lat="60.0" lon="-100.0" controls>
<map-caption>Example captioned map - Exemple de carte légendée</map-caption>
<layer- label="OpenStreetMap" src="../data/osm.mapml" checked></layer->
</mapml-viewer></textarea>
</div>
<div class="tabcontent" id="CSS">
<!------------------------------------------------- CHANGE THIS ------------------------------------------------->
<textarea rows="10" style="width:100%" id="cssEditor">
</textarea>
</div>

<div id="output"></div>

<script src="../embeded-demo.js"></script>
</body>
</html>