Remove Renderer.NG related code
This commit is contained in:
@@ -473,50 +473,43 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, {
|
|||||||
moveTo: function(bounds, zoomChanged, dragging) {
|
moveTo: function(bounds, zoomChanged, dragging) {
|
||||||
OpenLayers.Layer.prototype.moveTo.apply(this, arguments);
|
OpenLayers.Layer.prototype.moveTo.apply(this, arguments);
|
||||||
|
|
||||||
// OpenLayers.Renderer.NG is deprecated
|
var coordSysUnchanged = true;
|
||||||
var ng = (OpenLayers.Renderer.NG && this.renderer instanceof OpenLayers.Renderer.NG);
|
if (!dragging) {
|
||||||
if (ng) {
|
this.renderer.root.style.visibility = 'hidden';
|
||||||
dragging || this.renderer.updateDimensions(zoomChanged);
|
|
||||||
} else {
|
|
||||||
var coordSysUnchanged = true;
|
|
||||||
|
|
||||||
if (!dragging) {
|
var viewSize = this.map.getSize(),
|
||||||
this.renderer.root.style.visibility = 'hidden';
|
viewWidth = viewSize.w,
|
||||||
|
viewHeight = viewSize.h,
|
||||||
|
offsetLeft = (viewWidth / 2 * this.ratio) - viewWidth / 2,
|
||||||
|
offsetTop = (viewHeight / 2 * this.ratio) - viewHeight / 2;
|
||||||
|
offsetLeft += parseInt(this.map.layerContainerDiv.style.left, 10);
|
||||||
|
offsetLeft = -Math.round(offsetLeft);
|
||||||
|
offsetTop += parseInt(this.map.layerContainerDiv.style.top, 10);
|
||||||
|
offsetTop = -Math.round(offsetTop);
|
||||||
|
|
||||||
var viewSize = this.map.getSize(),
|
this.div.style.left = offsetLeft + 'px';
|
||||||
viewWidth = viewSize.w,
|
this.div.style.top = offsetTop + 'px';
|
||||||
viewHeight = viewSize.h,
|
|
||||||
offsetLeft = (viewWidth / 2 * this.ratio) - viewWidth / 2,
|
|
||||||
offsetTop = (viewHeight / 2 * this.ratio) - viewHeight / 2;
|
|
||||||
offsetLeft += parseInt(this.map.layerContainerDiv.style.left, 10);
|
|
||||||
offsetLeft = -Math.round(offsetLeft);
|
|
||||||
offsetTop += parseInt(this.map.layerContainerDiv.style.top, 10);
|
|
||||||
offsetTop = -Math.round(offsetTop);
|
|
||||||
|
|
||||||
this.div.style.left = offsetLeft + 'px';
|
|
||||||
this.div.style.top = offsetTop + 'px';
|
|
||||||
|
|
||||||
var extent = this.map.getExtent().scale(this.ratio);
|
|
||||||
coordSysUnchanged = this.renderer.setExtent(extent, zoomChanged);
|
|
||||||
|
|
||||||
this.renderer.root.style.visibility = 'visible';
|
var extent = this.map.getExtent().scale(this.ratio);
|
||||||
|
coordSysUnchanged = this.renderer.setExtent(extent, zoomChanged);
|
||||||
|
|
||||||
// Force a reflow on gecko based browsers to prevent jump/flicker.
|
this.renderer.root.style.visibility = 'visible';
|
||||||
// This seems to happen on only certain configurations; it was originally
|
|
||||||
// noticed in FF 2.0 and Linux.
|
// Force a reflow on gecko based browsers to prevent jump/flicker.
|
||||||
if (OpenLayers.IS_GECKO === true) {
|
// This seems to happen on only certain configurations; it was originally
|
||||||
this.div.scrollLeft = this.div.scrollLeft;
|
// noticed in FF 2.0 and Linux.
|
||||||
}
|
if (OpenLayers.IS_GECKO === true) {
|
||||||
|
this.div.scrollLeft = this.div.scrollLeft;
|
||||||
|
}
|
||||||
|
|
||||||
if(!zoomChanged && coordSysUnchanged) {
|
if (!zoomChanged && coordSysUnchanged) {
|
||||||
for(var i in this.unrenderedFeatures) {
|
for (var i in this.unrenderedFeatures) {
|
||||||
var feature = this.unrenderedFeatures[i];
|
var feature = this.unrenderedFeatures[i];
|
||||||
this.drawFeature(feature);
|
this.drawFeature(feature);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!this.drawn || (!ng && (zoomChanged || !coordSysUnchanged))) {
|
if (!this.drawn || zoomChanged || !coordSysUnchanged) {
|
||||||
this.drawn = true;
|
this.drawn = true;
|
||||||
var feature;
|
var feature;
|
||||||
for(var i=0, len=this.features.length; i<len; i++) {
|
for(var i=0, len=this.features.length; i<len; i++) {
|
||||||
@@ -535,13 +528,9 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, {
|
|||||||
* {Boolean} The layer was redrawn.
|
* {Boolean} The layer was redrawn.
|
||||||
*/
|
*/
|
||||||
redraw: function() {
|
redraw: function() {
|
||||||
// OpenLayers.Renderer.NG is deprecated
|
// this is to force Layer.redraw set zoomChanged
|
||||||
if (OpenLayers.Renderer.NG && this.renderer instanceof OpenLayers.Renderer.NG) {
|
// to true in the moveTo call
|
||||||
this.drawn = false;
|
this.resolution = null;
|
||||||
}
|
|
||||||
this.resolution = null; // this is to force Layer.redraw set
|
|
||||||
// zoomChanged to true in the moveTo
|
|
||||||
// call
|
|
||||||
return OpenLayers.Layer.prototype.redraw.apply(this, arguments);
|
return OpenLayers.Layer.prototype.redraw.apply(this, arguments);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user