From 4c894fd04ab4ed69744c047f5dc2cf29ff0f3ef4 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 9 Feb 2016 16:18:05 +0100 Subject: [PATCH] Fixed the young javascript code. --- pandora_console/include/class/Map.class.php | 2 +- .../include/javascript/map/MapController.js | 29 ++++++++++++------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/pandora_console/include/class/Map.class.php b/pandora_console/include/class/Map.class.php index 4489755cea..509faa9915 100644 --- a/pandora_console/include/class/Map.class.php +++ b/pandora_console/include/class/Map.class.php @@ -84,7 +84,7 @@ abstract class Map { ?>
- +
diff --git a/pandora_console/include/javascript/map/MapController.js b/pandora_console/include/javascript/map/MapController.js index 4a1c2a873f..f2425c41df 100644 --- a/pandora_console/include/javascript/map/MapController.js +++ b/pandora_console/include/javascript/map/MapController.js @@ -25,17 +25,24 @@ MapController.prototype._id = null; // Methods MapController.prototype.init_map = function() { - $(this._target + " svg").append( - $("").append( - $("") - .attr("id", "node_10") - .attr("class", "node") - .attr("cx", "100") - .attr("cy", "100") - .attr("style", "fill: rgb(128, 186, 39);") - .attr("r", "5") - ) - ); + var svg = d3.select("#map svg"); + + svg.append("g").append("circle") + .attr("id", "node_10") + .attr("class", "node") + .attr("cx", "100") + .attr("cy", "100") + .attr("style", "fill: rgb(128, 186, 39);") + .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(); };