argic for android实现比例尺,没有相关图层Api,所以界面显示只能自己实现,以下是计算方法:
public void getScaleText(double scale) {
scale /= 100;//转成厘米:米
String formatStr = null;
if(scale >= 1000){
scale /= 1000;
formatStr = "%1$.1f公里";
}else if(scale >= 1 ){
formatStr = "%1$.1f米";
}else if(scale >= 0.1){
scale *= 10;
formatStr = "%1$.1f分米";
}else{
scale *= 100;
formatStr = "%1$.1f厘米";
}
return String.format(formatStr, (float)scale);
}