Merge pull request #665 from twpayne/fix-firefox-dom-renderer
Prevent Bootstrap's setting of max-width from infecting map
This commit is contained in:
@@ -104,6 +104,10 @@ ol.renderer.dom.ImageLayer.prototype.renderFrame =
|
|||||||
0);
|
0);
|
||||||
if (image != this.image_) {
|
if (image != this.image_) {
|
||||||
var imageElement = image.getImageElement(this);
|
var imageElement = image.getImageElement(this);
|
||||||
|
// Bootstrap sets the style max-width: 100% for all images, which breaks
|
||||||
|
// prevents the image from being displayed in FireFox. Workaround by
|
||||||
|
// overriding the max-width style.
|
||||||
|
imageElement.style.maxWidth = 'none';
|
||||||
imageElement.style.position = 'absolute';
|
imageElement.style.position = 'absolute';
|
||||||
goog.dom.removeChildren(this.target);
|
goog.dom.removeChildren(this.target);
|
||||||
goog.dom.appendChild(this.target, imageElement);
|
goog.dom.appendChild(this.target, imageElement);
|
||||||
|
|||||||
@@ -315,6 +315,10 @@ ol.renderer.dom.TileLayerZ_.prototype.addTile = function(tile) {
|
|||||||
var tileSize = this.tileGrid_.getTileSize(tileCoord.z);
|
var tileSize = this.tileGrid_.getTileSize(tileCoord.z);
|
||||||
var image = tile.getImage(this);
|
var image = tile.getImage(this);
|
||||||
var style = image.style;
|
var style = image.style;
|
||||||
|
// Bootstrap sets the style max-width: 100% for all images, which breaks
|
||||||
|
// prevents the tile from being displayed in FireFox. Workaround by
|
||||||
|
// overriding the max-width style.
|
||||||
|
style.maxWidth = 'none';
|
||||||
style.position = 'absolute';
|
style.position = 'absolute';
|
||||||
style.left =
|
style.left =
|
||||||
((tileCoord.x - this.tileCoordOrigin_.x) * tileSize.width) + 'px';
|
((tileCoord.x - this.tileCoordOrigin_.x) * tileSize.width) + 'px';
|
||||||
|
|||||||
Reference in New Issue
Block a user