|
3 | 3 | <head> |
4 | 4 | <meta charset="utf-8"> |
5 | 5 | <meta name="viewport" content="width=device-width,initial-scale=1"> |
6 | | - <title>index.html</title> |
7 | | - <script type="module" src="web-map.js"></script> |
8 | | - <style> |
9 | | - html, |
10 | | - body { |
11 | | - height: 100%; |
12 | | - } |
13 | | - * { |
14 | | - margin: 0; |
15 | | - padding: 0; |
16 | | - } |
17 | | - |
18 | | - /* Specifying the `:defined` selector is recommended to style the map |
19 | | - element, such that styles don't apply when fallback content is in use |
20 | | - (e.g. when scripting is disabled or when custom/built-in elements isn't |
21 | | - supported in the browser). */ |
22 | | - map[is="web-map"]:defined { |
23 | | - /* Responsive map. */ |
24 | | - max-width: 100%; |
| 6 | + <title>index-map.html</title> |
| 7 | + <script type="module" src="dist/mapml-viewer.js"></script> |
| 8 | + <style> |
| 9 | + html, |
| 10 | + body { |
| 11 | + height: 100%; |
| 12 | + } |
| 13 | + * { |
| 14 | + margin: 0; |
| 15 | + padding: 0; |
| 16 | + } |
25 | 17 |
|
26 | | - /* Full viewport. */ |
27 | | - width: 100%; |
28 | | - height: 100%; |
| 18 | + /* Specifying the `:defined` selector is recommended to style the map |
| 19 | + element, such that styles don't apply when fallback content is in use |
| 20 | + (e.g. when scripting is disabled or when custom/built-in elements isn't |
| 21 | + supported in the browser). */ |
| 22 | + mapml-viewer:defined { |
| 23 | + /* Responsive map. */ |
| 24 | + max-width: 100%; |
| 25 | + |
| 26 | + /* Full viewport. */ |
| 27 | + width: 100%; |
| 28 | + height: 100%; |
| 29 | + |
| 30 | + /* Remove default (native-like) border. */ |
| 31 | + /* border: none; */ |
| 32 | + } |
29 | 33 |
|
30 | | - /* Remove default (native-like) border. */ |
31 | | - /* border: none; */ |
32 | | - } |
33 | | - |
34 | | - /* Pre-style to avoid FOUC of inline layer- and fallback content. */ |
35 | | - map[is="web-map"]:not(:defined) + img[usemap], |
36 | | - map[is="web-map"]:not(:defined) > :not(area):not(.web-map) { |
37 | | - display: none; |
38 | | - } |
39 | | - /* Ensure inline layer content is hidden if custom/built-in elements isn't |
40 | | - supported, or if javascript is disabled. This needs to be defined separately |
41 | | - from the above, because the `:not(:defined)` selector invalidates the entire |
42 | | - declaration in browsers that do not support it. */ |
43 | | - layer- { |
44 | | - display: none; |
45 | | - } |
46 | | - </style> |
47 | | - <noscript> |
48 | | - <style> |
49 | | - /* Ensure client-side image map fallbacks are displayed if custom/built-in |
50 | | - elements is supported but javascript is disabled. */ |
51 | | - map[is="web-map"]:not(:defined) + img[usemap] { |
52 | | - display: initial; |
53 | | - } |
54 | | - </style> |
55 | | - </noscript> |
| 34 | + /* Pre-style to avoid FOUC of inline layer- and fallback content. */ |
| 35 | + mapml-viewer:not(:defined) > * { |
| 36 | + display: none; |
| 37 | + } |
| 38 | + /* Ensure inline layer content is hidden if custom/built-in elements isn't |
| 39 | + supported, or if javascript is disabled. This needs to be defined separately |
| 40 | + from the above, because the `:not(:defined)` selector invalidates the entire |
| 41 | + declaration in browsers that do not support it. */ |
| 42 | + layer- { |
| 43 | + display: none; |
| 44 | + } |
| 45 | + </style> |
| 46 | + <noscript> |
| 47 | + <style> |
| 48 | + /* Ensure fallback content (children of the map element) is displayed if |
| 49 | + custom/built-in elements is supported but javascript is disabled. */ |
| 50 | + mapml-viewer:not(:defined) > :not(layer-) { |
| 51 | + display: initial; |
| 52 | + } |
| 53 | + </style> |
| 54 | + </noscript> |
56 | 55 | </head> |
57 | 56 | <body> |
58 | | - <map is="web-map" projection="CBMTILE" zoom="2" lat="45" lon="-90" controls> |
| 57 | + <mapml-viewer projection="CBMTILE" zoom="2" lat="45" lon="-90" controls> |
59 | 58 | <layer- label="CBMT" src="https://geogratis.gc.ca/mapml/en/cbmtile/cbmt/" checked></layer-> |
60 | | - </map> |
| 59 | + </mapml-viewer> |
61 | 60 | </body> |
62 | 61 | </html> |
0 commit comments