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) {
|
||||
OpenLayers.Layer.prototype.moveTo.apply(this, arguments);
|
||||
|
||||
// OpenLayers.Renderer.NG is deprecated
|
||||
var ng = (OpenLayers.Renderer.NG && this.renderer instanceof OpenLayers.Renderer.NG);
|
||||
if (ng) {
|
||||
dragging || this.renderer.updateDimensions(zoomChanged);
|
||||
} else {
|
||||
var coordSysUnchanged = true;
|
||||
var coordSysUnchanged = true;
|
||||
if (!dragging) {
|
||||
this.renderer.root.style.visibility = 'hidden';
|
||||
|
||||
if (!dragging) {
|
||||
this.renderer.root.style.visibility = 'hidden';
|
||||
var viewSize = this.map.getSize(),
|
||||
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(),
|
||||
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);
|
||||
this.div.style.left = offsetLeft + 'px';
|
||||
this.div.style.top = offsetTop + 'px';
|
||||
|
||||
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);
|
||||
|
||||
var extent = this.map.getExtent().scale(this.ratio);
|
||||
coordSysUnchanged = this.renderer.setExtent(extent, zoomChanged);
|
||||
this.renderer.root.style.visibility = 'visible';
|
||||
|
||||
this.renderer.root.style.visibility = 'visible';
|
||||
// Force a reflow on gecko based browsers to prevent jump/flicker.
|
||||
// This seems to happen on only certain configurations; it was originally
|
||||
// noticed in FF 2.0 and Linux.
|
||||
if (OpenLayers.IS_GECKO === true) {
|
||||
this.div.scrollLeft = this.div.scrollLeft;
|
||||
}
|
||||
|
||||
// Force a reflow on gecko based browsers to prevent jump/flicker.
|
||||
// This seems to happen on only certain configurations; it was originally
|
||||
// noticed in FF 2.0 and Linux.
|
||||
if (OpenLayers.IS_GECKO === true) {
|
||||
this.div.scrollLeft = this.div.scrollLeft;
|
||||
}
|
||||
|
||||
if(!zoomChanged && coordSysUnchanged) {
|
||||
for(var i in this.unrenderedFeatures) {
|
||||
var feature = this.unrenderedFeatures[i];
|
||||
this.drawFeature(feature);
|
||||
}
|
||||
if (!zoomChanged && coordSysUnchanged) {
|
||||
for (var i in this.unrenderedFeatures) {
|
||||
var feature = this.unrenderedFeatures[i];
|
||||
this.drawFeature(feature);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!this.drawn || (!ng && (zoomChanged || !coordSysUnchanged))) {
|
||||
if (!this.drawn || zoomChanged || !coordSysUnchanged) {
|
||||
this.drawn = true;
|
||||
var feature;
|
||||
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.
|
||||
*/
|
||||
redraw: function() {
|
||||
// OpenLayers.Renderer.NG is deprecated
|
||||
if (OpenLayers.Renderer.NG && this.renderer instanceof OpenLayers.Renderer.NG) {
|
||||
this.drawn = false;
|
||||
}
|
||||
this.resolution = null; // this is to force Layer.redraw set
|
||||
// zoomChanged to true in the moveTo
|
||||
// call
|
||||
// this is to force Layer.redraw set zoomChanged
|
||||
// to true in the moveTo call
|
||||
this.resolution = null;
|
||||
return OpenLayers.Layer.prototype.redraw.apply(this, arguments);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user