[OpenLayers-Commits] r11645 - trunk/openlayers/lib/OpenLayers
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Mon Mar 7 06:18:49 EST 2011
Author: crschmidt
Date: 2011-03-07 03:18:45 -0800 (Mon, 07 Mar 2011)
New Revision: 11645
Modified:
trunk/openlayers/lib/OpenLayers/Map.js
Log:
"Controls misbehave in WebKit browsers when vector layers present and map is
rendered"; this fix was presented by Nick M, and reviewed by erilem.
(Closes #2392)
Modified: trunk/openlayers/lib/OpenLayers/Map.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Map.js 2011-03-07 11:15:20 UTC (rev 11644)
+++ trunk/openlayers/lib/OpenLayers/Map.js 2011-03-07 11:18:45 UTC (rev 11645)
@@ -510,6 +510,12 @@
this.div = document.createElement("div");
this.div.style.height = "1px";
this.div.style.width = "1px";
+
+ // Adding this to the DOM is a fix for Safari SVG rendering bugs;
+ // See #2392. On initial render(), it is removed from the dom,
+ // and a new div is added.
+ this.div.style.display = "none";
+ document.body.appendChild(this.div);
}
OpenLayers.Element.addClass(this.div, 'olMap');
@@ -644,6 +650,11 @@
* will be moved from the current to the new container.
*/
render: function(div) {
+ // Fix for Safari SVG rendering bugs; See #2392
+ if(this.div && this.div.parentNode) {
+ this.div.parentNode.removeChild(this.div);
+ }
+
this.div = OpenLayers.Util.getElement(div);
OpenLayers.Element.addClass(this.div, 'olMap');
this.viewPortDiv.parentNode.removeChild(this.viewPortDiv);
More information about the Commits
mailing list