Skip to content

Commit

Permalink
Create media attribute docs
Browse files Browse the repository at this point in the history
Add map-link disabled attribute description in en and fr

Update description of map-layer media attribute in en and fr

Deprecate zoomin, zoomout links

Add map-style-api.md in fr and en, add to sidebar.js

Add node-version script to package.json

Change docusaurus config to only warn on broken links
  • Loading branch information
prushfor authored and prushforth committed Dec 29, 2024
1 parent b38c371 commit 97e4cf3
Show file tree
Hide file tree
Showing 16 changed files with 7,039 additions and 3,640 deletions.
4 changes: 4 additions & 0 deletions docs/api/layer-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ To get the `<map-layer>`'s opacity value:
let layer = document.querySelector('map-layer');
let opacity = layer.opacity;
```
---
### media

Reflects the [media](../elements/layer#media) attribute of the `<layer->` element.

### extent

Expand Down
15 changes: 15 additions & 0 deletions docs/api/map-link-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ title: HTMLLinkElement
slug: /api/map-link-api
---

# HTMLLinkElement

The `<map-link>` element is intended to implement an extension of the HTML `<link>`
element and `HTMLLinkElement` API. This document reflects proposed changes to that
API and is a work in progress.


## Properties

### media

Reflects the [media](../elements/link#media) attribute of the `<map-link>` element.

---

This document is copied from the old "Custom Rendering API" page, and is under
construction. It will eventually describe the API of the map-link custom element;
the "Custom Rendering API" is currently sourced from the map-link custom element,
Expand Down
46 changes: 46 additions & 0 deletions docs/api/map-style-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
id: map-style-api
title: "HTMLStyleElement"
slug: /api/map-style-api
---

# HTMLStyleElement

The `<map-style>` element is an extension of the HTML `<style>` element and `HTMLStyleElement`
API for map styles. This document reflects proposed changes to that API, and is a work in progress.

## Properties

### media

Reflects the [media](../elements/style#media) attribute of the `<map-style>` element. Map media queries can include map properties including: [projection](../../api/mapml-viewer-api#projection), [zoom](../../api/mapml-viewer-api#zoom),
and [extent](../../api/mapml-viewer-api#extent).

## Specifications

| Specification |
|--------------------------------------------------------------|
| [HTMLStyleElement](https://github.com/Maps4HTML/MapML-Specification/issues/209) |

---

## 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 |
|:---------------------------------------------------------------------------------|:------: |:-----: |:---: |
| [**Properties**](#properties) | none | partial| partial |
| [**Methods**](#methods) | n/a | n/a | n/a|


---

> - [Edit this page on **Github**](https://github.com/Maps4HTML/web-map-doc/edit/main/docs/api/map-style-api.md)
> - [Chat with us on **Gitter**](https://gitter.im/Maps4HTML/chat)
14 changes: 14 additions & 0 deletions docs/elements/layer.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,20 @@ and the fetched `<map-title>` element is used.

---

### `media`

The `media` attribute is used to express map media conditions under which the layer
content should be used (if inline content is present), or loaded from the `src` URL,
if that attribute is present. Map media conditions evaluate to `true` or `false`.
A layer for which the map media condition evaluates to `false` is by default hidden.
A layer for which the map media condition evaluates to `true` is added to the map
according to its `checked` attribute, and is added to the layer control according
to its `hidden` attribute.

Map media queries can include map properties as documented in the [matchMedia](../../api/mapml-viewer-api#matchmedia) API.

---

### `opacity`

The `opacity` attribute is used to set the initial opacity of the `<map-layer>` element.
Expand Down
31 changes: 29 additions & 2 deletions docs/elements/link.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ defines several uses of existing and new `rel` keyword values.
| `tile` | This link relation is used in conjunction with the `tref="..."` attribute to define a URL template that identifies native (server) tile resources. Can be used in conjunction with the `type="..."` attribute to indicate the media type of the remote resource, for example: `type="text/mapml"` tells the polyfill to parse and render the fetched resource as map feature content. This link relation is used with standard Web Map Tile Services (WMTS), and its non-standard equivalents. |
| `image` | The `image` link relation is used similarly to the `tile` link relation, except it tells the polyfill that the remote resources to be fetched are images that will be trimmed (by the server) to exactly match the width and height of the map viewport. This link relation is used with standard Web Map Services (WMS) and its non-standard equivalents. |
| `features` | The `features` link relation tells the polyfill to parse and render the fetched resource as map feature content. |
| `zoomin` | The link `href` is followed automatically by the polyfill when the map is zoomed in by the user to a value greater than the maximimum value of the zoom range of the current layer. The referenced map layer resource replaces the current map layer. The polyfill does not represent this link as a user-visible affordance, it is followed automatically. If the remote resource does not contain a reciprocal `zoomout` link, the map state change is one-way i.e. the layer is permanently replaced. |
| `zoomout` | The link `href` is followed automatically by the polyfill when the map is zoomed out by the user to a value less than the minimum value of the zoom range of the current layer. The referenced map layer resource replaces the current map layer. The polyfill does not represent this link as a user-visible affordance, it is followed automatically. If the remote resource does not contain a reciprocal `zoomin` link, the map state change is one-way i.e. the layer is permanently replaced. |
| ~~`zoomin`~~ | Deprecated. Use the `map-zoom` [map media feature](#media) instead. |
| ~~`zoomout`~~ | Deprecated. Use the `map-zoom` map media feature instead. |
| `legend` | The `legend` link relation designates a link to metadata, typically an image, describing the symbology used by the current layer. Currently, the polyfill creates a hyperlink for the label of the layer in the layer control, which opens in a new browsing context. |
| `query` | The `query` link relation is used in combination with the `tref="..."` attribute to establish a URL template that composes a map query URL based on user map gestures such as click or touch. These URLs are fetched and the response presented on top of the map as a popup. Such queries can return text/html or text/mapml responses. In the latter case, the response may contain more than one feature, in which case a 'paged' popup is generated, allowing the user to cycle through the features' individual metadata. |
| `stylesheet` | The link imports a CSS or [pmtiles](../../user-guide/creating-styles) stylesheet from the `href` value. |
Expand Down Expand Up @@ -81,6 +81,19 @@ The `href` of a `<map-link>` must be a URL value of a resource that can be fetch
The URL can be absolute or relative.

---
### `disabled`

The read-write `disabled` boolean attribute works with `<map-link rel=stylesheet>` and
`<map-link rel="tile | image | features | query">`. When set, it disables and
unloads the stylesheet or map content as applicable. The read-only `disabled`
attribute of the `<map-layer>` and `<map-extent>` elements is updated to reflect
the new calculated visibility of the `<map-layer>` or `<map-extent>`. When the
`disabled` attribute is removed, the linked CSS stylesheet or map content is loaded.
If the layer and extent content that is loaded is visible, the `<map-layer>` or `<map-extent>`
`disabled` attribute is removed accordingly.

---

### `hreflang`

Advisory [language designation](https://datatracker.ietf.org/doc/html/rfc5646) about remote resource.
Expand Down Expand Up @@ -130,6 +143,20 @@ Projection values [defined by the polyfill](../mapml-viewer#projection) include:
| Permitted ARIA roles | No roles permitted. |
| DOM Interface | [HTMLLinkElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement) |

---
### `media`

The `media` attribute is used to express media conditions under which the linked
content should be loaded from its `href` attribute. Media conditions evaluate to `true` or `false`.
A map-link for which the media condition evaluates to `false` is not loaded / unloaded.
Content linked via a map-link for which the media condition evaluates to `true`
is loaded from its `href` attribute; when the condition subsequently evaluates to
`false`, the content is unloaded.

Map media queries can include extended CSS map properties including:
[projection](../../api/mapml-viewer-api#projection), [zoom](../../api/mapml-viewer-api#zoom),
and [extent](../../api/mapml-viewer-api#extent).

---

## Examples
Expand Down
18 changes: 17 additions & 1 deletion docs/elements/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,25 @@ slug: /elements/style/

The `<map-style>` element allows map authors to embed CSS into map layers. The CSS can be used to style the geometry of the layer using [`<map-span>`](../../elements/span/), and by setting the class attribute to the [child elements](../geometry/#child-elements) of the geometry.

## Attributes

### `media`

The `media` attribute is used to express media conditions under which the contained
styles should be applied. Media conditions evaluate to `true` or `false`. A map-style
for which the media condition evaluates to `false` is not loaded / is removed. Styles
contained in a `<map-style>` for which the media condition evaluates to `true`
are applied; when the condition subsequently evaluates to `false`, the styles are removed.
An invalid media condition evaluates to `false`.

Map media queries can include map properties including: [projection](../../api/mapml-viewer-api#projection), [zoom](../../api/mapml-viewer-api#zoom),
and [extent](../../api/mapml-viewer-api#extent).

---

:::note

All the Demo's on the documentation pages contain a "CSS" tab which adds the CSS using the `<map-style>` element dynamically.
All the demo's on the documentation pages contain a "CSS" tab which adds the CSS using the `<map-style>` element dynamically.

:::

Expand Down
2 changes: 1 addition & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
tagline: 'Embed map viewers into your web pages, using HTML only.',
url: 'http://maps4html.org/',
baseUrl: '/web-map-doc/',
onBrokenLinks: 'throw',
onBrokenLinks: 'warn',
onBrokenMarkdownLinks: 'warn',
favicon: 'https://maps4html.org/favicon.ico',
organizationName: 'Maps4HTML', // Usually your GitHub org/user name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ let layer = document.querySelector('map-layer');
let opacity = layer.opacity;
```

---
### media

Reflète l'attribut [media](../elements/layer#media) de l'élément `<map-layer>`.

### extent

`HTMLLayerElement.extent` fournit un accès en LECTURE SEULE aux coordonnées en
Expand Down
14 changes: 14 additions & 0 deletions i18n/fr/docusaurus-plugin-content-docs/current/api/map-link-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ title: HTMLLinkElement
slug: /api/map-link-api
---

# HTMLLinkElement

L'élément `<map-link>` est conçu pour implémenter une extension de l'élément HTML `<link>`
et de l'API `HTMLLinkElement`. Ce document reflète les modifications proposées à cette
API et est en cours de développement.

## Propriétés

### media

Reflète l'attribut [media](../elements/link#media) de l'élément `<map-link>`.

---

Ce document est une copie de l'ancienne page "Custom Rendering API", et est
en cours de construction. Il décrira à terme l'API de l'élément personnalisé map-link ;
l'"API de rendu personnalisé" provient actuellement de l'élément personnalisé map-link,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
id: map-style-api
title: "HTMLStyleElement"
slug: /api/map-style-api
---

# HTMLStyleElement

L'élément `<map-style>` est une extension de l'élément HTML `<style>` et de l'API `HTMLStyleElement`.
Ce document reflète les modifications proposées à cette API et est en cours de développement.

## Propriétés

### media

Reflète l'attribut [media](../elements/style#media) de l'élément `<map-style>`. Les requêtes média pour la carte peuvent inclure des propriétés de carte, notamment : [projection](../../api/mapml-viewer-api#projection), [zoom](../../api/mapml-viewer-api#zoom), et [extent](../../api/mapml-viewer-api#extent).

## Spécifications

| Spécification |
|--------------------------------------------------------------|
| [HTMLStyleElement](https://github.com/Maps4HTML/MapML-Specification/issues/209) |

---

## 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 |
|:---------------------------------------------------------------------------------|:------: |:-----: |:---: |
| [**Propriétés**](#propriétés) | aucun | partiel | partiel |
| [**Méthodes**](#méthodes) | s/o | s/o | s/o |


---

> - [Modifier cette page sur **Github**](https://github.com/Maps4HTML/web-map-doc/edit/main/i18n/fr/docusaurus-plugin-content-docs/current/api/map-style-api.md)
> - [Discutez avec nous sur **Gitter**](https://gitter.im/Maps4HTML/chat)
10 changes: 10 additions & 0 deletions i18n/fr/docusaurus-plugin-content-docs/current/elements/layer.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ Le contenu en ligne utilise l’attribut `label` comme étiquette de texte affi

---

### `media`

L'attribut `media` est utilisé pour exprimer les conditions de média de carte sous lesquelles le contenu de la couche doit être utilisé (si un contenu en ligne est présent) ou chargé à partir de l'URL spécifiée dans l'attribut `src`, si cet attribut est présent. Les conditions de média de carte sont évaluées à `true` ou `false`.
Une couche pour laquelle la condition de média de carte est évaluée à `false` est, par défaut, masquée.
Une couche pour laquelle la condition de média de carte est évaluée à `true` est ajoutée à la carte selon son attribut `checked` et est ajoutée au contrôle des couches en fonction de son attribut `hidden`.

Les requêtes de média de carte peuvent inclure des propriétés de la carte comme documenté dans l'API [matchMedia](../../api/mapml-viewer-api#matchmedia).

---

### `opacity`

L'attribut `opacity` définit l'opacité initiale de l'élément `<map-layer>`. Les valeurs d'`opacity` valides vont de "0.0" à "1.0" et sont reflétées dans le contrôle de couche
Expand Down
Loading

0 comments on commit 97e4cf3

Please sign in to comment.