Change the code for testing the svg bug.
This commit is contained in:
parent
d154a1a779
commit
c66445d3a5
|
@ -129,7 +129,7 @@ abstract class Map {
|
|||
|
||||
?>
|
||||
|
||||
<div id="map" data-id="<?php echo $this->id;?>" >
|
||||
<div id="map" data-id="<?php echo $this->id;?>" style="border: 1px red solid;">
|
||||
<?php
|
||||
if ($this->width == 0) {
|
||||
$width = "100%";
|
||||
|
@ -144,7 +144,15 @@ abstract class Map {
|
|||
$height = $this->height . "px";
|
||||
}
|
||||
?>
|
||||
<svg style="border: 2px solid red;" pointer-events="all" width="<?php echo $width;?>" height="<?php echo $height;?>">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" pointer-events="all" width="<?php echo $width;?>" height="<?php echo $height;?>">
|
||||
<g class="viewport2">
|
||||
<g class="first">
|
||||
<circle cx="100" cy="100" r="90" fill="green"></circle>
|
||||
</g>
|
||||
<g class="second">
|
||||
<rect x="200" y="200" height="90" width="90" fill="blue"></rect>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
// GNU General Public License for more details.
|
||||
|
||||
/*-------------------Constructor-------------------*/
|
||||
|
||||
var MapController = function(target) {
|
||||
this._target = target;
|
||||
|
||||
|
@ -29,7 +28,6 @@ MapController.prototype._viewport = null;
|
|||
MapController.prototype._zoomManager = null;
|
||||
|
||||
/*--------------------Methods----------------------*/
|
||||
|
||||
/*
|
||||
Function init_map
|
||||
Return void
|
||||
|
@ -70,16 +68,28 @@ This function paint the nodes
|
|||
*/
|
||||
MapController.prototype.paint_nodes = function() {
|
||||
this._viewport.selectAll(".node")
|
||||
.data(nodes)
|
||||
.data(['caca'])
|
||||
.enter()
|
||||
.append("g")
|
||||
.attr("transform",
|
||||
function(d) { return "translate(" + d['x'] + " " + d['y'] + ")";})
|
||||
function(d) { return "translate(300 100)";})
|
||||
.append("circle")
|
||||
.attr("id", function(d) { return "node_" + d['id'];})
|
||||
.attr("id", function(d) { return "node_caca";})
|
||||
.attr("class", "node")
|
||||
.attr("style", "fill: rgb(50, 50, 128);")
|
||||
.attr("r", "6");
|
||||
.attr("r", "60");
|
||||
|
||||
//~ this._viewport.selectAll(".node")
|
||||
//~ .data(nodes)
|
||||
//~ .enter()
|
||||
//~ .append("g")
|
||||
//~ .attr("transform",
|
||||
//~ function(d) { return "translate(" + d['x'] + " " + d['y'] + ")";})
|
||||
//~ .append("circle")
|
||||
//~ .attr("id", function(d) { return "node_" + d['id'];})
|
||||
//~ .attr("class", "node")
|
||||
//~ .attr("style", "fill: rgb(50, 50, 128);")
|
||||
//~ .attr("r", "6");
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue