force a reflow after pinch
This commit is contained in:
@@ -184,6 +184,20 @@ OpenLayers.Control.PinchZoom = OpenLayers.Class(OpenLayers.Control, {
|
||||
location.lon += resolution * ((size.w / 2) - zoomPixel.x);
|
||||
location.lat -= resolution * ((size.h / 2) - zoomPixel.y);
|
||||
|
||||
// Force a reflow before calling setCenter. This is to work
|
||||
// around an issue occuring in iOS.
|
||||
//
|
||||
// See https://github.com/openlayers/openlayers/pull/351.
|
||||
//
|
||||
// Without a reflow setting the layer container div's top left
|
||||
// style properties to "0px" - as done in Map.moveTo when zoom
|
||||
// is changed - won't actually correctly reposition the layer
|
||||
// container div.
|
||||
//
|
||||
// Also, we need to use a statement that the Google Closure
|
||||
// compiler won't optimize away.
|
||||
this.map.div.clientWidth = this.map.div.clientWidth;
|
||||
|
||||
this.map.setCenter(location, zoom);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user