LineMerger under V2.0.4 (beta)

60 views
Skip to first unread message

Tom Saul

unread,
Apr 12, 2019, 2:50:13 PM4/12/19
to JSTS devs
I have pulled the current npm build of 2.0.4, and am attempting to use the LineMerger.  Any call to the add() method is resulting in an exception saying there is no 'this.add()' method.  Any thoughts on how to get past this?

Björn

unread,
Apr 12, 2019, 5:02:20 PM4/12/19
to JSTS devs
Can you provide more details please?

Tom Saul

unread,
Apr 12, 2019, 8:14:50 PM4/12/19
to JSTS devs
I'm working/testing using Firefox (latest rev) on Windows.  My code is similar to
                    ....
                    var lm = new jsts.operation.linemerge.LineMerger();
                    lm._factory = geometryFactory;

                    var geom = // Command that produces a linestring geometry type
                    lm.add(geom);  

When run in the debugger, the last call shows an exception.  Since I am using the minified code (I can't figure out how to use the base code directly - not really a JS person), I can't see details.  Same problem is occurring if I pass it a geometryCollection, and with several of the similar lineMerger classes - all complaining about 'this.add()' call.  If it makes a difference, this is buried in an old extJS application that also uses OpenLayers V2.

Let me know what else you need and I'll see if I can provide.

Björn

unread,
Apr 13, 2019, 3:56:24 AM4/13/19
to JSTS devs
It seems LineMerger works fine also with the single file build of 2.0.4 when used correctly, as proven by https://jsfiddle.net/u7w413z2/.

To me it seems your problems are rather caused by a combination of "buried in an old extJS application that also uses OpenLayers V2" and "not really a JS person" and I'm quite happy to not make them my problems. :)

Tom Saul

unread,
Apr 15, 2019, 1:00:37 PM4/15/19
to JSTS devs
FWIW - all other JSTS calls that are not related to this type of 'line merging' are working fine in the environment.  My guess is this will come back up again later, but I understand the desire to not spend time chasing this specific report.  Thanks for providing this tool.

Björn

unread,
Apr 15, 2019, 1:26:34 PM4/15/19
to JSTS devs
Thanks, I hope I did not cause discouragement. Feel free to report back with any additional findings or leads as to what might be causing your problems. FWIW, in supporting browsers, the source map at https://unpkg.com/js...@2.0.4/dist/jsts.min.js.map should be picked up automatically (if pulling jsts.min.js from the same source) to allow debugging almost as if running the unminified source.
Reply all
Reply to author
Forward
0 new messages