Don't create the map until after the div for it is made visible
This commit is contained in:
parent
866f25bc45
commit
0595255d58
1 changed files with 9 additions and 13 deletions
|
@ -55,17 +55,6 @@
|
|||
|
||||
OpenLayers.Lang.setCode("<%= I18n.locale.to_s %>");
|
||||
|
||||
function init() {
|
||||
var centre = new OpenLayers.LonLat(<%= lon %>, <%= lat %>);
|
||||
var zoom = <%= zoom %>;
|
||||
|
||||
var map = createMap("map");
|
||||
|
||||
setMapCenter(centre, zoom);
|
||||
|
||||
map.events.register("click", map, setLocation);
|
||||
}
|
||||
|
||||
function setLocation( e ) {
|
||||
closeMapPopup();
|
||||
|
||||
|
@ -84,8 +73,15 @@
|
|||
function openMap() {
|
||||
$("map").style.display = "block";
|
||||
$("usemap").style.display = "none";
|
||||
}
|
||||
|
||||
window.onload = init;
|
||||
var centre = new OpenLayers.LonLat(<%= lon %>, <%= lat %>);
|
||||
var zoom = <%= zoom %>;
|
||||
|
||||
var map = createMap("map");
|
||||
|
||||
setMapCenter(centre, zoom);
|
||||
|
||||
map.events.register("click", map, setLocation);
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue