fix getting wrong coordinates for places in list
This commit is contained in:
parent
8fc5297f39
commit
411cfed6cc
4 changed files with 7 additions and 18 deletions
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue