(1)从arcgis_api_for_flex_3_0.zipArcGIS_Flexskinssrccomesriagsskins中解压ScaleBarMetricSkin.mxml到项目的srccomesriviewerskins目录下
(2)修改default.css,增加如下定义
esri|ScaleBar
{
skin-class: ClassReference("com.esri.viewer.skins.ScaleBarMetricSkin");
bottom: 5;
}
(3)修改ScaleBarMetricSkin.mxml中的measure函数
if (hostComponent.textMetric)
{
label.text = hostComponent.textMetric.replace("km","公里").replace("m","米");
}
label.x = hostComponent.lengthMetric + 5;
super.measure();