I want to intersect two polygons within an OpenLayers layer. I found the JSTS library, which should be able to intersect two polygons, and return the new created polygon of the intersection. The function to use: intersection
polygon1.intersection(polygon2)
Using the OpenLayers Polygons directly, I get errors, resulting of the missing functions, added by JSTS. And if I use JSTS Polygons, there seems still something missing.
this.getFactory().createGeometryCollection is not a function
How do I get an intersection of those two polygons?