g3ortega / polygonzo

Automatically exported from code.google.com/p/polygonzo
Other
0 stars 0 forks source link

Regions getting clipped #16

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Using the demo (http://code.google.com/p/polygonzo/), Start on 50 States, DC 
& Puerto Rico
2. Load "California" map (I do this when California is clicked, but I tested 
this in the demo as well)
3. Load the "50 States..." map again

What is the expected output? 
Expect to see full map

What do you see instead?
Top left of California is clipped.
When returning to 50 states, all of US is clipped (except Alaska)

What version of the product are you using? On what operating system?
Github Commit 5db0d03ec471801e804e2d2a15deb3e2d9e9668a
Using Chrome 22.0.1229.94 m on Windows 7

Please provide any additional information below.

zooming or panning shows the proper shapes again, but any zooming afterwards 
causes more strange clipping in different ways after panning and zooming.

Seems to be caused when Google Maps does a pan and zoom (Possibly in 
zoomToBounds()).  Doesn't seem happen when the map 'jumps' to the new zoom 
level and center, but only when it animates.

Original issue reported on code.google.com by tom.piet...@gmail.com on 10 Oct 2012 at 5:36

GoogleCodeExporter commented 9 years ago

Original comment by m...@mg.to on 11 Oct 2012 at 5:39

GoogleCodeExporter commented 9 years ago
While playing around, I noticed that increasing the first timeout in the 
"polys" function in polymap.js seems to prevent this problem.  My suspicion is 
that the redraw needs to wait until the zoom animation is finished.  I didn't 
see anything in Google Maps to that effect, but I'm still looking.

I upped the timeout from 20ms to 1000 to be sure it was after the zoom 
animation, but I believe something shorter could be used.

Original comment by tom.piet...@gmail.com on 17 Oct 2012 at 6:45

GoogleCodeExporter commented 9 years ago
Nice work, thanks! Yes, that is along similar lines to what I was thinking. I'd 
tried using the map idle event, but it seems to fire before the panning/zooming 
is done. I was going to experiment with an initial redraw followed by a timer 
which trigger a second redraw if a move or resize is detected (ugh).

In the meantime the longer timer like you're using seems like a fine workaround.

Original comment by m...@mg.to on 24 Oct 2012 at 1:50

GoogleCodeExporter commented 9 years ago
I also tried the map idle event, with the same results.

I had some good results drawing using a single-shot idle event handler, created 
in the zoom event handler, but never got it quite right...

Currently I'm using a 400ms timer as a workaround, which has been working well 
enough.  I will let you know if I turn up anything else useful.

Original comment by tom.piet...@gmail.com on 25 Oct 2012 at 1:57