New SVG2 renderer for increased performance and smaller library size. Not enabled by default. To use, include 'SVG2' in the renderers array of your OpenLayers.Layer.Vector instance. r=crschmidt (closes #2802)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@11616 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -472,34 +472,38 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, {
|
||||
moveTo: function(bounds, zoomChanged, dragging) {
|
||||
OpenLayers.Layer.prototype.moveTo.apply(this, arguments);
|
||||
|
||||
var coordSysUnchanged = true;
|
||||
var ng = (this.renderer instanceof OpenLayers.Renderer.NG);
|
||||
if (ng) {
|
||||
zoomChanged && this.renderer.updateDimensions();
|
||||
} else {
|
||||
var coordSysUnchanged = true;
|
||||
|
||||
if (!dragging) {
|
||||
this.renderer.root.style.visibility = "hidden";
|
||||
if (!dragging) {
|
||||
this.renderer.root.style.visibility = "hidden";
|
||||
|
||||
this.div.style.left = -parseInt(this.map.layerContainerDiv.style.left) + "px";
|
||||
this.div.style.top = -parseInt(this.map.layerContainerDiv.style.top) + "px";
|
||||
var extent = this.map.getExtent();
|
||||
coordSysUnchanged = this.renderer.setExtent(extent, zoomChanged);
|
||||
this.div.style.left = -parseInt(this.map.layerContainerDiv.style.left) + "px";
|
||||
this.div.style.top = -parseInt(this.map.layerContainerDiv.style.top) + "px";
|
||||
var extent = this.map.getExtent();
|
||||
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 || zoomChanged || !coordSysUnchanged) {
|
||||
if (!this.drawn || (!ng && (zoomChanged || !coordSysUnchanged))) {
|
||||
this.drawn = true;
|
||||
var feature;
|
||||
for(var i=0, len=this.features.length; i<len; i++) {
|
||||
@@ -510,6 +514,20 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* APIMethod: redraw
|
||||
* Redraws the layer. Returns true if the layer was redrawn, false if not.
|
||||
*
|
||||
* Returns:
|
||||
* {Boolean} The layer was redrawn.
|
||||
*/
|
||||
redraw: function() {
|
||||
if (this.renderer instanceof OpenLayers.Renderer.NG) {
|
||||
this.drawn = false;
|
||||
}
|
||||
return OpenLayers.Layer.prototype.redraw.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* APIMethod: display
|
||||
* Hide or show the Layer
|
||||
|
||||
Reference in New Issue
Block a user