Skip to content

Commit 0e9362f

Browse files
committed
Initial commit
0 parents  commit 0e9362f

810 files changed

Lines changed: 671404 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: mapml-extent-markup
3+
description: Tells you how to correctly create and edit the markup for a <map-extent> element. Use it when generating MapML output markup in an HTML page.
4+
---
5+
6+
## Required Attributes
7+
- `units` - Coordinate reference system (e.g., "OSMTILE", "WGS84", "CBMTILE", "APSTILE")
8+
9+
## Optional Attributes
10+
- `checked` - Boolean, whether extent is initially enabled
11+
- `hidden` - boolean, hides or shows the extent in the layer control as a "sub-layer" (underneath a layer)
12+
- `label` - string, used to provide non-default label for the sub-layer controls in the layer control
13+
14+
## Child Elements
15+
- `<map-input>` - Required, defines variable inputs for templated URLs
16+
- `<map-link>` - Provides templated URLs for links to tiles, images, features, or queries
17+
18+
19+
## Constraints
20+
- Must be child of `<map-layer>`, either inline or remote
21+
- Must contain one or more `<map-link>` element(s)
22+
- Must contain `<map-input>` elements that define ALL the variables contained in a child `<map-link tref="...{variable}...">` `tref` value
23+
- The `units` value must match one of the supported projection values OR a string that identifies a custom projection defined at runtime.
24+
25+
## Supported Units/Projections
26+
- `OSMTILE` - Web Mercator tile grid, based on EPSG:3857
27+
- `WGS84` - Geographic coordinates, based on CRS:84
28+
- `CBMTILE` - Canada Base Map tile grid based on EPSG:3978
29+
- `APSTILE` - Alaska Polar Stereographic, based on EPSG:5936
30+
31+
## Example
32+
```html
33+
<map-extent units="OSMTILE" label="Example tiled sub-layer, default checked, not hidden" checked>
34+
<map-input name="z" type="zoom" min="0" max="18" value="0"></map-input>
35+
<map-link rel="tile" tref="https://example.com/tiles/{z}/{y}/{x}.png"></map-link>
36+
</map-extent>
37+
```
38+
39+
## Notes
40+
-
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
name: mapml-input-markup
3+
description: Tells you how to correctly create and edit the markup for a <map-input> element. Use it when generating MapML output markup in an HTML page.
4+
---
5+
# MapML `<map-input>` Element Markup Constraints
6+
7+
## Purpose
8+
Document constraints and guidelines for generating valid `<map-input>` elements.
9+
10+
When generating a `<map-input>` element in an HTML file, the closing tag `</map-input>` MUST be used. The `<map-input>...</map-input>` form of markup does not harm the parsing process when using the XML parser, so the HTML form of the element should be used when generating the the element in a standalone (remote) XML-encoded MapML document (`text/mapml`).
11+
12+
## Required Attributes
13+
- `name` - Variable name used in templated URLs
14+
- `type` - Input type (defines the input's purpose)
15+
16+
## Input Types
17+
- `zoom` - Zoom level variable
18+
- `location` - Geographic location, used to serialize one axis of a point relative to the bounding box of either the viewport or a tile.
19+
- `width` - Width dimension of the bounding box
20+
- `height` - Height dimension of the bounding box
21+
- `hidden` - Hidden/constant value. Used for things like access tokens
22+
23+
## Optional Attributes (type-dependent)
24+
- `min` - Minimum value for zoom, or location axis. In the case of location axis, `min` and `max` can be used together on orthogonal axes to establish the bounding box outside of which requests should not be allowed. Such limits are essential
25+
to minimize or constrain server load
26+
- `max` - Maximum value for zoom, or location axis. See `min`.
27+
- `value` - Default/initial value of a `zoom` input, which is required to know what the `min` and `max` values mean (are located) for associated (via variable-associated `<map-link tref={varname}>`s) location inputs, because `row` and `column` values' meaning (location coordinates) are `zoom`-dependent.
28+
- `axis` - Axis name (for location types)
29+
- `units` - Unit coordinate system - values include `pcrs`,`tcrs`,`gcrs`,`tile`,`map`
30+
- `position` - The relative position. Legal values include `top-left`,`bottom-right`. Other values, are theoretically possible, but are not supported at this time.
31+
32+
## Constraints
33+
- Must be child of `<map-extent>`
34+
- `name` value must correspond to variables used in `<map-link tref="{name}">`
35+
- Zoom inputs typically require `min`, `max`, and `value` attributes
36+
37+
## Common Patterns
38+
39+
### Zoom Input
40+
```html
41+
<map-input name="z" type="zoom" min="0" max="18" value="0"></map-input>
42+
```
43+
44+
### Location Inputs
45+
```html
46+
<map-input name="x" type="location" units="tilematrix" axis="column"></map-input>
47+
<map-input name="y" type="location" units="tilematrix" axis="row"></map-input>
48+
```
49+
50+
### Query Click Position Inputs (for WMS GetFeatureInfo)
51+
For `<map-link rel="query">` links, pixel coordinates within the viewport are required:
52+
```html
53+
<map-input name="i" type="location" units="map" axis="i"></map-input>
54+
<map-input name="j" type="location" units="map" axis="j"></map-input>
55+
```
56+
57+
**Important**:
58+
- `units="map"` provides viewport pixel coordinates (origin at top-left)
59+
- `axis="i"` is the horizontal axis (image width)
60+
- `axis="j"` is the vertical axis (image height)
61+
- These correspond to the WMS GetFeatureInfo `I/J` (WMS 1.3.0) or `X/Y` (WMS 1.1.1) parameters
62+
- Do NOT use `units="tile"` for WMS queries (that's for WMTS tile-based services)
63+
64+
## Notes
65+
-
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: mapml-layer-markup
3+
description: Tells you how to correctly create and edit the markup for a <map-layer> element. Use it when generating MapML output markup in an HTML page.
4+
---
5+
6+
# Skill Instructions
7+
# MapML `<map-layer>` Element Markup Constraints
8+
9+
## Purpose
10+
Document constraints and guidelines for generating valid `<map-layer>` elements.
11+
12+
## Required Attributes
13+
- `label` - Display name for the layer, although if the `<map-layer>` has a child `<map-title>`, the latter element's content will supercede the `label`.
14+
15+
## Optional Attributes
16+
- `src` - URL to external MapML document
17+
- `checked` - Boolean, whether layer is rendered on the map
18+
- `hidden` - Boolean, whether layer appears in layer control
19+
- `opacity` - Number between 0 and 1, defaults to 1
20+
21+
## Child Elements
22+
- `<map-extent>` - Defines a "form" that binds to the map viewport, enabling client-server requests to child templated `<map-link>` element(s).
23+
- `<map-link>` - Links to related resources, such as alternates, license info, legends
24+
- `<map-meta>` - Metadata about the layer
25+
26+
## Constraints
27+
- Either `src` attribute OR inline `<map-extent>` must be provided
28+
- Cannot have both `src` and inline content
29+
30+
## Example
31+
```html
32+
<map-layer label="OpenStreetMap" checked>
33+
<map-extent units="OSMTILE">
34+
<!-- extent content -->
35+
</map-extent>
36+
</map-layer>
37+
```
38+
39+
## Notes
40+
-
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
name: mapml-link-markup
3+
description: Tells you how to correctly create and edit the markup for a <map-link> element. Use it when generating MapML output markup in an HTML page.
4+
---
5+
6+
# MapML `<map-link>` Element Markup Constraints
7+
8+
## Purpose
9+
Document constraints and guidelines for generating valid `<map-link>` elements.
10+
11+
## Required Attributes
12+
- `rel` - Relationship type of the link
13+
- Either `href` (static URL) OR `tref` (templated URL)
14+
15+
When the `<map-link>` is found outside of the `<map-extent>` element content, it is not "templated", it is "static", and must not contain the `tref` attribute, and must contain the `href` attribute.
16+
17+
## Templated Link Relationship Types (`rel`)
18+
- `tile` - Raster or vector tile resource (depends on the `type` attribute value)
19+
- `image` - Static image resource that covers the whole viewport
20+
- `features` - Vector features resource that covers the whole viewport
21+
- `query` - Query endpoint templated link (e.g., WMS GetFeatureInfo)
22+
23+
### Query Link Requirements
24+
When generating a `rel="query"` link for WMS GetFeatureInfo:
25+
26+
1. **Template Variables**: Ensure `<map-input>` elements exist for ALL template variables used in the `tref`:
27+
- Bounding box: `{xmin}`, `{ymin}`, `{xmax}`, `{ymax}`
28+
- Dimensions: `{w}`, `{h}`
29+
- Click position: `{i}`, `{j}` (pixel coordinates within the image)
30+
31+
2. **INFO_FORMAT Parameter**: Always include the `INFO_FORMAT` parameter in the query URL template, set to the desired response format (e.g., `text/html`, `application/json`, `text/plain`). This should match a format advertised in the WMS capabilities document.
32+
33+
3. **WMS Version-Specific Parameters**:
34+
- **WMS 1.3.0**: Use `I={i}&J={j}` for click position parameters
35+
- **WMS 1.1.1 and earlier**: Use `X={i}&Y={j}` for click position parameters
36+
- The parameter names changed between WMS versions
37+
38+
4. **QUERY_LAYERS Parameter**: Must be included and typically matches the `LAYERS` parameter value. This specifies which layer(s) to query for feature information.
39+
40+
5. **Coordinate Reference System**: Use the same CRS/SRS parameter as the corresponding `rel="image"` link.
41+
42+
6. **Click Position Inputs**: The `{i}` and `{j}` variables require corresponding `<map-input>` elements with:
43+
- `type="location"`
44+
- `units="map"` (viewport pixel coordinates)
45+
- `axis="i"` and `axis="j"` respectively
46+
47+
**Example WMS 1.3.0 Query Link:**
48+
```html
49+
<map-link rel="query" tref="https://example.com/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&LAYERS=mylayer&QUERY_LAYERS=mylayer&CRS=EPSG:3857&BBOX={xmin},{ymin},{xmax},{ymax}&WIDTH={w}&HEIGHT={h}&INFO_FORMAT=text/html&I={i}&J={j}"></map-link>
50+
```
51+
52+
**Example WMS 1.1.1 Query Link:**
53+
```html
54+
<map-link rel="query" tref="https://example.com/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS=mylayer&QUERY_LAYERS=mylayer&SRS=EPSG:4326&BBOX={xmin},{ymin},{xmax},{ymax}&WIDTH={w}&HEIGHT={h}&INFO_FORMAT=application/json&X={i}&Y={j}"></map-link>
55+
```
56+
57+
## Static Link Relationship Types (`rel`)
58+
- `license` - License information
59+
- `alternate` - Alternate representation
60+
- `stylesheet` - CSS stylesheet or PMTiles stylesheet module (depends on the `type` attribute)
61+
62+
## Optional Attributes
63+
- `type` - MIME type of the resource
64+
- `tms` - Boolean, for TMS tile ordering
65+
66+
## Constraints
67+
- Must be child of `<map-extent>` or `<map-layer>`
68+
- `tref` values can use variable substitution with `{variableName}` syntax
69+
- Variables in `tref` must have corresponding `<map-input>` elements
70+
71+
When generating a `<map-link>` element, the closing tag `</map-link>` MUST be used even if the element permits no content. Never use the empty element `<map-link type="..." />` (XML) form of markup. The `<map-link>...</map-link>` form of markup does not harm the parsing process when using the XML parser, so the HTML form of the element should be used when generating the the element both in HTML documents ("inline") and in a standalone ("remote:) XHTML XML-encoded MapML document (`text/mapml`).
72+
73+
## Example
74+
```html
75+
<!-- Templated tile link -->
76+
<map-link rel="tile" tref="https://example.com/tiles/{z}/{x}/{y}.png"></map-link>
77+
78+
<!-- Static link -->
79+
<map-link rel="license" href="https://example.com/license.html"></map-link>
80+
```
81+
82+
## Notes
83+
-
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: mapml-meta-markup
3+
description: Tells you how to correctly create and edit the markup for a <map-meta> element. Use it when generating MapML output markup in an HTML page or XHTML MapML document.
4+
---
5+
6+
## Required Attributes
7+
- `name` - Metadata property name
8+
- `content` - Metadata value
9+
10+
The `<map-meta>` element should always use closing tag, `<map-meta name="foo" content="bar"></map-meta>` and should not use the XML self-closing style of markup `<map-meta name="foo" content="bar" />`. The element must always be empty/ takes no content besides attributes.
11+
12+
## Common Metadata Properties
13+
- `projection` - Coordinate reference system. Corresponding `content` attribute value must be one of the MapML-defined values `OSMTILE`,`CBMTILE`,`WGS84` or `APSTILE`, or a custom value defined at runtime.
14+
- `zoom` - Zoom level constraints. When `zoom` is used,
15+
`content` is a micro grammar of comma-separated name=value keywords "(min=minimum zoom value,max=maximum zoom value,)(value=current zoom value)" i.e. you can omit the min=n,max=n+m part of the content, but you must at least provide `value=2` (for example).
16+
- `extent` - Spatial bounds. The corresponding `content` value specifies the bounds using `top-left-{axisName}=n.nnn,top-left-{otherAxisName}=n.nnn,bottom-right={axisName}=n.nnn,bottom-right-{axisName}=n.nnn` micro syntax, where `{axisName}` is replaced by the lower-case name of the axis used by the bbox from a coordinate system defined by the projection. e.g. for a gcrs coordinate system in the OSMTILE projection you could use `latitude` and `longitude` or `easting` and `northing`. Coordinate systems' axis names must not be mixed i.e. you can't use pcrs axis names in one corner and gcrs axis names in the other. Using the axis names here allows the `extent` value to be defined in one coordinate system but does not affect the coordinate system used by features as established by the `cs` meta parameter below. i.e. they are independent.
17+
- `cs` - Coordinate system identifier used by <map-geometry> elements if not explicitly specified on the element with a `cs` attribute.
18+
19+
## Optional Attributes
20+
- Attributes vary based on the metadata type
21+
22+
## Constraints
23+
- Can be child of `<map-layer>` or `<map-extent>` or loaded in a remote MapML document as part of a templated response to a `rel=features` link or as part of a MapML response to a templated request for a tile e.g. as established by `<map-link rel="tile" type="text/mapml" tref="...">`
24+
- Used to provide metadata about the map or layer
25+
26+
## Example
27+
```html
28+
<map-meta name="projection" content="OSMTILE"></map-meta>
29+
<map-meta name="zoom" content="min=0,max=18,value=10"></map-meta>
30+
<map-meta name="extent" content="top-left-longitude=-180,top-left-latitude=90,bottom-right-longitude=180,bottom-right-latitude=-90"></map-meta>
31+
```
32+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: mapml-viewer-markup
3+
description: Tells you how to correctly create and edit the markup for a <mapml-viewer> element. Use it when generating MapML output markup in an HTML page.
4+
---
5+
6+
# Skill Instructions
7+
8+
The <mapml-viewer> element is an autonomous HTML custom element. It can be sized using CSS. The <mapml-viewer>
9+
element can contain 0 or more <map-layer> child elements. <map-layer> elements represent the map content. The <mapml-viewer> can also contain a single <map-caption> element which is especially important to describe the purpose of the map for screen reader users.
10+
11+
#### Properties
12+
13+
| Property | Type | Default | Description |
14+
|----------|------|---------|-------------|
15+
| `projection` | `string` | `'OSMTILE'` | The coordinate reference system for the map (`OSMTILE`, `CBMTILE`, `WGS84`, `APSTILE`) |
16+
| `lat` | `number` | 0.0 | Initial latitude center of the map |
17+
| `lon` | `number` | 0.0 | Initial longitude center of the map |
18+
| `zoom` | `number` | 0 | Initial zoom level |
19+
| `controls` | `boolean` | `true` | Show/hide map controls |
20+
| `controlslist` | `string` | - | Space-separated list of controls to show/hide. Values include: `nozoom`,`nofullscreen`,`noscale`,`geolocation`,`noreload`,`nolayer`. Mostly these are used to remove a default control, the exeption being `geolocation`, which is required to include the geolocation button. |
21+
| `width` | `string` | `'300px'` | Width of the map |
22+
| `height` | `string` | `'150px'` | Height of the map |
23+
| `static` | `boolean` | `false` | Disable interactive features like panning, zooming, querying |

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
dist/
3+
.DS_Store

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules/
2+
.github/
3+
*.json
4+
*.css
5+
*.html
6+
*.md

.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"tabWidth": 2,
3+
"useTabs": false,
4+
"semi": true,
5+
"singleQuote": true,
6+
"trailingComma": "es5",
7+
"printWidth": 80,
8+
"arrowParens": "always"
9+
}

node_modules/.bin/he

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)