schlot

inconsistent map extent/center when transitioning between views

Discussion created by schlot on Apr 29, 2014
Latest reply on Apr 29, 2014 by schlot
I have an application that starts with a menu where the user selects a county, a category of information and then clicks 'Go' to execute.  The execute does a find on a county layer, zooms to that county and switches from the menu view to the map view.  The first time I zoom to the county, it is not centered to my div.  Or maybe it thinks it is, but it's using a div of 400 x 400, the default, which places it in the upper left of my div.

If I switch back to the menu and pick another county, then it is centered and zoomed correctly.  I've tried all sorts of settings to get it to be properly centered on the first county pick, but no luck at all.  All subsequent selections are always fine.

Why is this?  Does anyone have any other suggestions?  I've combed through the forums trying to include all the tricks that make sense.  My map is already defined as autoResize:false and I have listeners to manually resize and reposition.  This isn't enough to take care of my problem.

Here's my fiddle. 
http://jsfiddle.net/schlot/6ufxj/

Outcomes