"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) git-svn-id: http://svn.openlayers.org/trunk/openlayers@11645 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -510,6 +510,12 @@ OpenLayers.Map = OpenLayers.Class({
|
|||||||
this.div = document.createElement("div");
|
this.div = document.createElement("div");
|
||||||
this.div.style.height = "1px";
|
this.div.style.height = "1px";
|
||||||
this.div.style.width = "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');
|
OpenLayers.Element.addClass(this.div, 'olMap');
|
||||||
@@ -644,6 +650,11 @@ OpenLayers.Map = OpenLayers.Class({
|
|||||||
* will be moved from the current to the new container.
|
* will be moved from the current to the new container.
|
||||||
*/
|
*/
|
||||||
render: function(div) {
|
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);
|
this.div = OpenLayers.Util.getElement(div);
|
||||||
OpenLayers.Element.addClass(this.div, 'olMap');
|
OpenLayers.Element.addClass(this.div, 'olMap');
|
||||||
this.viewPortDiv.parentNode.removeChild(this.viewPortDiv);
|
this.viewPortDiv.parentNode.removeChild(this.viewPortDiv);
|
||||||
|
|||||||
Reference in New Issue
Block a user