My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 6224: Bug: Rectangle drawing on Chrome
5 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Feb 2014


Sign in to add a comment
 
Reported by [email protected], Jan 9, 2014
Drawing a rectangle using the DrawingManager no longer works on Chrome. 

To reproduce the problem: Click on the rectangle icon and try to draw one before you click/try any other shape.

https://google-developers.appspot.com/maps/documentation/javascript/examples/full/drawing-tools 

Jan 9, 2014
#1 [email protected]
I'm not able to reproduce this problem. What operating system/version of Chrome are you running? Does it work in other browsers?
Status: NeedsMoreInfo
Jan 9, 2014
#2 [email protected]
I tried on 3 different computers, all windows. All 3 worked with FF. I didn't try it on IE. 

The rectangle is not visible as you're drawing it. 1st rect appears as you finish drawing another one. Kind of strange. 

Windows XP Pro or Windows 2008 R2
Chrome Version 32.0.1700.72 m
Jan 9, 2014
#3 [email protected]
Thanks. I'm able to see it on a Windows 7 machine as well. It looks like this may be due to some changes to Chrome on Windows in version 32, but we'll investigate.
Status: Confirmed
Labels: Internal-12476374
Jan 15, 2014
#4 [email protected]
This problem occurs not only on rectangle drawing but polygons and polylines too.
Jan 20, 2014
#5 [email protected]
I am facing same issue. It works in FF and IE but not in chrome.
Jan 20, 2014
#6 [email protected]
Also it is not working new version 32.0.1700.76 m and its working in other system where the chrome version is Version 31.0.1650.63 m.
Jan 21, 2014
#7 [email protected]
A workaround for this issue is to force a repaint on the first drawing interaction with the map.

You can do so, for example, by adding a DOM click listener to the element containing the map (events of the google.maps.Map instance seem to be swallowed by the DrawingManager) and force the repaint as described in http://stackoverflow.com/questions/3485365/how-can-i-force-webkit-to-redraw-repaint-to-propagate-style-changes.

Example (W3C DOM):

mapContainer.addEventListener("click", function(event) {
   var target = event.target;

   target.style.display = "none";
   target.offsetHeight; // triggers reflow and, therefore, repaint
   target.style.display = "block";
});




Jan 21, 2014
#8 [email protected]
That workaround would need to attach a mousemove event to properly draw the shape as the cursor moves.
Jan 21, 2014
#9 [email protected]
I don't know if you or others have tested the workaround I described and please let me know if it doesn't work, but for us it does the job fine on Chrome 32.0.1700.76 m until now.

For what I can tell, it seems that the repaint only needs to be triggered once when you start drawing your first shape.
Jan 27, 2014
#10 [email protected]
The latest Chrome (32.0.1700.102 m) seems to fix the problem.
Jan 30, 2014
#11 [email protected]
I have the latest Chrome (32.0.1700.102 m) and still, when I try to draw a polygon, I cannot see the lines until I change the zoom. It only happens when the zoom level 7 and higher.
Feb 24, 2014
#12 [email protected]
This was fixed for the DrawingManager in particular in v3, but there may have been some lingering issues with overlay geometry due to the underlying bug in Chrome. This has now been fixed in Chrome 33, which is the current stable release for everyone.

The Chrome bug has more details if you're interested: https://code.google.com/p/chromium/issues/detail?id=336676
Status: Fixed
Sign in to add a comment

Powered by Google Project Hosting