Changeset 990 for ZCO/branches/zco3

Show
Ignore:
Timestamp:
10/13/07 09:47:42 (3 years ago)
Author:
jlivni
Message:

add zoom level limitation capabilities and some initial draft tilecache options

Location:
ZCO/branches/zco3/src/zco
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • ZCO/branches/zco3/src/zco/browser/session.py

    r849 r990  
    114114        self.data['previousextent'] = self.extent.totuple() 
    115115 
    116         # Assert that the zoom-in limit is not violated 
    117         if self.context.zoomInLimit > 0: 
    118             # Calculate the map scale for the requested extent 
    119             view = View(srs=createObject('zco.srs', self.context.spatialReferenceSystem), 
    120                                          bbox=extent.totuple(), 
    121                                          units=self.context.mapUnits) 
    122             scale = view.getscaledenominator(self.size) 
    123             if scale < self.context.zoomInLimit: 
    124                 log.info('Map bound at scale 1:%s' % self.context.zoomInLimit) 
    125                 v = view.getviewforscale(self.context.zoomInLimit, self.size) 
    126                 extent = BoundingBox(v.ul.x, v.lr.y, v.lr.x, v.ul.y) 
    127116 
    128117        # Assert that the maximum extent limit is not violated 
  • ZCO/branches/zco3/src/zco/interfaces.py

    r967 r990  
    290290        default=(-180.0, -90.0, 180.0, 90.0)) 
    291291 
    292     zoomInLimit = Int( 
    293         title=_("Zoom-in limit"), 
     292    zoomLevels = Int( 
     293        title=_("Zoom Levels"), 
    294294        description=_("Constrains the map user interface so that users " 
    295                       "are unable to zoom-in past a given map scale. " 
    296                       "The value expected here is a map scale denominator. " 
    297                       "For example, to limit the users at the scale of " 
    298                       "1:20000, enter the value 20000 here. Leave the " 
    299                       "field blank to disable the feature."), 
     295                      "are unable to zoom-in past this number of zoom levels. " 
     296                      "Level 0 refers to the max extent of the map, and each. " 
     297                      "additional level shows 4 times more detail. " 
     298                      "The default is 16.  As an example, Google Maps currently " 
     299                      "has approx 20 zoom levels, depending on the layer."), 
    300300        default=0, 
    301301        required=False)