fix getting wrong coordinates for places in list

This commit is contained in:
Sanjay Bhangar 2025-08-09 17:23:30 +02:00
commit 411cfed6cc
4 changed files with 7 additions and 18 deletions

View file

@ -123,13 +123,9 @@ Ox.Map = function(options, self) {
that.resizeMap();
},
places: function() {
console.log('MAP OPTIONS.PLACES UPDATE - Processing places array, count:', self.options.places ? self.options.places.length : 0);
console.trace('MAP OPTIONS.PLACES UPDATE - Stack trace');
// Prevent rebuilding places while editing to avoid breaking references
var editingPlace = getSelectedPlace();
if (editingPlace && editingPlace.editing) {
console.log('MAP OPTIONS.PLACES UPDATE - Skipping rebuild because place is being edited:', editingPlace.id);
return;
}
@ -258,8 +254,6 @@ Ox.Map = function(options, self) {
});
//FIXME: duplicated in update
console.log('MAP INIT - Processing places array (duplicated code), count:', self.options.places ? self.options.places.length : 0);
console.trace('MAP INIT - Stack trace');
if (Ox.isArray(self.options.places)) {
self.options.places.forEach(function(place) {
if (Ox.isUndefined(place.id)) {
@ -1741,7 +1735,7 @@ Ox.Map = function(options, self) {
Ox.Log('Map', 'Map.value', id, key, value);
var place = getPlaceById(id);
if (!place) {
console.error('Map.value - place not found for id:', id, 'Available places:', Object.keys(self.options.places || {}));
console.error('Map.value - place not found for id:', id);
return;
}
place.options(key, value);