Opened 12 years ago

Closed 12 years ago

#408 closed defect (fixed)

InitialView - view extent doesn't return a zoom level

Reported by: adube Owned by: adube
Priority: major Milestone: 1.2.0
Component: widgets Version: trunk
Keywords: Cc: belug

Description

Issue

When using using a localView with 4 coordinates (extent) or using a resourceView that is not a point with featureserver AND when having a maxZoom set, when attempting to get its "zoomForExtent", the map has no layers yet, so it always returns null instead of the expected zoom level, thus resulting in always having the maxZoom used.

Solution

Instead of applying the center/extent while in the InitialView widget execution, we could listent to the map 'printallwidgetexecutions' event and do that there. That way, the layers would have time to be created and the map would not have zoomed yet as well. Make sure that the map as a baseLayer set.

Change History (4)

comment:1 by adube, 12 years ago

Cc: belug added

comment:2 by adube, 12 years ago

Fixed in r1303.

On map "printallwidgetexecutions", the map isn't ready yet to get a good zoom level using an extent because the div has no size yet, so the size returned is 1px X 1px and messes the whole equation.

We have no choice be to wait for the mapPanel to be fully rendered and its layout done to get that zoom level, thus result in having the map zooming at the original exent/center at first. It's as it was before, but it's a shame we have no choice but to do so.

Requires more tests

I'll leave the ticket open until more tests are done.

comment:3 by belug, 12 years ago

works for me

comment:4 by adube, 12 years ago

Resolution: fixed
Status: newclosed

Thanks belug, I'm closing this ticket now.

Note: See TracTickets for help on using tickets.