diff --git a/public/example_templates/netjsonmap.html b/public/example_templates/netjsonmap.html index b88f0c94..80989548 100644 --- a/public/example_templates/netjsonmap.html +++ b/public/example_templates/netjsonmap.html @@ -137,6 +137,8 @@ document.body.appendChild(legends); map.render(); + // Todo: Romove before merge + window.map = map diff --git a/src/js/netjsongraph.util.js b/src/js/netjsongraph.util.js index 2ad84f3e..6a9487a8 100644 --- a/src/js/netjsongraph.util.js +++ b/src/js/netjsongraph.util.js @@ -1193,6 +1193,19 @@ class NetJSONGraphUtil { }, }; } + + moveNodeInRealTime(self, id, location) { + const dataIndex = series.data.findIndex(d => d.node.id === id); + const node = self.data.nodes[dataIndex] + const options = self.echarts.getOption() + const series = options.series.find(s => s.type === 'effectScatter'); + node.location = location + node.properties.location = location + series.data[dataIndex].value = [location.lng, location.lat]; + self.echarts.setOption({ + series: options.series + }); + } } export default NetJSONGraphUtil;