1
0
Fork 0
forked from 0x2620/oxjs

improve listmap editing functionality

This commit is contained in:
rolux 2011-05-24 13:43:27 +02:00
commit b17e8a783b
6 changed files with 48 additions and 35 deletions

View file

@ -407,13 +407,14 @@ Ox.Map = function(options, self) {
}
function addPlaceToPlaces(data) {
var place = getSelectedPlace();
var place = getSelectedPlace(),
country = Ox.getCountryByGeoname(place.geoname);
if (self.options.selected == place.id) {
self.options.selected = place.id.substr(1);
}
place.id = place.id.substr(1); // fixme: NOT SAFE!
Ox.extend(place, data);
place.countryCode = Ox.getCountryByGeoname(place.geoname).code;
place.countryCode = country ? country.code : '';
place.marker.update();
self.places.push(place);
self.resultPlace = null;