If I have a click event associated with my map and then I fire the mousemove event, the click event no longer works. I donβt think anyone knows about this? By the way, this is in version 3.4.
As a simple example:
var map; function initialize() { var myLatlng = new google.maps.LatLng(-34.397, 150.644); var myOptions = { zoom: 8, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); var secondClick = false; var firstClick = false; var firstClickLatLng; var secondClickLatLng; var lines = []; google.maps.event.addListener(map, 'mousemove', function (event) { redrawLine(event); }); google.maps.event.addListener(map, 'click', function (event) { if (!firstClick && !secondClick) { firstClick = true; firstClickLatLng = event.latLng; } else if (firstClick && !secondClick) { secondClick = true; firstClick = false;
Thus, a line is drawn for whenever you move the mouse. The problem is that if I clicked a second time, the click event would not fire.
Ideas?
EDIT
This problem is related: http://www.mail-archive.com/ google-maps-js-api-v3@googlegroups.com /msg15878.html
It clearly does not solve my problem, but others have tried and experienced this.
source share