Trigger map.updateSize() via a custom event
This commit is contained in:
parent
b507f6c887
commit
7ff77d9d3d
2 changed files with 5 additions and 4 deletions
|
@ -71,6 +71,10 @@ function createMap(divName, options) {
|
||||||
});
|
});
|
||||||
map.addLayer(markers);
|
map.addLayer(markers);
|
||||||
|
|
||||||
|
$("#" + divName).on("resized", function () {
|
||||||
|
map.updateSize();
|
||||||
|
});
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,10 +35,7 @@
|
||||||
<% end -%>
|
<% end -%>
|
||||||
$("#map").width(content_width - sidebar_width - left_border - right_border);
|
$("#map").width(content_width - sidebar_width - left_border - right_border);
|
||||||
$("#map").height(content_height - top_border - bottom_border);
|
$("#map").height(content_height - top_border - bottom_border);
|
||||||
|
$("#map").trigger("resized");
|
||||||
<% if params[:controller] == "site" and params[:action] == "index" -%>
|
|
||||||
map.updateSize();
|
|
||||||
<% end -%>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleResize() {
|
function handleResize() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue