ESRI.ArcGIS.ADF.IMS
MinScale Property
See Also 
ESRI.ArcGIS.ADF.IMS.Carto.Layer Namespace > Layer Class : MinScale Property




Gets or sets the minimum scale at which the layer displays.

Syntax

Visual Basic (Declaration) 
Public Overridable Property MinScale As String
Visual Basic (Usage)Copy Code
Dim instance As Layer
Dim value As String
 
instance.MinScale = value
 
value = instance.MinScale
C# 
public virtual string MinScale {get; set;}

Example

For an example, see MaxScale .

Remarks

This is the scale at which, as you zoom out, the layer will display. This property is typically used to display generalized layers at full extent, but then hide those layers when the user zooms in to a detailed extent.

If neither MinScale nor MaxScale are set, the layer will display at all scales. Note that scale can be set for renderers in a FeatureLayer by using ScaleDependentRenderer.

This property can be set only for dynamic layers. The ArcIMS server does not allow changing the scale factors for layers in the map service. An exception will be thrown if you attempt to set the MaxScale or MinScale for layers in the map service, or selection/buffer layers based on layers in the map service.

Scales can be set using a relative scale or by calculating the number of map units per pixel. A relative scale represents the scale in a ratio such as 1:24000. In this example, 1 meter equals 24000 meters, or 1 inch equals 24000 inches. When using relative scale, always use a colon (:) between the two values.

Map units per pixel refers to the number of meters, feet, or decimal degrees represented by one pixel in a map. To convert from a relative scale to map units per pixel, the size of a pixel must first be calculated. The formula for finding the number of meters in a pixel is 0.0254 / dpi. The value 0.0254 is the number of meters in an inch, and dpi is the dpi set in the ArcIMS service or request. If no dpi is set in the service or request, the dpi is assumed to be 96. As an example of pixel size, if the dpi is 96, the pixel size is 0.0254 / 96 or 0.000265 m. To convert from a relative scale to map units per pixel:

  • If the scale is in meters. To calculate the number of meters per pixel, take the relative scale and multiply by 0.000265. For example, if the relative scale is 1:24000, then the number of meters per pixel is 24000 * 0.000265, or 6.36 meters.
  • If the scale is in feet. Do the calculation for meters (#1). Multiply the result by 3.28 (the number of feet in a meter). For example, if the number of meters per pixel is 6.36, the number of feet is 6.36 * 3.28, or 20.86 feet.
  • If the scale is in decimal degrees. For these calculations, the Earth is assumed to be an exact sphere with a circumference of 40030.174 km. One degree is 111.195 km (40030.174/360 degrees), or 111195 meters. To calculate the number of degrees, first do the calculation for meters (#1). Next, divide the result by 111195. For example, if the number of meters per pixel is 6.36, the number of degrees is 6.36 / 111195, or 0.0000571968.

Note that for decimal degrees, the scale above will be increasingly inaccurate in the horizontal (x) dimension toward the poles. The length of a degree of longitude decreases toward the poles by the cosine of the latitude. If you want to adjust the horizontal scale for latitude, take the cosine of the latitude and multiply it times 111195. Then use this number to divide the number of meters per pixel. For example, at 40 degrees latitude north or south, the meters per degree is cos(40 degrees) * 111195 = 0.766044 * 111195 = 85180.3. If the number of meters per pixel is 6.36, the number of degrees per pixel is 6.36 / 85180.3, or 0.000074665. The scale in the vertical (y) dimension will remain at the value calculated with 111195 as above at all latitudes.

See Also

© 2010 All Rights Reserved.