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);
|
||||
|
||||
$("#" + divName).on("resized", function () {
|
||||
map.updateSize();
|
||||
});
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,10 +35,7 @@
|
|||
<% end -%>
|
||||
$("#map").width(content_width - sidebar_width - left_border - right_border);
|
||||
$("#map").height(content_height - top_border - bottom_border);
|
||||
|
||||
<% if params[:controller] == "site" and params[:action] == "index" -%>
|
||||
map.updateSize();
|
||||
<% end -%>
|
||||
$("#map").trigger("resized");
|
||||
}
|
||||
|
||||
function handleResize() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue