Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge() being called in collect_ways() but merge() doesn't exist #109

Open
jmullaney2003 opened this issue Jan 28, 2020 · 0 comments
Open

Comments

@jmullaney2003
Copy link

Orig code:

collect_ways: function() {
    this.members.each(function(member) {
        this.nodes = member.nodes.concat(this.nodes)
        if (member.tags.size() > 0) this.tags.merge(member.tags)
    },this)
},

I'm guessing that the map-layer files I'm generating are enough different from the standard files that this bug was uncovered.

Unfortunately I don't understand the code well enough to suggest a real fix.
Here's my workaround so that the code doesn't crash - I "merge" the tags:

collect_ways: function() {
    this.members.each(function(member) {
        this.nodes = member.nodes.concat(this.nodes);
        if (member.tags.size() > 0)        // if there are member.tags
        {                                  // then merge them into this.tags
            for (let member_tags_key in member.tags._object)  // for all tags found in member.tags
            {                                                 // see if the member tag needs to be copied to this.tags
                if (isUndefined(this.tags[member_tags_key]))      // if the tag from member.tags is not in this.tags
                {                                                 // then copy it to this.tags
                    this.tags[member_tags_key] = member.tags._object[member_tags_key];
                }
            }
      }
    },this)
},

Maybe I've got this all wrong and there really is a merge() method.
If so, please set me right.
Or please suggest a real fix for this problem.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant