formatted area output in place panel

This commit is contained in:
rolux 2011-05-31 10:42:22 +02:00
parent 64f493676b
commit 61404dd776
2 changed files with 15 additions and 9 deletions

View file

@ -444,7 +444,7 @@ Ox.ListMap = function(options, self) {
self.$map.value(self.selectedPlace, 'type', data.selected[0]);
}
})
], ['South', 'West', 'North', 'East', 'Latitude', 'Longitude'].map(function(v) {
], ['Latitude', 'Longitude', 'South', 'West', 'North', 'East'].map(function(v) {
var id = (
v == 'Latitude' ? 'lat' : v == 'Longitude' ? 'lng' : v
).toLowerCase(),
@ -462,14 +462,8 @@ Ox.ListMap = function(options, self) {
});
}), [
self.$areaInput = Ox.Input({
disabled: true,
id: 'area',
label: 'Area',
labelWidth: 80,
textAlign: 'right',
type: 'float',
width: 240
})
}).hide()
]);
self.$placeForm = Ox.Form({
@ -479,6 +473,17 @@ Ox.ListMap = function(options, self) {
.css({margin: '8px'})
.hide();
self.$areaKmInput = Ox.Input({
disabled: true,
id: 'areaKm',
label: 'Area',
labelWidth: 80,
textAlign: 'right',
width: 240
})
.css({margin: '4px 0 4px 0'})
.appendTo(self.$placeForm);
self.$placeStatusbar = Ox.Bar({
size: 24
});
@ -699,6 +704,7 @@ Ox.ListMap = function(options, self) {
self.$placeTitleName.options({title: place.geoname || ''});
self.$placeTitle.show();
self.$placeForm.values(place).show();
self.$areaKmInput.options({value: Ox.formatArea(place.area)});
self.$placeButton.options({title: isResult ? 'Add Place' : 'Remove Place'});
self.$revertButton.options({disabled: true}).show();
} else {

View file

@ -21,7 +21,7 @@ Ox.MapMarker = function(options) {
var that = this,
typeColor = {
country: [0, 255, 255],
country: [0, 128, 255],
region: [255, 0, 255],
city: [255, 0, 0],
borough: [255, 128, 0],