I am using the following snippet for displaying the cursor position (latitude & longitude) on the map, but I am not able to see the tooltip when I move my mouse cursor over map. But when I check the javascript console the latitude and longitude based on the position of the mouse cursor movement is displayed as you can see in the screenshot below.
google.maps.event.addListener(that.map, 'mousemove', function(event) {
displayCoordinates(event.latLng);
});
function displayCoordinates(pnt) {
var lat = pnt.lat();
lat = lat.toFixed(4);
var lng = pnt.lng();
lng = lng.toFixed(4);
console.log("Latitude: " + lat + " Longitude: " + lng);
}
I have used console.log
to display the coordinates which indicates that the snippet is correct. Is there any way to use an infowindow or some work around with which I can see the coordinates on the map itself?