Hi, apologies for the cross post, but Chris indicated that mapbuilder  
was also looking for a solution to this problem.  And thanks to Chris  
for helping me to solve this one.

My problem: when using OL with singleTile layers, I need to be able  
to allow users to zoom to arbitrary extents.  OL internally keeps a  
list of fixed resolutions and snaps to those, meaning that zooming to  
extents often has the appearance of being 'buffered' somewhat.  In  
some cases, zooming results in panning.

My solution:

assuming that I can track when I am only using singleTile layers, and  
that I always use zoomToExtent:

if (this.bSingleTile) {
      var viewSize = this.oMapOL.getSize();
      var idealResolution = Math.max( extent.getWidth()  / viewSize.w,
                                     extent.getHeight() / viewSize.h );
      this.oMapOL.baseLayer.resolutions = [idealResolution];
      this.oMapOL.zoom = 1;
}
this.oMapOL.zoomToExtent(extent);

Cheers

Paul
+-----------------------------------------------------------------+
|Paul Spencer                          [EMAIL PROTECTED]    |
+-----------------------------------------------------------------+
|Chief Technology Officer                                         |
|DM Solutions Group Inc                http://www.dmsolutions.ca/ |
+-----------------------------------------------------------------+






-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
mapbuilder-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-devel

Reply via email to