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

@ -39,7 +39,12 @@ Ox.MapPlace = function(options) {
var that = this;
Ox.forEach(options, function(val, key) {
that[key] = val;
// Ensure coordinate values are independent copies, not shared references
if (key === 'south' || key === 'north' || key === 'east' || key === 'west') {
that[key] = parseFloat(val) || 0;
} else {
that[key] = val;
}
});
// Ensure editable is set for existing places that might not have this property
@ -47,7 +52,6 @@ Ox.MapPlace = function(options) {
that.editable = true;
}
console.log('MAPPLACE CONSTRUCTOR - Creating place with ID:', that.id, 'name:', that.name);
update();