0c88ccdf81e3c54789a1f5abaa6f0324488d5423
2 from Products
.CMFCore
.utils
import getToolByName
6 thumbSize
= context
.getThumbnailSize()
7 options
['thumbnailWidth'] = thumbSize
['width']
8 options
['thumbnailHeight'] = thumbSize
['height']
9 options
['tileSize'] = context
.tileSize
11 options
['zoomLevels'] = []
13 for zoom
in context
.getAvailableZooms() :
14 level
= int(zoom
* 100)
16 levelInfos
['zoomlevel'] = level
17 rawSize
= (context
.width
, context
.height
)
18 orientation
= context
.tiffOrientation()
20 rawSize
= rawSize
[::-1]
21 size
= map(lambda x
: int(round(x
*zoom
)), rawSize
)
22 levelInfos
['width'], levelInfos
['height'] = size
24 nbTiles
= map(lambda x
: int(ceil(float(x
) / context
.tileSize
)), size
)
25 levelInfos
['tileX'], levelInfos
['tileY'] = nbTiles
27 options
['zoomLevels'].append(levelInfos
)
29 context
.REQUEST
.RESPONSE
.setHeader('Content-Type', 'text/xml;;charset=utf-8')
30 return context
.tiling_infos_template(**options
)