I want to customize the DrawWidget that at a give map scale, the measure unit in the combobox can be automatically populated. I added the code below in private function activateDrawTool(event:MouseEvent):void {
if(map.scale >= 9600) {
cboDistance.selectedItem.name = getDefaultString('unitsMiles');
cboDistance.selectedItem.abbr = getDefaultString('unitsMilesAbbr');
} else {
cboDistance.selectedItem.name = getDefaultString('unitsFeet');
cboDistance.selectedItem.abbr = getDefaultString('unitsFeetAbbr');
}
But the value displayed in the combolist is not right. what' wrong here? Thanks.
if(map.scale >= 9600) {
cboDistance.selectedItem.name = getDefaultString('unitsMiles');
cboDistance.selectedItem.abbr = getDefaultString('unitsMilesAbbr');
} else {
cboDistance.selectedItem.name = getDefaultString('unitsFeet');
cboDistance.selectedItem.abbr = getDefaultString('unitsFeetAbbr');
}
But the value displayed in the combolist is not right. what' wrong here? Thanks.