OpenLayers OpenLayers

Ticket #1582: px.patch

File px.patch, 4.7 kB (added by wallyatkins, 7 months ago)

use units when setting style width and height

  • lib/OpenLayers/Control/PanZoomBar.js

    old new  
    186186                                              this.zoomStopHeight), 
    187187                                      imgLocation + "zoombar.png",  
    188188                                      "absolute", null, "crop"); 
    189             div.style.height = sz.h
     189            div.style.height = sz.h + "px"
    190190        } else { 
    191191            div = OpenLayers.Util.createDiv( 
    192192                        'OpenLayers_Control_PanZoomBar_Zoombar' + this.map.id, 
  • lib/OpenLayers/Layer/VirtualEarth.js

    old new  
    9595        // create div and set to same size as map 
    9696        var veDiv = OpenLayers.Util.createDiv(this.name); 
    9797        var sz = this.map.getSize(); 
    98         veDiv.style.width = sz.w
    99         veDiv.style.height = sz.h
     98        veDiv.style.width = sz.w + "px"
     99        veDiv.style.height = sz.h + "px"
    100100        this.div.appendChild(veDiv); 
    101101 
    102102        try { // crash prevention 
  • lib/OpenLayers/Renderer/VML.js

    old new  
    9898    setSize: function(size) { 
    9999        OpenLayers.Renderer.prototype.setSize.apply(this, arguments); 
    100100 
    101         this.rendererRoot.style.width = this.size.w
    102         this.rendererRoot.style.height = this.size.h
     101        this.rendererRoot.style.width = this.size.w + "px"
     102        this.rendererRoot.style.height = this.size.h + "px"
    103103 
    104         this.root.style.width = this.size.w
    105         this.root.style.height = this.size.h
     104        this.root.style.width = this.size.w + "px"
     105        this.root.style.height = this.size.h + "px"
    106106    }, 
    107107 
    108108    /** 
     
    169169                 
    170170                node.style.left = ((geometry.x/resolution)+xOffset).toFixed(); 
    171171                node.style.top = ((geometry.y/resolution)-(yOffset+height)).toFixed(); 
    172                 node.style.width = width
    173                 node.style.height = height;     
     172                node.style.width = width + "px"
     173                node.style.height = height + "px"; 
    174174                node.style.flip = "y"; 
    175175                 
    176176                // modify style/options for fill and stroke styling below 
     
    310310         
    311311        var width = Math.round(style.graphicWidth || size * aspectRatio); 
    312312        var height = Math.round(style.graphicHeight || size); 
    313         node.style.width = width
    314         node.style.height = height
     313        node.style.width = width + "px"
     314        node.style.height = height + "px"
    315315         
    316316        // Three steps are required to remove artefacts for images with 
    317317        // transparent backgrounds (resulting from using DXImageTransform 
     
    327327            image = this.createNode("olv:imagedata", node.id + "_image"); 
    328328            node.appendChild(image); 
    329329        } 
    330         image.style.width = width
    331         image.style.height = height
     330        image.style.width = width + "px"
     331        image.style.height = height + "px"
    332332        image.src = style.externalGraphic; 
    333333        image.style.filter = 
    334334            "progid:DXImageTransform.Microsoft.AlphaImageLoader(" +  
     
    413413            // Set the internal coordinate system to draw the path 
    414414            node.style.left = scaledBox.left; 
    415415            node.style.top = scaledBox.top; 
    416             node.style.width = scaledBox.getWidth()
    417             node.style.height = scaledBox.getHeight()
     416            node.style.width = scaledBox.getWidth() + "px"
     417            node.style.height = scaledBox.getHeight() + "px"
    418418     
    419419            node.coordorigin = scaledBox.left + " " + scaledBox.top; 
    420420            node.coordsize = scaledBox.getWidth()+ " " + scaledBox.getHeight(); 
     
    535535     
    536536            var diameter = radius * 2; 
    537537             
    538             node.style.width = diameter
    539             node.style.height = diameter
     538            node.style.width = diameter + "px"
     539            node.style.height = diameter + "px"
    540540        } 
    541541    }, 
    542542 
     
    640640     
    641641        node.style.left = geometry.x/resolution; 
    642642        node.style.top = geometry.y/resolution; 
    643         node.style.width = geometry.width/resolution
    644         node.style.height = geometry.height/resolution
     643        node.style.width = geometry.width/resolution + "px"
     644        node.style.height = geometry.height/resolution + "px"
    645645    }, 
    646646 
    647647    /**