You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
4
---
5
5
6
-
## Required Attributes
7
-
-`units` - Coordinate reference system (e.g., "OSMTILE", "WGS84", "CBMTILE", "APSTILE")
6
+
The `<map-extent>` element is a hypertext control that is associated to and represents the
7
+
rectangle of the map viewport, from the user's perspective. Map authors use it
8
+
to compose server requests for layer content. Requests are composed using
9
+
URL templates processed by the browser as the map moves and requires new content
10
+
to paint. The URL templates each contain one or more variable references, with each
11
+
variable reference denoted by the name of the variable enclosed in braces `{}`.
8
12
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
+
Variables are created by the map author using the `<map-input>` element. There are
14
+
several types of `<map-input>`, allowing the map author to reference the corners
15
+
of the extent, its width and height, and its zoom.
13
16
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
+
An example of a `<map-extent>` element being used to load image tiles for a single
| OSMTILE | Web Mercator, with 256px x 256px tiles recursively defined inside a square bounds at zoom = 0|
47
+
| WGS84 | Pseudo plate carrée, with 256px x 256px tiles. Zoom = 0 contains two tiles in two columns, with their origin at -180,90. False easting and northing (pcrs) values inside the projection bounds correspond to longitude and latitude, respectively. |
48
+
| CBMTILE | Lambert Conformal Conic, with 256px x 256px tiles. Zoom levels chosen by scale denominator, so tiles do not nest.|
49
+
50
+
Author-defined values of `units` are possible, using the [Custom projections API](../../api/mapml-viewer-api/#definecustomprojectionoptions)
51
+
52
+
The `units` attribute is required and can't be changed.
53
+
54
+
---
55
+
56
+
### `label`
57
+
58
+
Specifies a label for an extent which is displayed in the layer control. When a `label` value is not provided, the `label` value defaults to 'Sub-Layer' in the layer control.
59
+
60
+
---
61
+
62
+
### `checked`
18
63
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.
64
+
The `checked` attribute and property is boolean. When present, the checked property value is taken to be 'true'; when not present, the property value is 'false'. The map-extent content will be fetched and rendered according to the `checked` state. Beware that it is the *presence* of the attribute that makes it true, not the value of the attribute. For example, the attribute `checked="false"` actually turns out to be checked, [as described by MDN Web docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes#boolean_attributes).
24
65
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
66
+
---
67
+
68
+
### `hidden`
69
+
70
+
The `hidden` attribute and property is boolean. When present, the extent is hidden (not present) in the layer control. Regardless of `hidden` state, the layer is rendered or not depending on the `checked` attribute state.
71
+
72
+
---
73
+
74
+
### `opacity`
75
+
76
+
The `opacity` attribute is used to set the initial opacity of the `<map-extent>` element.
77
+
Valid `opacity` values range from from "0.0" to "1.0" with strictly one demical place and are reflected in the extent settings
78
+
opacity input slider control. When the `opacity` attribute is not present, the opacity is set to "1.0" by default.
79
+
80
+
---
81
+
82
+
## Examples
83
+
84
+
### Multiple Extent
85
+
86
+
The following example shows multiple `<map-extent>` elements in a layer. The different elements can be selected from the three dots menu of the Basemap layer.
30
87
31
-
## Example
32
88
```html
33
-
<map-extentunits="OSMTILE"label="Example tiled sub-layer, default checked, not hidden"checked>
0 commit comments