diff --git a/Gruntfile.js b/Gruntfile.js
index 4c40f6bf1..cc282a581 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -23,8 +23,7 @@ module.exports = function(grunt) {
},
dist: {
files: {
- 'dist/mapml-viewer.js': ['<%= rollup.main.dest %>'],
- 'dist/web-map.js': ['<%= rollup.webmap.dest %>']
+ 'dist/mapml-viewer.js': ['<%= rollup.main.dest %>']
}
}
},
@@ -200,10 +199,6 @@ module.exports = function(grunt) {
main: {
dest: 'dist/mapmlviewer.js',
src: 'src/mapml/index.js' // Only one source file is permitted
- },
- webmap: {
- dest: 'dist/webmap.js',
- src: 'src/mapml/index-web-map.js' // Only one source file is permitted
}
},
prettier: {
diff --git a/index.html b/index.html
index 96ea53c63..1b253e79e 100644
--- a/index.html
+++ b/index.html
@@ -25,7 +25,7 @@
/* Full viewport. */
width: 100%;
- height: 100%;
+ height: 50%;
/* Remove default (native-like) border. */
border: none;
@@ -45,13 +45,44 @@
contain-intrinsic-size: 304px 154px;
}
- /* Ensure inline layer content is hidden if custom/built-in elements isn't
- supported, or if javascript is disabled. This needs to be defined separately
- from the above, because the `:not(:defined)` selector invalidates the entire
- declaration in browsers that do not support it. */
- layer- {
- display: none;
- }
+ /* Specifying the `:defined` selector is recommended to style the map
+ element, such that styles don't apply when fallback content is in use
+ (e.g. when scripting is disabled or when custom/built-in elements isn't
+ supported in the browser). */
+ map[is="web-map"]:defined {
+ /* Responsive map. */
+ max-width: 100%;
+
+ /* Full viewport. */
+ width: 100%;
+ height: 50%;
+
+ /* Remove default (native-like) border. */
+ border: none;
+
+ vertical-align: middle;
+ }
+
+ /* Pre-style to avoid Layout Shift. */
+ map[is="web-map"]:not(:defined) {
+ display: inline-block;
+ contain: size;
+ contain-intrinsic-size: 304px 154px;
+ }
+
+ /* Pre-style to avoid FOUC of inline layer- and fallback content. */
+ map[is="web-map"]:not(:defined) + img[usemap],
+ map[is="web-map"]:not(:defined) > :not(area):not(.mapml-web-map) {
+ display: none;
+ }
+
+ /* Ensure inline layer content is hidden if custom/built-in elements isn't
+ supported, or if javascript is disabled. This needs to be defined separately
+ from the above, because the `:not(:defined)` selector invalidates the entire
+ declaration in browsers that do not support it. */
+ layer- {
+ display: none;
+ }
@@ -84,20 +128,46 @@
-
-
-
- All cuisines
- African
- Asian
- Cajun
- Indian
- Italian
- Mexican
-
-
-
-
+
+
+
+ All cuisines
+ African
+ Asian
+ Cajun
+ Indian
+ Italian
+ Mexican
+
+
+
+
+