You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I received your response by email, but it doesn't show here. It makes sense to me that nodeBuilding[i] remains linked to the object.
However, why does tags in var tags = nodeBuilding[i].tags remain linked to the object?
I saw some stage things where operating on node.lon = function ( node.lat ) ended up overwriting node.lat (see geoutils.js in our repo). Couldn't really make sense of that :(
(c.f. exports.flatten = function(dataset)... else if (latlon.lat)... in https://github.com/OSM-Utilities/JOSM-Scripts-HOT/blob/master/lib/geoutils.js)
However, why does tags in var tags = nodeBuilding[i].tags remain linked to the object?
I deleted my previous responsive because I realized it was useless, since you were talking about the link quoted above and not about p.tags[something];
We've got a script here:
https://github.com/OSM-Utilities/JOSM-Scripts-HOT/blob/master/examples/nodeBuilding2Way.js
If you search for "pass-by-ref?", you'll see this comment:
// Does not work: If nodes[j].tags is set to null, tags also becomes null. pass-by-ref?
It appears that in "var tags = nodeBuilding[i].tags;", the element is passed by reference. If tags=null, then nodeBuilding[i].tags also becomes null.
Possibly related example here:
https://github.com/OSM-Utilities/JOSM-Scripts-HOT/blob/master/addOLC.js
(search for "pass-by-ref?").
Setting "var tags = object.tags" and later on object.tags=tags doesn't work.
Any thoughts on this?
The text was updated successfully, but these errors were encountered: