[OpenLayers-Trac] [OpenLayers] #3514: After change of map.size layers won't be displayed correct while scrolling the map.

OpenLayers trac-20090302 at openlayers.org
Fri Sep 23 04:53:27 EDT 2011


#3514: After change of map.size layers won't be displayed correct while scrolling
the map.
----------------------------+-----------------------------------------------
 Reporter:  JensPeters      |       Owner:             
     Type:  bug             |      Status:  new        
 Priority:  minor           |   Milestone:  Maintenance
Component:  Map             |     Version:  2.11 RC3   
 Keywords:  map size layer  |       State:             
----------------------------+-----------------------------------------------
 I am using the following code to change the height of a map.
 After doing so I encounter a strange scrolling behaviour of the map.
 When I scroll the map down (left click and holding; move the mouse
 downwards) only by a littel distance the vector layers were not drawn at
 the correct positions. Further on the base layer (open street map) was
 "jumping" up as if it was scrolled upwards by a large distance.

 {{{
 function changeMapHeight(byHeight) {
     if (byHeight != null) {
         // Check that map.size.h isn't larger than 1200
         // or less than 500.
         if ((this.map.size.h == 1200 && byHeight > 0) ||
             (this.map.size.h == 500 && byHeight < 0)) {
           return;
         }
         // Change the map height.
         this.map.size.h += byHeight;
         // Change th height of the div element.

         this.map.div.style.height = (this.map.size.h + 'px');
         this.map.updateSize();
     }
 }
 }}}

 I found a workaround in the internet. Zooming in and out again will solve
 the problem.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3514>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list