[OpenLayers-Dev] Usage of OpenLayers.Layer.Image: problem with IE in small resolutions

Cédric MOULLET cedric.moullet at gmail.com
Wed Jul 7 02:48:28 EDT 2010


Thanks Tim for these hints !
Cédric

On Tue, Jul 6, 2010 at 10:27 PM, Tim Schaub <tschaub at opengeo.org> wrote:

> On 7/5/10 7:08 AM, Cédric MOULLET wrote:
> > Hi,
> > I try to use OpenLayers.Layer.Image in order to create an opacity layer
> > (in order to hide partially the orthophoto, in this case). The layer is
> > defined with:
> >
> > var voidLayer = new OpenLayers.Layer.Image("voidLayer",
> > 'gfx/ol/white.png',
> >                  new
> OpenLayers.Bounds.fromArray(this.baseConfig.maxExtent),
> >                  new OpenLayers.Size(1, 1), {
> >              displayInLayerSwitcher: false,
> >              visibility: false,
> >              transitionEffect: 'resize',
> >              resolutions: this.baseConfig.pixelmapResolutions
> >          });
> >
> > - white.png is a white 1x1 px image
> >
> > This works very well in FF and IE for scale higher than 1:100'000:
> >
> http://mf-geoadmin0i.bgdi.admin.ch/?zoom=4&X=152100&Y=565025&bgOpacity=80&bgLayer=voidLayer
> > <
> http://mf-geoadmin0i.bgdi.admin.ch/?zoom=4&X=152100&Y=565025&bgOpacity=80&bgLayer=voidLayer
> >
> >
> > But, for smaller scale, it doesn't work for IE (but still work for FF):
> >
> http://mf-geoadmin0i.bgdi.admin.ch/?zoom=5&X=152100&Y=565025&bgOpacity=80&bgLayer=voidLayer
> > <
> http://mf-geoadmin0i.bgdi.admin.ch/?zoom=5&X=152100&Y=565025&bgOpacity=80&bgLayer=voidLayer
> >
> >
> > After investigation, it seems that the image size is huge: "overflow:
> > hidden; position: absolute; z-index: 1; left: -6562px; top: -9689px;
> > width: 24000px; height: 16000px;" This is normal, but it seems that IE
> > doesn't like that. Is this limitation already known ? Do you see any
> > workaround (or other ways to create an opacity layer) ?
> >
>
> We did notice this limitation sometime shortly after adding the Image
> layer.  A quick workaround is to use a white.png that is bigger than 1x1.
>
> If you want to wander from the API, you could set the following:
>
>     layer.tile.imgDiv.style.backgroundColor = "white"
>
> Tim
>
> > Thanks,
> > Cédric
> >
> >
> >
> > --
> > Welcome to my world: http://www.cedricmoullet.com/
> > My Linked In profile: http://www.linkedin.com/in/cedricmoullet
> > Twitter: http://twitter.com/cedricmoullet
> >
> >
> >
> > _______________________________________________
> > Dev mailing list
> > Dev at openlayers.org
> > http://openlayers.org/mailman/listinfo/dev
>
>
> --
> Tim Schaub
> OpenGeo - http://opengeo.org
> Expert service straight from the developers.
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>



-- 
Welcome to my world: http://www.cedricmoullet.com/
My Linked In profile: http://www.linkedin.com/in/cedricmoullet
Twitter: http://twitter.com/cedricmoullet
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20100707/cee104b6/attachment.html


More information about the Dev mailing list