Fractional Zoom with Grid layers - Artifacts

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Fractional Zoom with Grid layers - Artifacts

James Lamanna
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
_______________________________________________
Dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-dev
Reply | Threaded
Open this post in threaded view
|

Re: Fractional Zoom with Grid layers - Artifacts

James Lamanna
I realized that this is the wrong approach.
However, it seems that increasing the width and height of a tile to
257%/257% (in the case of an XYZ layer), appears to make the artifacts
go away. I'll spend some time trying to find a reasonable approach
across all browsers and layer types.

-- James

On 8/3/2012 10:04 AM, James Lamanna wrote:

> 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

_______________________________________________
Dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-dev