[OpenLayers-Users] change untiled layer width/height

Christopher Schmidt crschmidt at metacarta.com
Wed Oct 14 12:10:09 EDT 2009


On Wed, Oct 14, 2009 at 07:31:29AM -0700, Pere Roca Ristol wrote:
> 
> 
>   hi,
>   I need my untiled layers to be exactly the size of the map. I don't know
> the reason why if my map object is 700x350px, the Untiled layers are
> 1050x525
> 
>   These layers need to be exactly this size because I want to print the map
> (and if on server-side I ask 700x350, the resulting image will be different
> than on screen because of scale). What user see must be what will get.
> 
>   I assume this behaviour is because of performance (when panning and
> zooming...), but could I change it? have already tried to
> myUntiled.mergeNewParams({width:'700'}) and... (without success)

set the 'ratio' option to 1:

   var untiled = new OpenLayers.Layer.WMS.Untiled( " WMS",
                 "http://mywms",
                 {layers:
 [],transparent:"true",format:t_img_format,styles:[],width:'700',height:'350'},
   {'ratio': 1});

- Chris

> 
>   thanks!
>   Pere
> -- 
> View this message in context: http://n2.nabble.com/change-untiled-layer-width-height-tp3823124p3823124.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users

-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list