Resize to fill the page the viewport of new networkmap.

This commit is contained in:
mdtrooper 2016-05-17 11:44:20 +02:00
parent 5d53de11a7
commit ce06e95900
2 changed files with 17 additions and 1 deletions

View File

@ -183,7 +183,7 @@ abstract class Map {
?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" pointer-events="all" width="<?php echo $width;?>" height="<?php echo $height;?>">
<svg id="svg_map_<?php echo $this->id;?>" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" pointer-events="all" width="<?php echo $width;?>" height="<?php echo $height;?>">
<?php
$this->embedded_symbols_for_firefox();
?>

View File

@ -63,8 +63,24 @@ MapController.prototype._enabled_minimap = true;
MapController.prototype.init_map = function() {
var self = this;
width_svg = $("#map_" + self._id).width();
if ($("#main").height()) {
height_svg = $("#main").height();
}
else {
//Set the height in the pure view (fullscreen).
height_svg = $(window).height() -
$("#menu_tab_frame_view").height() -
20; // 20 of margin
}
var svg = d3.select(self._target + " svg");
svg
.attr("width", width_svg)
.attr("height", height_svg)
self._zoomManager =
d3.behavior.zoom()
.scaleExtent([1/MAX_ZOOM_LEVEL, MAX_ZOOM_LEVEL]).on("zoom", zoom);