Answer the question
In order to leave comments, you need to log in
Why does the map behave like this when clicked?
Good day.
Example:
ucheba486.site Clicking
on the red block changes the size of the container for the map. But the map does not change after the container.
How to fix it?
<body>
<div id="starmap"></div>
<div class="btn" id="btn"></div>
<script src="stuquery.min.js"></script>
<script src="virtualsky.min.js"></script>
<script>
S(document).ready(function() {
var planetarium = S.virtualsky({
id: 'starmap',
projection: 'stereo',
latitude: 34.4326,
longitude: -119.86286
});
});
document.getElementById('btn').onclick = function() {
document.getElementById('starmap').classList.add('box--large');
};
</script>
</body>
Answer the question
In order to leave comments, you need to log in
It is not necessary through styles.
It is enough to trigger an event resize
for window
after adding or removing a classbox--large
document.getElementById('btn').onclick = function() {
document.getElementById('starmap').classList.add('box--large');
window.dispatchEvent(new Event('resize'));
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question