ol3+ needs size update, fixes #47

This commit is contained in:
Bartek Fabiszewski 2018-01-29 18:52:46 +01:00
parent 018d5e698e
commit 9ffc851abe
4 changed files with 14 additions and 3 deletions

View File

@ -193,3 +193,7 @@ function gm_authFailure() {
message += '<br><br>' + lang['gmapilink'];
showModal(message);
};
function updateSize() {
// ignore
}

View File

@ -229,4 +229,6 @@ function expandUrl(url) {
return urls;
}
function updateSize() {
// ignore
}

View File

@ -26,7 +26,7 @@ var loadedAPI = 'openlayers3';
function init() {
addCss('https://openlayers.org/en/v4.3.2/css/ol.css', 'ol3css');
addCss('https://openlayers.org/en/v4.6.4/css/ol.css', 'ol3css');
var controls = [
new ol.control.Zoom(),
@ -409,3 +409,7 @@ function zoomToBounds(b) {
var bounds = ol.proj.transformExtent(b, 'EPSG:4326', 'EPSG:900913');
map.getView().fit(bounds);
}
function updateSize() {
map.updateSize();
}

View File

@ -113,6 +113,7 @@ function toggleMenu(i) {
ebutton.style.right = '165px';
ebutton.innerHTML = '»';
}
updateSize();
}
function getXHR() {
@ -493,7 +494,7 @@ function loadMapAPI(api) {
} else {
addScript('js/api_openlayers3.js', 'mapapi');
urls.push('//cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList')
urls.push('//openlayers.org/en/v4.3.2/build/ol.js');
urls.push('//openlayers.org/en/v4.6.4/build/ol.js');
}
waitAndLoad(mapapi, urls);
}