Coding style: dont use local variable when it's not necessary, remove new lines.

No functional changes, tests pass on FF2, IE6, IE7 and safari 3.0.4 windows.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@5552 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Frédéric Junod
2007-12-21 07:28:05 +00:00
parent c056118b59
commit 2447848e7f
2 changed files with 7 additions and 21 deletions
+5 -15
View File
@@ -61,10 +61,9 @@ OpenLayers.Renderer.SVG = OpenLayers.Class(OpenLayers.Renderer.Elements, {
*/ */
supported: function() { supported: function() {
var svgFeature = "http://www.w3.org/TR/SVG11/feature#SVG"; var svgFeature = "http://www.w3.org/TR/SVG11/feature#SVG";
var supported = (document.implementation && return (document.implementation &&
(document.implementation.hasFeature("org.w3c.svg", "1.0") || (document.implementation.hasFeature("org.w3c.svg", "1.0") ||
document.implementation.hasFeature(svgFeature, "1.1"))); document.implementation.hasFeature(svgFeature, "1.1")));
return supported;
}, },
/** /**
@@ -95,7 +94,6 @@ OpenLayers.Renderer.SVG = OpenLayers.Class(OpenLayers.Renderer.Elements, {
var resolution = this.getResolution(); var resolution = this.getResolution();
// If the resolution has changed, start over changing the corner, because // If the resolution has changed, start over changing the corner, because
// the features will redraw. // the features will redraw.
if (!this.localResolution || resolution != this.localResolution) { if (!this.localResolution || resolution != this.localResolution) {
@@ -103,7 +101,6 @@ OpenLayers.Renderer.SVG = OpenLayers.Class(OpenLayers.Renderer.Elements, {
this.top = extent.top / resolution; this.top = extent.top / resolution;
} }
var left = 0; var left = 0;
var top = 0; var top = 0;
@@ -139,9 +136,6 @@ OpenLayers.Renderer.SVG = OpenLayers.Class(OpenLayers.Renderer.Elements, {
this.rendererRoot.setAttributeNS(null, "height", this.size.h); this.rendererRoot.setAttributeNS(null, "height", this.size.h);
}, },
/** /**
* Method: getNodeType * Method: getNodeType
* *
@@ -290,9 +284,7 @@ OpenLayers.Renderer.SVG = OpenLayers.Class(OpenLayers.Renderer.Elements, {
* {DOMElement} The specific render engine's root element * {DOMElement} The specific render engine's root element
*/ */
createRenderRoot: function() { createRenderRoot: function() {
var id = this.container.id + "_svgRoot"; return this.nodeFactory(this.container.id + "_svgRoot", "svg");
var rendererRoot = this.nodeFactory(id, "svg");
return rendererRoot;
}, },
/** /**
@@ -302,9 +294,7 @@ OpenLayers.Renderer.SVG = OpenLayers.Class(OpenLayers.Renderer.Elements, {
* {DOMElement} The main root element to which we'll add vectors * {DOMElement} The main root element to which we'll add vectors
*/ */
createRoot: function() { createRoot: function() {
var id = this.container.id + "_root"; return this.nodeFactory(this.container.id + "_root", "g");
var root = this.nodeFactory(id, "g");
return root;
}, },
/************************************** /**************************************
+2 -6
View File
@@ -361,9 +361,7 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
* {DOMElement} The specific render engine's root element * {DOMElement} The specific render engine's root element
*/ */
createRenderRoot: function() { createRenderRoot: function() {
var id = this.container.id + "_vmlRoot"; return this.nodeFactory(this.container.id + "_vmlRoot", "div");
var rendererRoot = this.nodeFactory(id, "div");
return rendererRoot;
}, },
/** /**
@@ -374,9 +372,7 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
* {DOMElement} The main root element to which we'll add vectors * {DOMElement} The main root element to which we'll add vectors
*/ */
createRoot: function() { createRoot: function() {
var id = this.container.id + "_root"; return this.nodeFactory(this.container.id + "_root", "v:group");
var root = this.nodeFactory(id, "v:group");
return root;
}, },
/************************************** /**************************************