KB10761 - How do I present the scale bar in miles using the DK? My map layer is in the WGS84 coordinate system.
For versions 8.x of the DK and Internet Server products:
Step 1: Use the GIS.Units property to set the map units to match the units of the map, which are defined by the coordinate system of the map. For projected coordinate systems, the units would typically be linear units, e.g., meters, feet, kilometers, nautical miles, etc. For maps in an unprojected coordinate system, the units would typically be angular, such as decimal degrees. The unprojected WGS84 coordinate system is defined with decimal degree units, so set the map units accordingly.
(The upgraded coordinate system support in the DK and IS 9.0 versions eliminates this step by automatically recognizing the coordinate system and units of any opened map file in most situations.)
Step 2: Set the Scale.Units property to reflect the distance units used for display. Suppose that your map is in decimal degrees. To generate the display in Nautical Miles, use:
; GIS.Units = gisUnitsTypeDegreeDecimal ;
; Scale.Units.Units = gisUnitsTypeMileNautical ;
Step 3: If you wish to display in distance units that are other than the default units that are provided, such as in statue miles, you can custom define any other distance unit by converting from meters. For example, to display in statute miles, use:
; Scale.Units.Setup( gisUnitsTypeLinear, 1609.344 )
1,609.344 meters = 1 statue mile
Keep in mind that the scale with a map layer in the WGS84 coordinate system is not consistent across the entire map - it varies depending on the distance of any map area from the equator. Therefore the scale bar with a WGS84 layer is designed to represent the distance scale at the center of any given map view.
Created: 2007-07-02, Modified: 2009-07-31