setting tile size

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

setting tile size

dncarreira
How is it possible to set the tile size to a custom size?
 
Regardless of the map size the tile size is always 256x256.
Does the map div set the map size? For instance, setting width and height of the map div to 400x300 sets the size of the map object?
When I try a 400x300 map I still download 29 tiles, each being 256x256... which seems too much for such a small map.
 
Can anyone shed some light on this please?
 
Thanks,
Duarte

_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: setting tile size

Bart van den Eijnden (OSGIS)-2
Hi,

When creating the map or layer, add a tileSize option:

  Map('map', {'tileSize': new OpenLayers.Size(512,512)});

Best regards,
Bart

Duarte Carreira schreef:

> How is it possible to set the tile size to a custom size?
>  
> Regardless of the map size the tile size is always 256x256.
> Does the map div set the map size? For instance, setting width and
> height of the map div to 400x300 sets the size of the map object?
> When I try a 400x300 map I still download 29 tiles, each being
> 256x256... which seems too much for such a small map.
>  
> Can anyone shed some light on this please?
>  
> Thanks,
> Duarte
> ------------------------------------------------------------------------
>
> _______________________________________________
> Dev mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/dev
>  


--
Bart van den Eijnden
OSGIS, Open Source GIS
[hidden email]
http://www.osgis.nl

_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: setting tile size

dncarreira
In reply to this post by dncarreira
Bart,

Thanks.

Also about setting the size of the map and number of tiles. Is this possible? How does OpenLayers calculate the number of tiles?

Duarte

-----Mensagem original-----
De: Bart van den Eijnden (OSGIS) [mailto:[hidden email]]
Enviada: terça-feira, 7 de Novembro de 2006 21:01
Para: Duarte Carreira
Cc: [hidden email]
Assunto: Re: [OpenLayers-Dev] setting tile size

Hi,

When creating the map or layer, add a tileSize option:

  Map('map', {'tileSize': new OpenLayers.Size(512,512)});

Best regards,
Bart

Duarte Carreira schreef:

> How is it possible to set the tile size to a custom size?
>  
> Regardless of the map size the tile size is always 256x256.
> Does the map div set the map size? For instance, setting width and
> height of the map div to 400x300 sets the size of the map object?
> When I try a 400x300 map I still download 29 tiles, each being
> 256x256... which seems too much for such a small map.
>  
> Can anyone shed some light on this please?
>  
> Thanks,
> Duarte
> ----------------------------------------------------------------------
> --
>
> _______________________________________________
> Dev mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/dev
>  


--
Bart van den Eijnden
OSGIS, Open Source GIS
[hidden email]
http://www.osgis.nl

_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: setting tile size

Bart van den Eijnden (OSGIS)-2
In reply to this post by dncarreira
Hi Duarte,

OpenLayers creates a buffer (default value of 2 rows/columns) of tiles
around the map image, you can influence this using:

When creating a layer, add a 'buffer' option, and set it to '1':

  Layer('WMS', 'http://url', {'map':'foo'}, {'buffer':1});

You can set the size of mapping using css:

        #map {
            width: 768px;
            height: 512px;
        }

which corresponds in my case to:
<div id="map">

Best regards,
Bart

--
Bart van den Eijnden
OSGIS, Open Source GIS
http://www.osgis.nl


--------- Oorspronkelijk bericht --------
Van: Duarte Carreira <[hidden email]>
Naar: Bart van den Eijnden OSGIS <[hidden email]>
Cc: [hidden email]
Onderwerp: RE: [OpenLayers-Dev] setting tile size
Datum: 08/11/06 07:37

> Bart,
>
> Thanks.
>
> Also about setting the size of the map and number of tiles. Is this
possible? How does OpenLayers calculate the number of tiles?

>
> Duarte
>
> -----Mensagem original-----
> De: Bart van den Eijnden (OSGIS) [mailto:[hidden email]]
> Enviada: terça-feira, 7 de Novembro de 2006 21:01
> Para: Duarte Carreira
> Cc: [hidden email]
> Assunto: Re: [OpenLayers-Dev] setting tile size
>
> Hi,
>
> When creating the map or layer, add a tileSize option:
>
>   Map('map', {'tileSize': new OpenLayers.Size(512,512)});
>
> Best regards,
> Bart
>
> Duarte Carreira schreef:
> &gt; How is it possible to set the tile size to a custom size?
> &gt;  
> &gt; Regardless of the map size the tile size is always 256x256.
> &gt; Does the map div set the map size? For instance, setting width and
> &gt; height of the map div to 400x300 sets the size of the map object?
> &gt; When I try a 400x300 map I still download 29 tiles, each being
> &gt; 256x256... which seems too much for such a small map.
> &gt;  
> &gt; Can anyone shed some light on this please?
> &gt;  
> &gt; Thanks,
> &gt; Duarte
> &gt;
----------------------------------------------------------------------

> &gt; --
> &gt;
> &gt; _______________________________________________
> &gt; Dev mailing list
> &gt; [hidden email]
> &gt; http://openlayers.org/mailman/listinfo/dev
> &gt;  
>
>
> --
> Bart van den Eijnden
> OSGIS, Open Source GIS
> [hidden email]
> http://www.osgis.nl
>
>
>



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