diff --git a/source/Ox.UI/js/Map/Map.js b/source/Ox.UI/js/Map/Map.js index 8786006a..8bcf239a 100644 --- a/source/Ox.UI/js/Map/Map.js +++ b/source/Ox.UI/js/Map/Map.js @@ -117,6 +117,17 @@ Ox.Map = function(options, self) { that.resizeMap(); }, places: function() { + if (Ox.isArray(self.options.places)) { + self.options.places.forEach(function(place) { + if (Ox.isUndefined(place.id)) { + place.id = Ox.encodeBase32(Ox.uid()); + } + }); + self.options.places = Ox.api(self.options.places, { + geo: true, + sort: '-area' + }); + } addPlaces(); getMapBounds(function(mapBounds) { if (mapBounds) { @@ -240,6 +251,7 @@ Ox.Map = function(options, self) { } }); + //FIXME: duplicated in update if (Ox.isArray(self.options.places)) { self.options.places.forEach(function(place) { if (Ox.isUndefined(place.id)) {