Joke Collection Website - News headlines - How to realize the real-time positioning of Gaode map and get the coordinates and position of the current position?

How to realize the real-time positioning of Gaode map and get the coordinates and position of the current position?

When initializing the map object, add a mouse monitor.

mapObj.addEventListener(mapObj,MOUSE_CLICK,MclickMouse); //mouse click event

MclickMouse is what you want to do after clicking.

The function MclickMouse(param){ // passes in the map object param to get xydocument.getelementbyid ("MapX"). value = param.eventxdocument.getElementById("mapY ")。 value = param.eventY

}

So you can get x and y coordinates.