fix a potential JS error in Ox.Map

This commit is contained in:
rolux 2012-09-10 14:05:11 +02:00
parent 7230606a6d
commit 58706d1f99

View file

@ -577,12 +577,10 @@ Ox.Map = function(options, self) {
} }
function addPlaceToPlaces(data) { function addPlaceToPlaces(data) {
var place = getSelectedPlace(), var place = Ox.extend(getSelectedPlace() || {}, data),
country = place ? Ox.getCountryByGeoname(place.geoname) : {}; country = place ? Ox.getCountryByGeoname(place.geoname) : {};
Ox.extend(place, data);
self.options.selected = place.id;
place.countryCode = country ? country.code : ''; place.countryCode = country ? country.code : '';
Ox.Log('Map', 'addP2P', data, place); self.options.selected = place.id;
setPlaceControls(place); setPlaceControls(place);
place.marker.update(); place.marker.update();
place.rectangle.update(); place.rectangle.update();