mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Fixed the young javascript code.
This commit is contained in:
parent
1d6b9dfc19
commit
4c894fd04a
@ -84,7 +84,7 @@ abstract class Map {
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<div id="map" data-id="<?php echo $this->id;?>" >
|
<div id="map" data-id="<?php echo $this->id;?>" >
|
||||||
<svg style="border: 2px solid red;" pointer-events="all" width="800" height="800"><g><circle id="node_10" class="node" cx="100" cy="100" style="fill: rgb(128, 186, 39);" r="5">
|
<svg style="border: 2px solid red;" pointer-events="all" width="800px" height="800px">
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -25,17 +25,24 @@ MapController.prototype._id = null;
|
|||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
MapController.prototype.init_map = function() {
|
MapController.prototype.init_map = function() {
|
||||||
$(this._target + " svg").append(
|
var svg = d3.select("#map svg");
|
||||||
$("<g>").append(
|
|
||||||
$("<circle>")
|
svg.append("g").append("circle")
|
||||||
.attr("id", "node_10")
|
.attr("id", "node_10")
|
||||||
.attr("class", "node")
|
.attr("class", "node")
|
||||||
.attr("cx", "100")
|
.attr("cx", "100")
|
||||||
.attr("cy", "100")
|
.attr("cy", "100")
|
||||||
.attr("style", "fill: rgb(128, 186, 39);")
|
.attr("style", "fill: rgb(128, 186, 39);")
|
||||||
.attr("r", "5")
|
.attr("r", "5");
|
||||||
)
|
|
||||||
);
|
svg.append("g").append("circle")
|
||||||
|
.attr("id", "node_11")
|
||||||
|
.attr("class", "node")
|
||||||
|
.attr("cx", "200")
|
||||||
|
.attr("cy", "200")
|
||||||
|
.attr("style", "fill: rgb(255, 0, 0);")
|
||||||
|
.attr("r", "10");
|
||||||
|
|
||||||
this.init_events();
|
this.init_events();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user