Closed alpglide closed 1 year ago
Never mind. I figured it out.
Let us know if there is anything else.
I was wrong, I thought params in echartsInstance.on('dblclick', function (params) {...}) has lat/lng, but it's old values, not new values. :(
@alpglide You should be able to see all values in the params.
What do you see if you do?
console.error(params)
Here are the Event concept, may give you an idea to where to look: https://apache.github.io/echarts-handbook/en/concepts/event/
console.error(params), params stores all values of a node, include lat/lng, before a user move the node. What I want is the new lat/lng after a user moved the node. thanks again.
@alpglide Check other events like mousemove
for new coordinates.
I will check mousemove. I ask this because when I use echart graph with lots of nodes. after a user moves nodes, I use the following code to find new x,y of each node:
echartsInstance.getModel().getSeriesByIndex(0).getGraph().eachNode(function (node, id) {
var layout = node.getLayout();
if (layout) {
conloe.log("new x=", layout[0], "new y=",layout[1]);
}
});
I just wonder if I can use similar method for nodes on geo map.
thanks
@alpglide That's an option I was thinking about, but one of the events should give you the same information.
Let me know if you find it.
@alpglide Let us know if there is anything else.
I read the example in volkovlabs.io. if we allow users to move the scatter nodes, how can we get new lat/lng of moved nodes?