[OpenLayers-Dev] Fractional Zoom with Grid layers - Artifacts

James Lamanna james at touchtable.com
Fri Aug 3 10:04:20 PDT 2012


Hi,
I'm working on an application that requires that there be fractional 
zoom capability for almost all layers.
I've been working with some XYZ layers with fractionalZoom (by setting 
serverResolutions), however, I noticed that there are nasty white 
grid-line artifacts that show up when on non integral zoom levels.

Upon reviewing what is going on, the artifacts are generated as a result 
of scaling the layer <div>. I believe that this approach should be 
changed to scale the tile images, rather than the layer div.

So, transformDiv() would have code in it like this:

transformDiv: function(scale) {
     $(this.div).find('img').css('width',
	function(i,v){ return v * scale; });
     $(this.div).find('img').css('height',
         function(i,v) { return v * scale; });
     $(this.div).find('img').css('left',
         function(i, v) { return v * scale; });
     $(this.div).find('img').css('top',
         function(i, v) { return v * scale; });

....

This appears to remove the tile artifacts.

Thanks.

-- James


More information about the Dev mailing list