[ka-Map-users] maintaining scale/extent when switching maps
    Paul Spencer 
    pspencer at dmsolutions.ca
       
    Tue Jul  4 13:15:18 EDT 2006
    
    
  
Steve,
looking at the code, this won't work because it is expecting an array  
of values, not individual value
As a side note, the most reliable way of doing this would be to pass  
the center point and scale rather than the extents because rounding  
issues can cause the map to zoom out one scale level (it tries to fit  
the extents inside view).
function mySwitchMap(map) {
   var extents = myKaMap.getGeoExtents();
   var cx = (extents[2] + extents[0])/2;
   var cy = (extents[3] + extents[1])/2;
   var scale = myKaMap.getCurrentScale();
   myKaMap.selectMap(map, [cx, cy, scale]);
}
Cheers
Paul
On 29-Jun-06, at 5:08 PM, Steve Lime wrote:
> Hi folks: Is there an easy way to maintain scale/extent in the  
> viewport when switching maps? I figured one could do something like:
>
> function mySwitchMap(map) {
>   var extents =  myKaMap.getGeoExtents();
>
>   myKaMap.selectMap(map, extent[0], extent[1], extent[2], extent[3]);
> }
>
> The map switches (although IE needs a mouse click to trigger the  
> switch) but the viewport doesn't preserve the old extent...
>
> Ideas?
>
> Steve
>
>
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users
+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+
    
    
More information about the ka-Map-users
mailing list