| Issue 1659: | Incorrect latLng reported in click & dblclick events after panning, Firefox 3.5 | |
| 12 people starred this issue and may be notified of changes. | Back to list |
Description: The latLng property of the mouse event object, passed to the callback of the "click" and "dblclick" (and possibly other) events is incorrect after panning the map, as if the panning (the center change) of the map has been ignored. I have verified that the placement of the marker works correctly and that in fact the coordinates in the latLng object are wrong. This may probably be the same as the following bug report: https://code.google.com/p/gmaps-api-issues/issues/detail?id=1621 Steps to reproduce: The simple HTML source code below reproduces the problem. Tested in: Firefox 3.5 @ Mac OS X 10.5.8 Firefox 3.5.2 @ Windows XP SP 2 Code to reproduce: <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <title>Google Maps JavaScript API v3 Example: Event Simple</title> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript"> var map; function initialize() { var myLatlng = new google.maps.LatLng(-25.363882,131.044922); var myOptions = { zoom: 4, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); google.maps.event.addListener(map, 'click', function(e) { var point = e.latLng; if (point) { var marker = new google.maps.Marker({ map: map, position: point }); } }); } </script> </head> <body style="margin:0px; padding:0px;" onload="initialize()"> <div id="map_canvas" style="width:100%; height:100%"></div> </body> </html>
Sep 3, 2009
#1
d.l%[email protected]
Status:
NeedsMoreInfo
Sep 3, 2009
- expected behavior I expect the sample HTML to produce the following behavior: wherever I click on the map, to get (the same) marker moved right under the point where I've clicked. Say I click on New York, the marker should appear over New York. If then I pan the map west-to-east and click on San Francisco, I expect the marker to appear there. - actual behavior If I don't pan the map, the behavior is as expected. If I pan the map, the markers stop appearing under the clicking position and instead, appear offset (in fact, with the amount of pixels I've panned the map). - step-by-step bulleted list of how to reproduce, starting from page load 1. Load the sample HTML. 2. Move the map somehow: with the keyboard, with the mouse using drag and drop, or with the map pan control -- does not matter. 3. Click somewhere -- the marker does not appear under the mouse cursor, but instead is offset with the amount of pixels the map was panned in step 2. That's it. Again: I expect the property latLng, which I receive via the mouse event object in my "click"-callback function, to represent the actual latitude/longitude of the clicked spot, even if the map was panned. I have tested this HTML under Safari 4 on Mac OS X and this problem does not exist. Even after panning, the marker always appears right at the spot where one clicks on the map. I have observed the odd behavior only under FF 3.5, both on Mac OS & Windows XP.
Sep 3, 2009
Sorry, I tested on the wrong version of FF earlier, I've now confirmed the issue you're seeing, which turned out to be very apparent! This in fact is a duplicate of Issue 1621 , but your issue report is very useful and will help us track this down. Thanks for filing!
Status:
Duplicate
Labels: Internal-2078966 Browser-FF Mergedinto: 1621
Sep 3, 2009
After some additional testing, this issue looks subtly different than Issue 1621 . Filed a separate issue internally for both cases.
Status:
Confirmed
Labels: -Internal-2078966 Internal-2100022 Mergedinto: -1621
Sep 8, 2009
Issue 1664 has been merged into this issue.
Sep 10, 2009
(No comment was entered for this change.)
Status:
FixedNotReleased
Sep 11, 2009
(No comment was entered for this change.)
Status:
Fixed
Labels: Fixed14
Sep 11, 2009
(No comment was entered for this change.)
Labels:
-Fixed14 Fixed-14
Oct 6, 2010
This issue is now "live back" into Android 1.6 browser. The symptoms and the actions that must be taken to reproduce the bug are EXACTLY the same. Test can be done at: http://www.mcfoi.it/gmapsv3/wgmob2.htm Did I miss anything?
Oct 6, 2010
Yes.. ..I did miss the Issue 2552 which describes the same problem as this issue but happening in Android 1.6. Note: the Issue 2552 is title "[...] WebView" but the problem can be experienced also from the standard browser. |
|
| ► Sign in to add a comment |