Changed some examples from viewport length and width to percent.
This commit is contained in:
parent
f90a55ec20
commit
b8c1e60424
@ -13,8 +13,8 @@ title: Leaflet class diagram
|
|||||||
maxBounds: bounds
|
maxBounds: bounds
|
||||||
});
|
});
|
||||||
|
|
||||||
map.getContainer().style.width = '100vw';
|
map.getContainer().style.width = '100%';
|
||||||
map.getContainer().style.height= '100vh';
|
map.getContainer().style.height= '100%';
|
||||||
document.body.style.margin = 0;
|
document.body.style.margin = 0;
|
||||||
|
|
||||||
var image = L.imageOverlay('class-diagram.png', bounds).addTo(map);
|
var image = L.imageOverlay('class-diagram.png', bounds).addTo(map);
|
||||||
|
@ -6,8 +6,8 @@ css: "body {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
html, body, #map {
|
html, body, #map {
|
||||||
height: 100vh;
|
height: 100%;
|
||||||
width: 100vw;
|
width: 100%;
|
||||||
}"
|
}"
|
||||||
---
|
---
|
||||||
<script>
|
<script>
|
||||||
|
@ -19,8 +19,8 @@ First we'll take a look at the HTML & CSS code of the page. To make our map
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
html, body, #map {
|
html, body, #map {
|
||||||
height: 100vh;
|
height: 100%;
|
||||||
width: 100vw;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
Also, we need to tell the mobile browser to disable unwanted scaling of the page and set it to its actual size by placing the following line in the `head` section or our HTML page:
|
Also, we need to tell the mobile browser to disable unwanted scaling of the page and set it to its actual size by placing the following line in the `head` section or our HTML page:
|
||||||
|
Loading…
Reference in New Issue
Block a user