Changes between Version 2 and Version 3 of SettingZoomLevels
- Timestamp:
- 08/18/06 23:34:52 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SettingZoomLevels
v2 v3 58 58 * '''Preset zoom levels''' - ''!ZoomLevels are determined by pre-set arrays of scale or resolution'' 59 59 * {{{scales}}} - The 'resolutions' array is filled with these scales, each directly converted to resolution. 60 Example: 61 {{{ 62 var options = { scales: [50000000, 30000000, 10000000, 5000000] }; 63 map = new OpenLayers.Map( $('map') , options); 64 }}} 65 60 66 * {{{resolutions}}} - The 'resolutions' array is taken directly from the options. 61 67 Example: 68 {{{ 69 var options = { resolutions: [1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125] }; 70 map = new OpenLayers.Map( $('map') , options); 71 }}} 62 72 * '''Minimums and Maximums''' - ''!ZoomLevels are determined based on a maximum resolution and the number of desired !ZoomLevels'' 63 73 * Determining maxResolution 64 74 * {{{minScale}}} - Resolution value is translated from scale using {{{units}}} 75 Example: 76 {{{ 77 var options = { minScale: 50000000 }; 78 map = new OpenLayers.Map( $('map') , options); 79 }}} 65 80 * {{{maxExtent}}} AND {{{maxResolution == "auto"}}} - Resolution is calculated based on map's div size and the maxExtent property. If maxExtent is not specified, a default value is inherited from the map. 81 Example: 82 {{{ 83 var options = { maxResolution: "auto", 84 maxExtent: new OpenLayers.Bounds(-180, -90, 90, 180) }; 85 map = new OpenLayers.Map( $('map') , options); 86 }}} 66 87 * {{{maxResolution}}} - Resolution value is taken directly from the value specified in the layer options. If no value specified, the default is taken from the map. 88 Example: 89 {{{ 90 var options = { maxResolution: 0.17578125 }; 91 map = new OpenLayers.Map( $('map') , options); 92 }}} 67 93 * Determining numZoomLevels 68 94 * Calculated based on ratio of maxResolution to minResolution 69 95 * Determining minResolution 70 96 * {{{maxScale}}} - Resolution value is translated from scale using {{{units}}} 97 Example: 98 {{{ 99 var options = { maxScale: 10000000 }; 100 map = new OpenLayers.Map( $('map') , options); 101 }}} 71 102 * {{{minExtent}}} AND {{{minResolution == "auto"}}} - Resolution is calculated based on map's div size and the minExtent property. minExtent ''must be'' specified, as a default value is '''NOT''' inherited from the map. 103 Example: 104 {{{ 105 var options = { minResolution: "auto", 106 minExtent: new OpenLayers.Bounds(-1, -1, 1, 1) }; 107 map = new OpenLayers.Map( $('map') , options); 108 }}} 72 109 * {{{minResolution}}} - Resolution value is taken directly from the value specified in the layer options. If no value specified, minResolutions remains null, and numZoomLevels is taken directly (below) 110 Example: 111 {{{ 112 var options = { minResolution: 0.0439453125 }; 113 map = new OpenLayers.Map( $('map') , options); 114 }}} 73 115 * {{{numZoomLevels}}} - numZoomLevels value is taken directly from the value specified in the layer options. If no value is specified, the default is taken from the map. 116 Example: 117 {{{ 118 var options = { numZoomLevels: 5 }; 119 map = new OpenLayers.Map( $('map') , options); 120 }}}
