[OpenLayers-Users] Change WMS Layer to Single Tile Dynamically

Donald Kerr donald.kerr at dkerr.co.uk
Fri Jan 4 10:24:11 PST 2013


Bart,

 

Although this does work well, I am getting a strange transition onmouseup
prior to OpenLayers rendering the new image. Onmouseup, the existing image
which is 1461px x 1009px is resized to 256px x 256px and is shown
momentarily until the new image is shown. I have tested in IE8, IE8 with
Google Chrome Frame, Chrome and FF: All show exactly the same issue.

 

Here's my code:

 

      myLayer = new OpenLayers.Layer.WMS(

            'My Layer',

            WMS_MapHostsArr,

            {

                  LAYERS: 'OSAll',

                  FORMAT: 'png'

            },

            {

                  isBaseLayer: true,

                  displayInLayerSwitcher: false,

                  //transitionEffect: 'resize',

                  singleTile: false,

                  buffer: 0,

                  visibility: false

            }

      );

      Map.addLayer(myLayer);

 

 

Let me know if you require any further information or example images. I will
add the contents of this email to GitHub.

 

Many thanks.

 

Regards,

 

Donald

 

 

 

From: Bart van den Eijnden [mailto:bartvde at opengeo.org] 
Sent: 04 January 2013 16:19
To: Donald Kerr
Cc: openlayers-users at lists.osgeo.org
Subject: Re: [OpenLayers-Users] Change WMS Layer to Single Tile Dynamically

 

A very late reply that this is now possible in OL master:

 

https://github.com/openlayers/openlayers/pull/821

 

so basically just call layer.addOptions({singleTile: true}) for instance.

 

Best regards,

Bart

 

-- 
Bart van den Eijnden
OpenGeo - http://opengeo.org <http://opengeo.org/> 
Expert service straight from the developers.

 

 

 

On Apr 17, 2012, at 7:24 PM, Donald Kerr <donald.kerr at dkerr.co.uk> wrote:





I have a WMS layer where I would like to be able to switch between
"singleTile: false" and "singleTile: true" dynamically as the user zooms to
a certain level. Is this possible to do?

I know that I can create two layers and switch baselayers by checking the
map.zoom on the layer.loadstart event but it would be nice to be able to
change the WMS layer options dynamically.

Thanks.

Donald

_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users

 

No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.2805 / Virus Database: 2637/6007 - Release Date: 01/03/13

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130104/f033a5c9/attachment-0001.html>


More information about the Users mailing list