shawnshuailin / google-maps-utility-library-v3

Automatically exported from code.google.com/p/google-maps-utility-library-v3
Apache License 2.0
0 stars 0 forks source link

KeyDragZoom buggy in latest Chrome #237

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Demo link or sample code:
http://google-maps-utility-library-v3.googlecode.com/svn/tags/keydragzoom/2.0.9/
examples/visual.html

What steps will reproduce the problem?
1. Open the link with Google Chrome.
2. Using either the visual control or the shift key, if you drag a box QUICKLY 
it would not create the zoom box.

Expected result:
It should be working, allowing me to always drag a box to zoom to. It is fine 
in Firefox, Safari and IE.

Actual result:
Selection fails. Upon releasing my mouse, the drawing animation begins and the 
box traces my mouse until I click again.

Browser / Operating System:
Chrome: Version 25.0.1364.172 m
OS: Windows 7 Ultimate

Additional comments:
I'm not sure if this is related to issue 139 
(https://code.google.com/p/google-maps-utility-library-v3/issues/detail?id=139) 
from over a year ago, so I've flagged a new issue. 

*********************************************************
Tip: Star this issue (next to title) to receive notifications of status
changes against this issue, also used as a gauge for how many people are
interested in seeing it resolved.
*********************************************************

Original issue reported on code.google.com by ro...@rdaresearch.com.au on 19 Mar 2013 at 10:54

GoogleCodeExporter commented 8 years ago
This isn't exactly "me too", because I'm adding a couple of useful clues.

I can duplicate it easily in pretty much any of the official, latest (Dec '12) 
example pages.
Drag quickly, either with shift key or visual control, I get a small document 
icon next to the mouse, while still dragging, but the box (veil) is tiny-sized 
and is not following the mouse.

Worse, in Safari 6 (OS X Lion), doing this a couple of times hoses the browser 
such that new tabs of the same map page,  or clearing cache and reloading same 
page, won't respond at all to KeyDragZoom.  Only quitting Safari, or sometimes 
doing the File / Reset..., restores normal functionality.  There are no errors 
in the JavaScript console.

The attached image is latest Chrome (developer build) and for some reason the 
mouse cursor didn't get snapped.

Here's a clue I hope is useful: in Safari and Chrome, when I press shift, the 
cursor remains a hand, until I move the mouse just any tiny but, then it 
becomes the cross hairs.
If Firefox, where I can't seem to duplicate the problem, the cursor becomes a 
cross hairs instantly upon pressing shift key.

This may not be a KeyDragZoom bug per se, but it is going to probably prevent 
me using it, which is a shame.

Thanks for reading.

Original comment by irisruss...@gmail.com on 27 Mar 2013 at 6:53

Attachments:

GoogleCodeExporter commented 8 years ago
Sorry the image I attached I chose because the cursor is showing.
The "tiny box" that I normally see with this issue can be seen in this other 
shot, but the cursor was not included in the snap.  Also above I said "move the 
mouse just any tiny but"  "but" should be "bit.

And finally, verified:
* @name KeyDragZoom for V3
 * @version 2.0.9 [December 17, 2012] NOT YET RELEASED

Original comment by irisruss...@gmail.com on 27 Mar 2013 at 7:02

Attachments:

GoogleCodeExporter commented 8 years ago
#2 is exactly what I experienced.

I actually did some debugging, comparing the browser events between keydragzoom 
working and keydragzoom not working. The thing I noticed was that if the 
"selectstart" event is not fired after the mousedown event, this problem will 
occur. Not sure if this is something that the Chrome developers will have to 
fix, or whether we can create a workaround.

Original comment by ro...@rdaresearch.com.au on 27 Mar 2013 at 10:09

GoogleCodeExporter commented 8 years ago
I managed to fix this problem by setting the css property -webkit-user-select: 
none; on the veil div.

This can be easily done just by passing the option when enabling the 
keyDragZoom like this:

map.enableKeyDragZoom({
  veilStyle: {
    webkitUserSelect: "none"
  }
});

Original comment by qua...@gmail.com on 28 Jan 2014 at 11:22

GoogleCodeExporter commented 8 years ago
This did the trick. Thanks!

Original comment by ro...@rdaresearch.com.au on 28 Jan 2014 at 11:01